[UTC][contacts-service2][ACR-1542][New UTC added to get count for search query API's] 22/230322/6
authorkamaljeet chauhan <kamal.jc@samsung.com>
Thu, 9 Apr 2020 08:37:51 +0000 (14:07 +0530)
committerkamaljeet chauhan <kamal.jc@samsung.com>
Thu, 30 Apr 2020 04:14:56 +0000 (09:44 +0530)
Change-Id: I83b730e34b1b389810f10ac395c11d8014bb705c
Signed-off-by: kamaljeet chauhan <kamal.jc@samsung.com>
38 files changed:
src/utc/contacts-service2/tct-contacts-service2-core_mobile.h
src/utc/contacts-service2/tct-contacts-service2-core_tizeniot.h
src/utc/contacts-service2/tct-contacts-service2-core_wearable.h
src/utc/contacts-service2/utc-contacts-service-db-activity-photo.c
src/utc/contacts-service2/utc-contacts-service-db-activity.c
src/utc/contacts-service2/utc-contacts-service-db-address-book.c
src/utc/contacts-service2/utc-contacts-service-db-address.c
src/utc/contacts-service2/utc-contacts-service-db-company.c
src/utc/contacts-service2/utc-contacts-service-db-contact-updated-info.c
src/utc/contacts-service2/utc-contacts-service-db-contact.c
src/utc/contacts-service2/utc-contacts-service-db-email.c
src/utc/contacts-service2/utc-contacts-service-db-event.c
src/utc/contacts-service2/utc-contacts-service-db-extension.c
src/utc/contacts-service2/utc-contacts-service-db-group-member-updated-info.c
src/utc/contacts-service2/utc-contacts-service-db-group-relation.c
src/utc/contacts-service2/utc-contacts-service-db-group-updated-info.c
src/utc/contacts-service2/utc-contacts-service-db-group.c
src/utc/contacts-service2/utc-contacts-service-db-grouprel-updated-info.c
src/utc/contacts-service2/utc-contacts-service-db-image.c
src/utc/contacts-service2/utc-contacts-service-db-messenger.c
src/utc/contacts-service2/utc-contacts-service-db-my-profile-updated-info.c
src/utc/contacts-service2/utc-contacts-service-db-my-profile.c
src/utc/contacts-service2/utc-contacts-service-db-name.c
src/utc/contacts-service2/utc-contacts-service-db-nickname.c
src/utc/contacts-service2/utc-contacts-service-db-note.c
src/utc/contacts-service2/utc-contacts-service-db-number.c
src/utc/contacts-service2/utc-contacts-service-db-person.c
src/utc/contacts-service2/utc-contacts-service-db-phone-log-stat.c
src/utc/contacts-service2/utc-contacts-service-db-phone-log.c
src/utc/contacts-service2/utc-contacts-service-db-profile.c
src/utc/contacts-service2/utc-contacts-service-db-relationship.c
src/utc/contacts-service2/utc-contacts-service-db-sdn.c
src/utc/contacts-service2/utc-contacts-service-db-simple-contact.c
src/utc/contacts-service2/utc-contacts-service-db-sip.c
src/utc/contacts-service2/utc-contacts-service-db-speeddial.c
src/utc/contacts-service2/utc-contacts-service-db-url.c
src/utc/contacts-service2/utc-contacts-service-db.c
src/utc/contacts-service2/utc-contacts-service-tc-utils.h

index 8edfdf897db9aa5133e49147f23d28eb1c0d8f3f..e4eb4150d73720fa7336f0848d4192ba4d6bf283 100755 (executable)
@@ -191,6 +191,12 @@ extern int utc_contacts_service2_db_search_records_with_query_p(void);
 extern int utc_contacts_service2_db_search_records_with_query_n(void);
 extern int utc_contacts_service2_db_search_records_with_range_p(void);
 extern int utc_contacts_service2_db_search_records_with_range_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_query_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_query_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_range_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_range_n(void);
 extern int utc_contacts_service2_db_search_records_for_snippet_p(void);
 extern int utc_contacts_service2_db_search_records_for_snippet_n(void);
 extern int utc_contacts_service2_db_search_records_with_query_for_snippet_p(void);
@@ -409,6 +415,12 @@ testcase tc_array[] = {
        {"utc_contacts_service2_db_search_records_with_query_n",utc_contacts_service2_db_search_records_with_query_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_range_p",utc_contacts_service2_db_search_records_with_range_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_range_n",utc_contacts_service2_db_search_records_with_range_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_p",utc_contacts_service2_db_get_count_for_search_records_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_n",utc_contacts_service2_db_get_count_for_search_records_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_query_p",utc_contacts_service2_db_get_count_for_search_records_with_query_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_query_n",utc_contacts_service2_db_get_count_for_search_records_with_query_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_range_p",utc_contacts_service2_db_get_count_for_search_records_with_range_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_range_n",utc_contacts_service2_db_get_count_for_search_records_with_range_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_for_snippet_p",utc_contacts_service2_db_search_records_for_snippet_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_for_snippet_n",utc_contacts_service2_db_search_records_for_snippet_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_query_for_snippet_p",utc_contacts_service2_db_search_records_with_query_for_snippet_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
index 365e509495febe97152620dca5459fc209900034..08df42e9c29a67e0af7ae373965467cadbd1ae0f 100755 (executable)
@@ -184,6 +184,12 @@ extern int utc_contacts_service2_db_search_records_with_query_p(void);
 extern int utc_contacts_service2_db_search_records_with_query_n(void);
 extern int utc_contacts_service2_db_search_records_with_range_p(void);
 extern int utc_contacts_service2_db_search_records_with_range_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_query_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_query_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_range_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_range_n(void);
 extern int utc_contacts_service2_db_search_records_for_snippet_p(void);
 extern int utc_contacts_service2_db_search_records_for_snippet_n(void);
 extern int utc_contacts_service2_db_search_records_with_query_for_snippet_p(void);
@@ -395,6 +401,12 @@ testcase tc_array[] = {
        {"utc_contacts_service2_db_search_records_with_query_n",utc_contacts_service2_db_search_records_with_query_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_range_p",utc_contacts_service2_db_search_records_with_range_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_range_n",utc_contacts_service2_db_search_records_with_range_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_p",utc_contacts_service2_db_search_records_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_n",utc_contacts_service2_db_search_records_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_query_p",utc_contacts_service2_db_search_records_with_query_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_query_n",utc_contacts_service2_db_search_records_with_query_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_range_p",utc_contacts_service2_db_search_records_with_range_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_range_n",utc_contacts_service2_db_search_records_with_range_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_for_snippet_p",utc_contacts_service2_db_search_records_for_snippet_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_for_snippet_n",utc_contacts_service2_db_search_records_for_snippet_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_query_for_snippet_p",utc_contacts_service2_db_search_records_with_query_for_snippet_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
index 060b0ed4c408382c2b79cae059d2def8268acb2b..4053d9e18fe28ee7ee8dc531d80f576b11f85364 100755 (executable)
@@ -188,6 +188,12 @@ extern int utc_contacts_service2_db_search_records_with_query_p(void);
 extern int utc_contacts_service2_db_search_records_with_query_n(void);
 extern int utc_contacts_service2_db_search_records_with_range_p(void);
 extern int utc_contacts_service2_db_search_records_with_range_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_query_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_query_n(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_range_p(void);
+extern int utc_contacts_service2_db_get_count_for_search_records_with_range_n(void);
 extern int utc_contacts_service2_db_search_records_for_snippet_p(void);
 extern int utc_contacts_service2_db_search_records_for_snippet_n(void);
 extern int utc_contacts_service2_db_search_records_with_query_for_snippet_p(void);
@@ -403,6 +409,13 @@ testcase tc_array[] = {
        {"utc_contacts_service2_db_search_records_with_query_n",utc_contacts_service2_db_search_records_with_query_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_range_p",utc_contacts_service2_db_search_records_with_range_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_range_n",utc_contacts_service2_db_search_records_with_range_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_p",utc_contacts_service2_db_get_count_for_search_records_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_n",utc_contacts_service2_db_get_count_for_search_records_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_query_p",utc_contacts_service2_db_get_count_for_search_records_with_query_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_query_n",utc_contacts_service2_db_get_count_for_search_records_with_query_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_range_p",utc_contacts_service2_db_get_count_for_search_records_with_range_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_get_count_for_search_records_with_range_n",utc_contacts_service2_db_get_count_for_search_records_with_range_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
+       {"utc_contacts_service2_db_search_records_for_snippet_p",utc_contacts_service2_db_search_records_for_snippet_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_for_snippet_p",utc_contacts_service2_db_search_records_for_snippet_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_for_snippet_n",utc_contacts_service2_db_search_records_for_snippet_n,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
        {"utc_contacts_service2_db_search_records_with_query_for_snippet_p",utc_contacts_service2_db_search_records_with_query_for_snippet_p,utc_contacts_service2_db_startup,utc_contacts_service2_db_cleanup},
index f7b96d694fc7f89a367129c65796ac8abdab8765..0faa3032955831324b6101eb1ccd48f831b9230d 100755 (executable)
@@ -63,6 +63,9 @@ ctsvc_tc_db_plugin_s _tc_db_activity_photo = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_activity_photo(void)
index 716880cd47c8fba41fd4e7f8c3fc564eb46c0373..c663ee0cd6a8ecae87955d5707aeb4ea26c83c0d 100755 (executable)
@@ -59,6 +59,9 @@ ctsvc_tc_db_plugin_s _tc_db_activity = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_activity(void)
index f598f4f8a2bf4fb4ed5d6d2dd1ee00da05086bef..925110640b7d944cd3312cdac15fe16af8d9ec2a 100755 (executable)
@@ -57,6 +57,9 @@ ctsvc_tc_db_plugin_s _tc_db_address_book = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_address_book(void)
index 9181895c38b2e704d68eca576d2c308c69172e3b..d3ee995821fd645163a64e11231c62485358b0ff 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_address = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_address(void)
index 059f10e5b372c3798f40c4eee7073899f13a165f..8e2a311cd4ac2db4dc2b31723838be283eaa88cb 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_company = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_company(void)
index 0c461e786a766e3b49422b593913ab4a9d6c8aa2..852ceb90925349930df468cca3084e2506cf1b22 100755 (executable)
@@ -47,6 +47,9 @@ ctsvc_tc_db_plugin_s _tc_db_contact_updated_info = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_get_chages_by_version_contact_updated_info(int account_id)
index 00d53095899ce96b5e40ece714defdffaf659264..6d0826b7126444069fdb054f50243269b2679f87 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_contact = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_contact(void)
index 6327792037e2356a7311d68abf79705db48448bd..8fffd411fa52adea08d38d51a8a42b0da37ce48e 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_email = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_email(void)
index 6ca9f8dce4b7ad2cefea5b01c1f01924084e84f8..4033e5c5a6bdcbaf91002a7581adbea1f6e2d8ac 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_event = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_event(void)
index ae62ef43c98bb1b267c149a635c1ebf119b9d27b..c34e82d4adb43cb1fec534903e90b13d6dc5694e 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_extension = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_extension(void)
index 94711d5bfa4633a55ca89f4239f8c7856484acb3..d828836377e39af77e457a83fd5d8215eba520f7 100755 (executable)
@@ -47,6 +47,9 @@ ctsvc_tc_db_plugin_s _tc_db_group_member_updated_info = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_get_chages_by_version_group_member_updated_info(int account_id)
index a234e0d8ec49bd406cbd13027772da7dac61d130..0de21d251043c720742d857c7cd9ef5290f0fba7 100755 (executable)
@@ -54,6 +54,9 @@ ctsvc_tc_db_plugin_s _tc_db_group_relation = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_group_relation(void)
index 410d4eac05f8ab28385f7b397d8dd7fb7cd21c5d..b8f7c9e479f76cb3ebceaef809c1129f3e24598c 100755 (executable)
@@ -46,6 +46,9 @@ ctsvc_tc_db_plugin_s _tc_db_group_updated_info = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_get_chages_by_version_group_updated_info(int account_id)
index f484ba18f7274df536158c160054495d3333776f..1bde438531bacbec84656ca57fac561b0c3c8f1a 100755 (executable)
@@ -59,6 +59,9 @@ ctsvc_tc_db_plugin_s _tc_db_group = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_group(void)
index dffe172b7e4889c245fc43c8fb0cdb649a88175f..41f0fd8b7742622b2871aa65687b230edb30af93 100755 (executable)
@@ -46,6 +46,9 @@ ctsvc_tc_db_plugin_s _tc_db_grouprel_updated_info = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_get_chages_by_version_grouprel_updated_info(int account_id)
index ee949d3c23bc6b7a12bdf49e70d4928bc7e8c8dd..5fbdde04ada1dd995fd7317f2bac5e6b65596724 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_image = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_image(void)
index d14764be5221ea55ab70f4070f54d90dff178628..f99be356bd9cf939a2450469b75675042ffa7ccc 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_messenger = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_messenger(void)
index 6e1fd7a5809d22a78d9d3d0e18ce2ba7c8ec70f4..15465de4dec62ced37608eb6e0f111dc2f585709 100755 (executable)
@@ -47,6 +47,9 @@ ctsvc_tc_db_plugin_s _tc_db_my_profile_updated_info = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_get_chages_by_version_my_profile_updated_info(int account_id)
index c559dd3d01f7420d2eac8a16ec1a4b23f6e12d4d..1645acbd8c76a767ccb3151c7caf56dc9f6e0cd2 100755 (executable)
@@ -57,6 +57,9 @@ ctsvc_tc_db_plugin_s _tc_db_my_profile = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_my_profile(void)
index 07151ca33c7196acd336aa22488d6f11f2b2fcd9..0365997990f275cabbcc5e12c93d33e2212f37ec 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_name = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_name(void)
index fdf6583d44c8da3959afb87d1b4743578da666f6..02fd0cda70fb46436f485146248fb21bcfaaf2e4 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_nickname = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_nickname(void)
index a5bf5b9155009d011f9ac39504794e5dec7e24d8..4c210afc65495965e832efe5397a4893cbe40b0b 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_note = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_note(void)
index 1a17aff5b1eeab0592592e034991fa3c3e1af50e..767fe2ba2bcdb152fa854043553fef85553e1be2 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_number = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_number(void)
index 58ec1bdce9c21d65d9a9357f8d822a8540e4bf85..f055803a21a0721ce27156e9e43ce17e38abbd9b 100755 (executable)
@@ -41,6 +41,9 @@ static int _ctsvc_tc_db_search_records_with_range_person(int account_id);
 static int _ctsvc_tc_db_search_records_for_snippet_person(int account_id);
 static int _ctsvc_tc_db_search_records_with_query_for_snippet_person(int account_id);
 static int _ctsvc_tc_db_search_records_with_range_for_snippet_person(int account_id);
+static int _ctsvc_tc_db_get_count_for_search_records_person(int account_id);
+static int _ctsvc_tc_db_get_count_for_search_records_with_query_person(int account_id);
+static int _ctsvc_tc_db_get_count_for_search_records_with_range_person(int account_id);
 
 
 ctsvc_tc_db_plugin_s _tc_db_person = {
@@ -66,6 +69,9 @@ ctsvc_tc_db_plugin_s _tc_db_person = {
        .db_search_records_for_snippet = _ctsvc_tc_db_search_records_for_snippet_person,
        .db_search_records_with_query_for_snippet = _ctsvc_tc_db_search_records_with_query_for_snippet_person,
        .db_search_records_with_range_for_snippet = _ctsvc_tc_db_search_records_with_range_for_snippet_person,
+       .db_get_count_for_search_records = _ctsvc_tc_db_get_count_for_search_records_person,
+       .db_get_count_for_search_records_with_query = _ctsvc_tc_db_get_count_for_search_records_with_query_person,
+       .db_get_count_for_search_records_with_range = _ctsvc_tc_db_get_count_for_search_records_with_range_person,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_person(void)
@@ -830,3 +836,136 @@ int ctsvc_tc_db_insert_record_person(int address_book_id, int group_id, ctsvc_pr
        contacts_record_destroy(record, true);
        return ret;
 }
+
+
+static int _ctsvc_tc_db_get_count_for_search_records_person(int account_id)
+{
+       int ret = 0;
+       int ids[2]= {0};
+       int ids_count = 0;
+       int address_book_id = 0;
+       int group_id = 0;
+       int count = 0;
+       if (account_id <= 0)
+               return -1;
+
+       do {
+               if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
+               if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
+
+               if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &(ids[0])))) break;
+               if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &(ids[1])))) break;
+               ids_count = 2;
+
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_get_count_for_search_records(_contacts_person._uri, "010", &count))) break;
+               if (count < 1) {
+                       ret = -1;
+                       break;
+               }
+
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
+
+               return 0;
+       } while (0);
+
+       contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
+       contacts_db_delete_record(_contacts_group._uri, group_id);
+       contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
+
+       return ret;
+}
+
+static int _ctsvc_tc_db_get_count_for_search_records_with_query_person(int account_id)
+{
+       int ret = 0;
+       int ids[2]= {0};
+       int ids_count = 0;
+       int address_book_id = 0;
+       int group_id = 0;
+       contacts_query_h query = NULL;
+       contacts_filter_h filter = NULL;
+       int count = 0;
+       if (account_id <= 0)
+               return -1;
+
+       do {
+               if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
+               if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
+
+               if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &(ids[0])))) break;
+               if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &(ids[1])))) break;
+               ids_count = 2;
+
+               if (CONTACTS_ERROR_NONE != (ret = contacts_query_create(_contacts_person._uri, &query))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_filter_create(_contacts_person._uri, &filter))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_filter_add_int(filter, _contacts_person.id, CONTACTS_MATCH_EQUAL, ids[1]))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_query_set_filter(query, filter))) break;
+
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_get_count_for_search_records_with_query(query, "010", &count))) break;
+               if (count < 1) {
+                       ret = -1;
+                       break;
+               }
+
+               contacts_filter_destroy(filter);
+               filter = NULL;
+               contacts_query_destroy(query);
+               query = NULL;
+
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
+
+               return 0;
+       } while (0);
+
+       contacts_filter_destroy(filter);
+       contacts_query_destroy(query);
+       contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
+       contacts_db_delete_record(_contacts_group._uri, group_id);
+       contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
+
+       return ret;
+}
+
+static int _ctsvc_tc_db_get_count_for_search_records_with_range_person(int account_id)
+{
+       int ret = 0;
+       int ids[2]= {0};
+       int ids_count = 0;
+       int address_book_id = 0;
+       int group_id = 0;
+       int count = 0;
+       if (account_id <= 0)
+               return -1;
+
+       do {
+               if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
+               if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
+
+               if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &(ids[0])))) break;
+               if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &(ids[1])))) break;
+               ids_count = 2;
+
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_get_count_for_search_records_with_range(_contacts_person._uri, "010", CONTACTS_SEARCH_RANGE_NAME | CONTACTS_SEARCH_RANGE_NUMBER, &count))) break;
+               if (count < 1) {
+                       ret = -1;
+                       break;
+               }
+
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
+               if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
+
+               return 0;
+       } while (0);
+
+       contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
+       contacts_db_delete_record(_contacts_group._uri, group_id);
+       contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
+
+       return ret;
+}
+
index 597b4f54ad8084234c414c79876c1dca6e10101f..feb162ca6760def0dbba42b8b5a600ee8bf0f3b1 100755 (executable)
@@ -52,6 +52,9 @@ ctsvc_tc_db_plugin_s _tc_db_phone_log_stat = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_get_records_with_query_phone_log_stat(int account_id)
index 899a96a541e78dfb74a6e1b0a0c52ec58ade0338..cebe51b17fdecfe2c56e17ef15c5e888c725d47b 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_phone_log = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_phone_log(void)
index dc642a092bcdb1583baee38ffb2e685c383211b9..1b53f5920db41e13b3bed3f8fc18f4a35623cc8b 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_profile = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_profile(void)
index f6b9294875b3bf0f4688d2574d355f589147592c..22eb61d7002ef557833f465a41d262ef7b9fa0e4 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_relationship = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_relationship(void)
index eaf0a8ed120e01d968777688d8c40ddd43ee5066..8febb12c30b03db0fa0c18c0721ccae78639ce22 100755 (executable)
@@ -50,6 +50,9 @@ ctsvc_tc_db_plugin_s _tc_db_sdn = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_sdn(void)
index 0a2c27f51b998a1a278aad50726d21cac70b0dd5..1485f4afe688953f4a291c4ad3a993918aa2f473 100755 (executable)
@@ -53,6 +53,9 @@ ctsvc_tc_db_plugin_s _tc_db_simple_contact = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_simple_contact(void)
index 0f071da3fee94a51b685c532feaf8ede6e9fd2b5..bde721a66543534a14cb2019cdd99af4cf459e94 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_sip = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_sip(void)
index 1ff741833141d60a49a56261488adf125b87ae34..8644bf2c1c418dbd21fe987d2fe341d1e0fb962c 100755 (executable)
@@ -63,6 +63,9 @@ ctsvc_tc_db_plugin_s _tc_db_speeddial = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_speeddial(void)
index 470809c2873655497363161c68e32b43d58a1673..a6cd965718fca1382cb560bb96e42bca7ecbc571 100755 (executable)
@@ -62,6 +62,9 @@ ctsvc_tc_db_plugin_s _tc_db_url = {
        .db_search_records_for_snippet = NULL,
        .db_search_records_with_query_for_snippet = NULL,
        .db_search_records_with_range_for_snippet = NULL,
+       .db_get_count_for_search_records = NULL,
+       .db_get_count_for_search_records_with_query = NULL,
+       .db_get_count_for_search_records_with_range = NULL,
 };
 
 static int _ctsvc_tc_db_add_changed_cb_url(void)
