summaryrefslogtreecommitdiff
path: root/tests/libebook/client
diff options
context:
space:
mode:
authorMathias Hasselmann <mathias@openismus.com>2013-03-01 14:05:28 +0100
committerMathias Hasselmann <mathias@openismus.com>2013-03-06 12:10:34 +0100
commita3526c06166073e3c96a4bfef6a294b5cc71f78b (patch)
tree475397f199ce1d83d92b30386c9dbe90b50c3c72 /tests/libebook/client
parent8ed8d658dd727533e6ce92797f4171b393c4f2ee (diff)
downloadevolution-data-server-a3526c06166073e3c96a4bfef6a294b5cc71f78b.tar.gz
sqlitedb: Improve national phone number matching
The sqlitedb backend and e_phone_number_compare() showed different behavior for a few cases of national and short number matching. This syncs the behavior.
Diffstat (limited to 'tests/libebook/client')
-rw-r--r--tests/libebook/client/test-client-custom-summary.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/libebook/client/test-client-custom-summary.c b/tests/libebook/client/test-client-custom-summary.c
index 88d254019..cadb398d2 100644
--- a/tests/libebook/client/test-client-custom-summary.c
+++ b/tests/libebook/client/test-client-custom-summary.c
@@ -338,7 +338,11 @@ main (gint argc,
#endif
g_test_init (&argc, &argv, NULL);
- setlocale (LC_ALL, "en_US.UTF-8");
+ /* Change environment so that the addressbook factory inherits this setting */
+ g_setenv ("LC_ALL", "en_US.UTF-8", TRUE);
+ setlocale (LC_ALL, "");
+
+ g_assert_cmpstr (setlocale (LC_ADDRESS, NULL), ==, "en_US.UTF-8");
/* Test all queries in 8 different combinations specified by the 'suites'
*/
@@ -417,7 +421,7 @@ main (gint argc,
* matching with EBookBackendSexp when the default summary is used
*/
add_client_test (
- suites[i].prefix, "/EqPhone/Exact", suites[i].func,
+ suites[i].prefix, "/EqPhone/Exact/Common", suites[i].func,
e_book_query_field_test (E_CONTACT_TEL, E_BOOK_QUERY_EQUALS_PHONE_NUMBER, "+1 221.542.3789"),
1, suites[i].direct, suites[i].custom, TRUE);
@@ -446,12 +450,12 @@ main (gint argc,
* have the same national number regardless of country codes.
*
* | Active Country Code: +1 | Query: 221.542.3789 | vCard Data: +1-221-5423789 | Matches: yes |
- * | Active Country Code: +1 | Query: 221.542.3789 | vCard Data: +31-221-5423789 | Matches: yes |
+ * | Active Country Code: +1 | Query: 221.542.3789 | vCard Data: +31-221-5423789 | Matches: no |
*/
add_client_test (
- suites[i].prefix, "/EqPhone/National", suites[i].func,
+ suites[i].prefix, "/EqPhone/National/Common", suites[i].func,
e_book_query_field_test (E_CONTACT_TEL, E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER, "221.542.3789"),
- 2, suites[i].direct, suites[i].custom, TRUE);
+ 1, suites[i].direct, suites[i].custom, TRUE);
/* Test that a query term with a specified country returns only vCards that
* are specifically in the specified country code.
@@ -483,14 +487,13 @@ main (gint argc,
*/
add_client_test (
suites[i].prefix, "/EqPhone/National/CountryAbsent/QueryOtherCountry", suites[i].func,
- e_book_query_field_test (E_CONTACT_TEL,
- E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER, "+49 514-845-8436"),
- 1, suites[i].direct, suites[i].custom, TRUE);
+ e_book_query_field_test (E_CONTACT_TEL, E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER, "+49 514-845-8436"),
+ 0, suites[i].direct, suites[i].custom, TRUE);
add_client_test (
suites[i].prefix, "/EqPhone/Short", suites[i].func,
e_book_query_field_test (E_CONTACT_TEL, E_BOOK_QUERY_EQUALS_SHORT_PHONE_NUMBER, "5423789"),
- 2, suites[i].direct, suites[i].custom, TRUE);
+ 1, suites[i].direct, suites[i].custom, TRUE);
}