[evolution-data-server] Extending test-client-custom-summary.c
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Extending test-client-custom-summary.c
- Date: Wed, 20 Feb 2013 11:46:29 +0000 (UTC)
commit 34e87fc7e70b7611402a401f50c5e9c534b4d850
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Wed Feb 20 20:45:24 2013 +0900
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.
tests/libebook/client/test-client-custom-summary.c | 13 +++++++++++--
tests/libebook/data/vcards/custom-7.vcf | 4 ++++
2 files changed, 15 insertions(+), 2 deletions(-)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]