index 7fc81968d6b15fb71ef9d1f55af2a49009fba3f5..07db04600a12a76f2db46bbf9bc24ec3072932d5 100755 (executable)
@@ -41,6 +41,9 @@
 #define API_NAME_CONTACTS_DB_SEARCH_RECORDS "contacts_db_search_records"
 #define API_NAME_CONTACTS_DB_SEARCH_RECORDS_WITH_QUERY "contacts_db_search_records_with_query"
 #define API_NAME_CONTACTS_DB_SEARCH_RECORDS_WITH_RANGE "contacts_db_search_records_with_range"
+#define API_NAME_CONTACTS_DB_GET_COUNT_FOR_SEARCH_RECORDS "contacts_db_get_count_for_search_records"
+#define API_NAME_CONTACTS_DB_GET_COUNT_FOR_SEARCH_RECORDS_WITH_QUERY "contacts_db_get_count_for_search_records_with_query"
+#define API_NAME_CONTACTS_DB_GET_COUNT_FOR_SEARCH_RECORDS_WITH_RANGE "contacts_db_get_count_for_search_records_with_range"
 #define API_NAME_CONTACTS_DB_ADD_CHANGED_CB "contacts_db_add_changed_cb"
 #define API_NAME_CONTACTS_DB_REMOVE_CHANGED_CB "contacts_db_remove_changed_cb"
 
