return 0;
}
+//& purpose: Finds records based on a given keyword for snippet.
+//& type: auto
+/**
+* @testcase ITc_contacts_db_search_records_for_snippet_p
+* @since_tizen 3.0
+* @author SRID(sameer.g1)
+* @reviewer SRID(a.pandia1)
+* @type auto
+* @description Finds records based on a given keyword.
+* @scenario Connect to contacts service\n
+* To find record for a given keyword\n
+* Disconnect to contacts service
+* @apicovered contacts_db_search_records_for_snippet()
+* @passcase When contacts_db_search_records_for_snippet are successful.
+* @failcase If target API fails or any precondition API fails.
+* @precondition contacts_connect() should be called to open a connection to the contacts service
+* @postcondition None
+*/
+int ITc_contacts_db_search_records_for_snippet_p(void)
+{
+ START_TEST;
+
+ const char* pszKeyword = "test";
+ int nOffset = 0;
+ int nLimit = 0;
+ contacts_list_h stList;
+
+ // Target API
+ int nRet = contacts_db_search_records_for_snippet(_contacts_person._uri, pszKeyword, nOffset, nLimit, NULL, NULL, -1, &stList);
+ PRINT_RESULT_CLEANUP(CONTACTS_ERROR_NONE, nRet, "contacts_db_search_records_for_snippet", ContactsServiceGetError(nRet),contacts_list_destroy(stList, true));
+ if ( stList == NULL )
+ {
+ FPRINTF("[Line : %d][%s] contacts_db_search_records_for_snippet failed, returned NULL value \\n", __LINE__, API_NAMESPACE);
+ contacts_list_destroy(stList, true);
+ return 1;
+ }
+
+ nRet = contacts_list_destroy(stList, true);
+ PRINT_RESULT_NORETURN(CONTACTS_ERROR_NONE, nRet, "contacts_list_destroy", ContactsServiceGetError(nRet));
+
+ return 0;
+}
+
+//& purpose: To Finds records based on a keyword and range for snippet.
+//& type: auto
+/**
+* @testcase ITc_contacts_db_search_records_with_range_for_snippet_p
+* @since_tizen 3.0
+* @author SRID(sameer.g1)
+* @reviewer SRID(a.pandia1)
+* @type auto
+* @description To find records based on a keyword and range.
+* @scenario connect to contacts service\n
+* set the range and accordingly find record based on keyword\n
+* disconnect to contacts service
+* @apicovered contacts_db_search_records_with_range_for_snippet()
+* @passcase When contacts_db_search_records_with_range_for_snippet are successful.
+* @failcase If target API fails or any precondition API fails.
+* @precondition contacts_connect() should be called to open a connection to the contacts service
+* @postcondition None
+*/
+int ITc_contacts_db_search_records_with_range_for_snippet_p(void)
+{
+ START_TEST;
+
+ const char* pszKeyword = "test";
+ int nOffset = 0;
+ int nLimit = 0;
+ int nRange = 1;
+ contacts_list_h stList;
+
+ // Target API
+ int nRet = contacts_db_search_records_with_range_for_snippet(_contacts_person._uri, pszKeyword, nOffset, nLimit, nRange,NULL, NULL, -1, &stList);
+ PRINT_RESULT_CLEANUP(CONTACTS_ERROR_NONE, nRet, "contacts_db_search_records_with_range_for_snippet", ContactsServiceGetError(nRet),contacts_list_destroy(stList, true));
+ if ( stList == NULL )
+ {
+ FPRINTF("[Line : %d][%s] contacts_db_search_records_with_range_for_snippet failed, returned NULL value \\n", __LINE__, API_NAMESPACE);
+ contacts_list_destroy(stList, true);
+ return 1;
+ }
+
+ nRet = contacts_list_destroy(stList, true);
+ PRINT_RESULT_NORETURN(CONTACTS_ERROR_NONE, nRet, "contacts_list_destroy", ContactsServiceGetError(nRet));
+
+ return 0;
+}
+
+//& purpose: To find records based on given query and keyword.
+//& type: auto
+/**
+* @testcase ITc_contacts_db_search_records_with_query_for_snippet_p
+* @since_tizen 3.0
+* @author SRID(sameer.g1)
+* @reviewer SRID(a.pandia1)
+* @type auto
+* @description To find records based on given query and keyword.
+* @scenario connect to contacts service\n
+* Use query on keyword to find record\n
+* Disconnect to contacts service
+* @apicovered contacts_db_search_records_with_query_for_snippet
+* @passcase When contacts_db_search_records_with_query_for_snippet are successful.
+* @failcase If target API fails or any precondition API fails.
+* @precondition contacts_connect() should be called to open a connection to the contacts service
+* @postcondition None
+*/
+int ITc_contacts_db_search_records_with_query_for_snippet_p(void)
+{
+ START_TEST;
+
+ const char* pszKeyword = "test";
+ int nOffset = 0;
+ int nLimit = 0;
+ contacts_list_h stList;
+ contacts_query_h query = NULL;
+
+ int nRet = contacts_query_create(_contacts_person._uri, &query);
+ PRINT_RESULT(CONTACTS_ERROR_NONE, nRet, "contacts_query_create", ContactsServiceGetError(nRet));
+
+ // Target API
+ nRet = contacts_db_search_records_with_query_for_snippet(query, pszKeyword, nOffset, nLimit,NULL, NULL, -1, &stList);
+ PRINT_RESULT_CLEANUP(CONTACTS_ERROR_NONE, nRet, "contacts_db_search_records_with_query_for_snippet", ContactsServiceGetError(nRet),contacts_list_destroy(stList, true);contacts_query_destroy(query));
+ if ( stList == NULL )
+ {
+ FPRINTF("[Line : %d][%s] contacts_db_search_records_with_query_for_snippet failed, returned NULL value \\n", __LINE__, API_NAMESPACE);
+ contacts_list_destroy(stList, true);
+ return 1;
+ }
+
+
+ nRet = contacts_list_destroy(stList, true);
+ PRINT_RESULT_CLEANUP(CONTACTS_ERROR_NONE, nRet, "contacts_list_destroy", ContactsServiceGetError(nRet),contacts_query_destroy(query));
+
+ nRet = contacts_query_destroy(query);
+ PRINT_RESULT_NORETURN(CONTACTS_ERROR_NONE, nRet, "contacts_query_destroy", ContactsServiceGetError(nRet));
+ return 0;
+
+}
+
/** @} */
/** @} */
extern int ITc_contacts_vcard_parse_to_contact_foreach_p(void);
extern int ITc_contacts_vcard_parse_to_contacts_p(void);
extern int ITc_contacts_vcard_set_get_limit_size_of_photo_p(void);
+extern int ITc_contacts_db_search_records_with_query_for_snippet_p(void);
+extern int ITc_contacts_db_search_records_with_range_for_snippet_p(void);
+extern int ITc_contacts_db_search_records_for_snippet_p(void);
testcase tc_array[] = {
{"ITc_contacts_activity_delete_by_account_id_p", ITc_contacts_activity_delete_by_account_id_p, ITs_contacts_service2_activity_startup, ITs_contacts_service2_activity_cleanup},
{"ITc_contacts_vcard_parse_to_contact_foreach_p", ITc_contacts_vcard_parse_to_contact_foreach_p, ITs_contacts_service2_vcard_startup, ITs_contacts_service2_vcard_cleanup},
{"ITc_contacts_vcard_parse_to_contacts_p", ITc_contacts_vcard_parse_to_contacts_p, ITs_contacts_service2_vcard_startup, ITs_contacts_service2_vcard_cleanup},
{"ITc_contacts_vcard_set_get_limit_size_of_photo_p", ITc_contacts_vcard_set_get_limit_size_of_photo_p, ITs_contacts_service2_vcard_startup, ITs_contacts_service2_vcard_cleanup},
+ {"ITc_contacts_db_search_records_with_query_for_snippet_p", ITc_contacts_db_search_records_with_query_for_snippet_p, ITs_contacts_service2_database_startup, ITs_contacts_service2_database_cleanup},
+ {"ITc_contacts_db_search_records_with_range_for_snippet_p", ITc_contacts_db_search_records_with_range_for_snippet_p, ITs_contacts_service2_database_startup, ITs_contacts_service2_database_cleanup},
+ {"ITc_contacts_db_search_records_for_snippet_p", ITc_contacts_db_search_records_for_snippet_p, ITs_contacts_service2_database_startup,ITs_contacts_service2_database_cleanup},
{NULL, NULL}
};
extern int ITc_contacts_vcard_parse_to_contact_foreach_p(void);
extern int ITc_contacts_vcard_parse_to_contacts_p(void);
extern int ITc_contacts_vcard_set_get_limit_size_of_photo_p(void);
+extern int ITc_contacts_db_search_records_with_query_for_snippet_p(void);
+extern int ITc_contacts_db_search_records_with_range_for_snippet_p(void);
+extern int ITc_contacts_db_search_records_for_snippet_p(void);
testcase tc_array[] = {
{"ITc_contacts_activity_delete_by_account_id_p", ITc_contacts_activity_delete_by_account_id_p, ITs_contacts_service2_activity_startup, ITs_contacts_service2_activity_cleanup},
{"ITc_contacts_vcard_parse_to_contact_foreach_p", ITc_contacts_vcard_parse_to_contact_foreach_p, ITs_contacts_service2_vcard_startup, ITs_contacts_service2_vcard_cleanup},
{"ITc_contacts_vcard_parse_to_contacts_p", ITc_contacts_vcard_parse_to_contacts_p, ITs_contacts_service2_vcard_startup, ITs_contacts_service2_vcard_cleanup},
{"ITc_contacts_vcard_set_get_limit_size_of_photo_p", ITc_contacts_vcard_set_get_limit_size_of_photo_p, ITs_contacts_service2_vcard_startup, ITs_contacts_service2_vcard_cleanup},
+ {"ITc_contacts_db_search_records_with_query_for_snippet_p", ITc_contacts_db_search_records_with_query_for_snippet_p, ITs_contacts_service2_database_startup, ITs_contacts_service2_database_cleanup},
+ {"ITc_contacts_db_search_records_with_range_for_snippet_p", ITc_contacts_db_search_records_with_range_for_snippet_p, ITs_contacts_service2_database_startup, ITs_contacts_service2_database_cleanup},
+ {"ITc_contacts_db_search_records_for_snippet_p", ITc_contacts_db_search_records_for_snippet_p, ITs_contacts_service2_database_startup,ITs_contacts_service2_database_cleanup},
{NULL, NULL}
};