Tests: Added 3 new contacts and a few more query tests.
authorTristan Van Berkom <tristanvb@openismus.com>
Thu, 3 Oct 2013 22:05:36 +0000 (00:05 +0200)
committerTristan Van Berkom <tristanvb@openismus.com>
Wed, 23 Oct 2013 18:39:38 +0000 (20:39 +0200)
The new tests check some specific phone number matching cases
with E_BOOK_QUERY_EQUALS_NATIONAL_NUMBER queries.

tests/libebook/Makefile.am
tests/libebook/client/test-client-custom-summary.c
tests/libebook/data/vcards/custom-13.vcf [new file with mode: 0644]
tests/libebook/data/vcards/custom-14.vcf [new file with mode: 0644]
tests/libebook/data/vcards/custom-15.vcf [new file with mode: 0644]

index 8ccebc0..1e0ba45 100644 (file)
@@ -74,6 +74,9 @@ EXTRA_DIST = \
        $(srcdir)/data/vcards/custom-10.vcf     \
        $(srcdir)/data/vcards/custom-11.vcf     \
        $(srcdir)/data/vcards/custom-12.vcf     \
+       $(srcdir)/data/vcards/custom-13.vcf     \
+       $(srcdir)/data/vcards/custom-14.vcf     \
+       $(srcdir)/data/vcards/custom-15.vcf     \
        $(NULL)
 
 test_ebook_commit_contact_LDADD=$(TEST_LIBS)
index 12f1e7c..889a6dd 100644 (file)
@@ -69,7 +69,8 @@ static ETestServerClosure setup_default_closure = { E_TEST_SERVER_ADDRESS_BOOK,
 #  define CHECK_UNSUPPORTED_ERROR(data) (((ClientTestData *)(data))->phone_number_query != FALSE)
 #endif
 
-#define N_CONTACTS 12
+#define N_CONTACTS 15
+
 
 typedef struct {
        ETestServerClosure parent;
@@ -535,6 +536,45 @@ main (gint argc,
                 * E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER *
                 *********************************************/
 
+               add_client_test (
+                       suites[i].prefix,
+                       "/EqPhone/National/WithoutCountry",
+                       suites[i].func,
+                       e_book_query_field_test (
+                               E_CONTACT_TEL,
+                               E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER,
+                               "408 765-5050"),
+                       2,
+                       suites[i].direct,
+                       suites[i].custom,
+                       TRUE);
+
+               add_client_test (
+                       suites[i].prefix,
+                       "/EqPhone/National/en_US",
+                       suites[i].func,
+                       e_book_query_field_test (
+                               E_CONTACT_TEL,
+                               E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER,
+                               "+1 408 765-5050"),
+                       2,
+                       suites[i].direct,
+                       suites[i].custom,
+                       TRUE);
+
+               add_client_test (
+                       suites[i].prefix,
+                       "/EqPhone/National/de_DE",
+                       suites[i].func,
+                       e_book_query_field_test (
+                               E_CONTACT_TEL,
+                               E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER,
+                               "+49 408 765-5050"),
+                       1,
+                       suites[i].direct,
+                       suites[i].custom,
+                       TRUE);
+
                /* Test that a query term with no specified country returns
                 * all vCards that have the same national number regardless
                 * of country codes.
diff --git a/tests/libebook/data/vcards/custom-13.vcf b/tests/libebook/data/vcards/custom-13.vcf
new file mode 100644 (file)
index 0000000..878def9
--- /dev/null
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+UID:custom-13
+N:Murphey;Eddie
+TEL;HOME:408 765-5050
+EMAIL;TYPE=home,work:eddie@murphey.usa
+END:VCARD
diff --git a/tests/libebook/data/vcards/custom-14.vcf b/tests/libebook/data/vcards/custom-14.vcf
new file mode 100644 (file)
index 0000000..d064757
--- /dev/null
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+UID:custom-14
+N:Turner;Tina
+TEL;HOME:+1 408 765-5050
+EMAIL;TYPE=home,work:tina@turner.net
+END:VCARD
diff --git a/tests/libebook/data/vcards/custom-15.vcf b/tests/libebook/data/vcards/custom-15.vcf
new file mode 100644 (file)
index 0000000..4e72cf3
--- /dev/null
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+UID:custom-15
+N:Crawley;Alister
+TEL;HOME:+49 408 765-5050
+EMAIL;TYPE=home,work:777@starry.sect
+END:VCARD