From: Tristan Van Berkom Date: Wed, 20 Feb 2013 11:45:24 +0000 (+0900) Subject: Extending test-client-custom-summary.c X-Git-Tag: upstream/3.7.91~124 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34e87fc7e70b7611402a401f50c5e9c534b4d850;p=platform%2Fupstream%2Fevolution-data-server.git Extending test-client-custom-summary.c Added test to ensure that phone numbers are not accidentally normalized, and that we dont get a result for ENDS_WITH "8899" if a phone number ending with "88 99" exists in the addressbook. --- diff --git a/tests/libebook/client/test-client-custom-summary.c b/tests/libebook/client/test-client-custom-summary.c index 4b24fb3..d7ff03f 100644 --- a/tests/libebook/client/test-client-custom-summary.c +++ b/tests/libebook/client/test-client-custom-summary.c @@ -36,7 +36,7 @@ typedef struct { typedef struct { ETestServerFixture parent; - EContact *contacts[6]; + EContact *contacts[7]; } ClientTestFixture; static void @@ -138,7 +138,8 @@ setup_book (ClientTestFixture *fixture) !add_contact_from_test_case_verify (book_client, "custom-3", it++) || !add_contact_from_test_case_verify (book_client, "custom-4", it++) || !add_contact_from_test_case_verify (book_client, "custom-5", it++) || - !add_contact_from_test_case_verify (book_client, "custom-6", it++)) { + !add_contact_from_test_case_verify (book_client, "custom-6", it++) || + !add_contact_from_test_case_verify (book_client, "custom-7", it++)) { g_error ("Failed to add contacts"); } @@ -282,6 +283,14 @@ main (gint argc, e_book_query_field_test (E_CONTACT_TEL, E_BOOK_QUERY_ENDS_WITH, "999"), 2, suites[i].direct); + /* This test proves that we do not get any results for custom-7.vcf, which contains + * a phone number ending with "88 99", if this were accidentally normalized, we would + * get a result for it. + */ + add_client_test (suites[i].prefix, "/Suffix/Phone/NotNormalized", suites[i].func, + e_book_query_field_test (E_CONTACT_TEL, E_BOOK_QUERY_ENDS_WITH, "8899"), + 0, suites[i].direct); + add_client_test (suites[i].prefix, "/Suffix/Email", suites[i].func, e_book_query_field_test (E_CONTACT_EMAIL, E_BOOK_QUERY_ENDS_WITH, "jackson.com"), 2, suites[i].direct); diff --git a/tests/libebook/data/vcards/custom-7.vcf b/tests/libebook/data/vcards/custom-7.vcf new file mode 100644 index 0000000..f691637 --- /dev/null +++ b/tests/libebook/data/vcards/custom-7.vcf @@ -0,0 +1,4 @@ +BEGIN:VCARD +FN:Purple Goose +TEL;HOME:+49-89-7888 99 +END:VCARD