[evolution-data-server/openismus-work-3-8] Tests: Added 3 new contacts and a few more query tests.



commit 87e1d1eeb7c07847114483bdeef7ca4c42876ee6
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Fri Oct 4 00:05:36 2013 +0200

    Tests: Added 3 new contacts and a few more query tests.
    
    The new tests check some specific phone number matching cases
    with E_BOOK_QUERY_EQUALS_NATIONAL_NUMBER queries.

 tests/libebook/Makefile.am                         |    3 +
 tests/libebook/client/test-client-custom-summary.c |   41 +++++++++++++++++++-
 tests/libebook/data/vcards/custom-14.vcf           |    6 +++
 tests/libebook/data/vcards/custom-15.vcf           |    6 +++
 tests/libebook/data/vcards/custom-16.vcf           |    6 +++
 5 files changed, 61 insertions(+), 1 deletions(-)
---
diff --git a/tests/libebook/Makefile.am b/tests/libebook/Makefile.am
index 75cab7e..f6c9d6c 100644
--- a/tests/libebook/Makefile.am
+++ b/tests/libebook/Makefile.am
@@ -95,6 +95,9 @@ EXTRA_DIST = \
        $(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     \
+       $(srcdir)/data/vcards/custom-16.vcf     \
        $(NULL)
 
 test_ebook_commit_contact_LDADD=$(TEST_LIBS)
diff --git a/tests/libebook/client/test-client-custom-summary.c 
b/tests/libebook/client/test-client-custom-summary.c
index 1035482..c8f233e 100644
--- a/tests/libebook/client/test-client-custom-summary.c
+++ b/tests/libebook/client/test-client-custom-summary.c
@@ -69,7 +69,7 @@ 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 13
+#define N_CONTACTS 16
 
 typedef struct {
        ETestServerClosure parent;
@@ -534,6 +534,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-14.vcf b/tests/libebook/data/vcards/custom-14.vcf
new file mode 100644
index 0000000..5b549e1
--- /dev/null
+++ b/tests/libebook/data/vcards/custom-14.vcf
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+UID:custom-14
+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-15.vcf b/tests/libebook/data/vcards/custom-15.vcf
new file mode 100644
index 0000000..3e59b7e
--- /dev/null
+++ b/tests/libebook/data/vcards/custom-15.vcf
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+UID:custom-15
+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-16.vcf b/tests/libebook/data/vcards/custom-16.vcf
new file mode 100644
index 0000000..75efcb3
--- /dev/null
+++ b/tests/libebook/data/vcards/custom-16.vcf
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+UID:custom-16
+N:Crawley;Alister
+TEL;HOME:+49 408 765-5050
+EMAIL;TYPE=home,work:777 starry sect
+END:VCARD


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]