@@ -1354,6 +1357,210 @@ int utc_contacts_service2_db_search_records_with_range_n(void)
 }
 
 
+/**
+ * @testcase           utc_contacts_service2_db_get_count_for_search_records_p
+ * @since_tizen                2.3
+ * @description                Test finding records based on a given keyword.
+ */
+int utc_contacts_service2_db_get_count_for_search_records_p(void)
+{
+       assert_eq(_startup_err, 0);
+
+       int i;
+       int ret;
+       int account_id =0;
+
+       if (false == ctsvc_tc_util_is_contact_support()) {
+               int count = 0;
+               ret = contacts_db_get_count_for_search_records(NULL, "", &count);
+               assert_eq(ret, CONTACTS_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
+       ret = ctsvc_tc_util_account_insert(&account_id);
+       assert_eq(0, ret);
+       for (i=0;i<VIEW_MAX;i++) {
+               ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
+               if (tc_db_plugin && tc_db_plugin->db_get_count_for_search_records) {
+                       ret = tc_db_plugin->db_get_count_for_search_records(account_id);
+                       assert_eq(0, ret);
+               }
+       }
+       assert_eq(0, ret);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_contacts_service2_db_get_count_for_search_records_n
+ * @since_tizen                2.3
+ * @description                Test fail finding records with invalid parameters.
+ */
+int utc_contacts_service2_db_get_count_for_search_records_n(void)
+{
+       assert_eq(_startup_err, 0);
+
+       int i;
+       int ret;
+       int count = 0;
+
+       ret = contacts_db_get_count_for_search_records(NULL, "", &count);
+       if (false == ctsvc_tc_util_is_contact_support()) {
+               assert_eq(CONTACTS_ERROR_NOT_SUPPORTED, ret);
+               return 0;
+       } else {
+               assert_eq(CONTACTS_ERROR_INVALID_PARAMETER, ret);
+       }
+
+       for (i=0;i<VIEW_MAX;i++) {
+               ret = contacts_db_get_count_for_search_records(ctsvc_tc_util_get_view_uri(i), "", NULL);
+               assert_eq(CONTACTS_ERROR_INVALID_PARAMETER, ret);
+       }
+
+       return 0;
+}
+
+
+/**
+ * @testcase           utc_contacts_service2_db_get_count_for_search_records_with_query_p
+ * @since_tizen                2.3
+ * @description                Test finding records based on given query and keyword.
+ */
+int utc_contacts_service2_db_get_count_for_search_records_with_query_p(void)
+{
+       assert_eq(_startup_err, 0);
+
+       int i;
+       int ret;
+       int account_id =0;
+
+       if (false == ctsvc_tc_util_is_contact_support()) {
+               int count = 0;
+               ret = contacts_db_get_count_for_search_records_with_query(NULL, "", &count);
+               assert_eq(ret, CONTACTS_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
+       ret = ctsvc_tc_util_account_insert(&account_id);
+       assert_eq(0, ret);
+       for (i=0;i<VIEW_MAX;i++) {
+               ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
+               if (tc_db_plugin && tc_db_plugin->db_get_count_for_search_records_with_query) {
+                       ret = tc_db_plugin->db_get_count_for_search_records_with_query(account_id);
+                       assert_eq(0, ret);
+               }
+       }
+       assert_eq(0, ret);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_contacts_service2_db_get_count_for_search_records_with_query_n
+ * @since_tizen                2.3
+ * @description                Test fail finding records based on given query and keyword with invalid parameters.
+ */
+int utc_contacts_service2_db_get_count_for_search_records_with_query_n(void)
+{
+       assert_eq(_startup_err, 0);
+
+       int i;
+       int ret;
+       int count = 0;
+       contacts_query_h query = NULL;
+
+       ret = contacts_db_get_count_for_search_records_with_query(NULL, "", &count);
+       if (false == ctsvc_tc_util_is_contact_support()) {
+               assert_eq(CONTACTS_ERROR_NOT_SUPPORTED, ret);
+               return 0;
+       } else {
+               assert_eq(CONTACTS_ERROR_INVALID_PARAMETER, ret);
+       }
+
+       for (i=0;i<VIEW_MAX;i++) {
+               ret = contacts_query_create(ctsvc_tc_util_get_view_uri(i), &query);
+               assert_eq(CONTACTS_ERROR_NONE, ret);
+
+               ret = contacts_db_get_count_for_search_records_with_query(query, "", NULL);
+               assert_eq(CONTACTS_ERROR_INVALID_PARAMETER, ret);
+
+               ret = contacts_query_destroy(query);
+               assert_eq(CONTACTS_ERROR_NONE, ret);
+       }
+
+       return 0;
+}
+
+
+
+
+/**
+ * @testcase           utc_contacts_service2_db_get_count_for_search_records_with_range_p
+ * @since_tizen                2.3
+ * @description                Test finding records based on a keyword and range.
+ */
+int utc_contacts_service2_db_get_count_for_search_records_with_range_p(void)
+{
+       assert_eq(_startup_err, 0);
+
+       int i;
+       int ret;
+       int account_id =0;
+
+       if (false == ctsvc_tc_util_is_contact_support()) {
+               int count = 0;
+               ret = contacts_db_get_count_for_search_records_with_range(NULL, "", CONTACTS_SEARCH_RANGE_DATA, &count);
+               assert_eq(ret, CONTACTS_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
+       ret = ctsvc_tc_util_account_insert(&account_id);
+       assert_eq(0, ret);
+       for (i=0;i<VIEW_MAX;i++) {
+               ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
+               if (tc_db_plugin && tc_db_plugin->db_get_count_for_search_records_with_range) {
+                       ret = tc_db_plugin->db_get_count_for_search_records_with_range(account_id);
+                       assert_eq(0, ret);
+               }
+       }
+       assert_eq(0, ret);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_contacts_service2_db_get_count_for_search_records_with_range_n
+ * @since_tizen                2.3
+ * @description                Test fail finding records based on a keyword and range with invalid parameters.
+ */
+int utc_contacts_service2_db_get_count_for_search_records_with_range_n(void)
+{
+       assert_eq(_startup_err, 0);
+
+       int i;
+       int ret;
+       int count = 0;
+
+       ret = contacts_db_get_count_for_search_records_with_range(NULL, "", CONTACTS_SEARCH_RANGE_DATA, &count);
+       if (false == ctsvc_tc_util_is_contact_support()) {
+               assert_eq(CONTACTS_ERROR_NOT_SUPPORTED, ret);
+               return 0;
+       } else {
+               assert_eq(CONTACTS_ERROR_INVALID_PARAMETER, ret);
+       }
+
+       for (i=0;i<VIEW_MAX;i++) {
+               ret = contacts_db_get_count_for_search_records_with_range(ctsvc_tc_util_get_view_uri(i), "", 0, &count);
+               assert_eq(CONTACTS_ERROR_INVALID_PARAMETER, ret);
+               ret = contacts_db_get_count_for_search_records_with_range(ctsvc_tc_util_get_view_uri(i), "", CONTACTS_SEARCH_RANGE_DATA, NULL);
+               assert_eq(CONTACTS_ERROR_INVALID_PARAMETER, ret);
+       }
+
+       return 0;
+}
+
+
+
 /**
  * @testcase           utc_contacts_service2_db_search_records_for_snippet_p
  * @since_tizen                3.0
index 98f5feb8ec9c677fef2e62ef3d20b5a4ac92a4e7..998c2f86c25c582a4b76908eeba1987140954f44 100755 (executable)
@@ -132,6 +132,9 @@ typedef struct {
        tc_with_account_id db_search_records_for_snippet;
        tc_with_account_id db_search_records_with_query_for_snippet;
        tc_with_account_id db_search_records_with_range_for_snippet;
+       tc_with_account_id db_get_count_for_search_records;
+       tc_with_account_id db_get_count_for_search_records_with_query;
+       tc_with_account_id db_get_count_for_search_records_with_range;
 } ctsvc_tc_db_plugin_s;
 
 typedef enum {