[evolution-data-server/cursor-staging: 4/19] 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/cursor-staging: 4/19] Tests: Added 3 new contacts and a few more query tests.
- Date: Sat, 19 Oct 2013 18:56:22 +0000 (UTC)
commit 809e88ddd82db214f527ac518fd9e8796cf4c494
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 | 42 +++++++++++++++++++-
tests/libebook/data/vcards/custom-13.vcf | 6 +++
tests/libebook/data/vcards/custom-14.vcf | 6 +++
tests/libebook/data/vcards/custom-15.vcf | 6 +++
5 files changed, 62 insertions(+), 1 deletions(-)
---
diff --git a/tests/libebook/Makefile.am b/tests/libebook/Makefile.am
index 8ccebc0..1e0ba45 100644
--- a/tests/libebook/Makefile.am
+++ b/tests/libebook/Makefile.am
@@ -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)
diff --git a/tests/libebook/client/test-client-custom-summary.c
b/tests/libebook/client/test-client-custom-summary.c
index 12f1e7c..889a6dd 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 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
index 0000000..878def9
--- /dev/null
+++ b/tests/libebook/data/vcards/custom-13.vcf
@@ -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
index 0000000..d064757
--- /dev/null
+++ b/tests/libebook/data/vcards/custom-14.vcf
@@ -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
index 0000000..4e72cf3
--- /dev/null
+++ b/tests/libebook/data/vcards/custom-15.vcf
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]