[evolution-data-server/openismus-work-master: 81/150] Tests: Added 3 new contacts and a few more query tests.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work-master: 81/150] Tests: Added 3 new contacts and a few more query tests.
- Date: Thu, 24 Oct 2013 15:37:16 +0000 (UTC)
commit 1dbd5cb257b9ad5988ce204fdcbbae973f499c19
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 | 4 ++
tests/libebook/client/test-client-custom-summary.c | 42 +++++++++++++++++++-
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, 63 insertions(+), 1 deletions(-)
---
diff --git a/tests/libebook/Makefile.am b/tests/libebook/Makefile.am
index d3b47b6..f6c9d6c 100644
--- a/tests/libebook/Makefile.am
+++ b/tests/libebook/Makefile.am
@@ -94,6 +94,10 @@ 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 \
+ $(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 12f1e7c..1e268e5 100644
--- a/tests/libebook/client/test-client-custom-summary.c
+++ b/tests/libebook/client/test-client-custom-summary.c
@@ -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 16
+
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-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]