summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2021-06-10 15:33:57 +0200
committerMilan Crha <mcrha@redhat.com>2021-06-10 15:36:30 +0200
commita216d2dc15ff9b717edf9db6276db50ec5b81e1c (patch)
tree6dc9f672ebd9b9dbc0fcbe09bece15875944166f
parentacbab8a2dd106dfbff5fa54b3eb350941df47335 (diff)
downloadevolution-data-server-a216d2dc15ff9b717edf9db6276db50ec5b81e1c.tar.gz
tests: Workaround libphonenumber behavior change
Turn off the sub-test, because different libphonenumber behaves differently. Having a (runtime) way to check the libphonenumber version it could be adapted in a better way.
-rw-r--r--tests/libedata-book/data-test-utils.c1
-rw-r--r--tests/libedata-book/test-book-cache-cursor-change-locale.c5
-rw-r--r--tests/libedata-book/test-book-cache-utils.c1
-rw-r--r--tests/libedata-book/test-sqlite-cursor-change-locale.c5
4 files changed, 8 insertions, 4 deletions
diff --git a/tests/libedata-book/data-test-utils.c b/tests/libedata-book/data-test-utils.c
index 633771b0e..9b7c84a60 100644
--- a/tests/libedata-book/data-test-utils.c
+++ b/tests/libedata-book/data-test-utils.c
@@ -645,6 +645,7 @@ test_step (EbSqlCursorFixture *fixture,
* contact changes only happen because of e164 number interpretations.
*/
if (e_phone_number_is_supported () &&
+ assertion->count != -1 &&
assertion->count != n_locale_changes)
g_error (
"Expected %d e164 numbers to change, %d actually changed.",
diff --git a/tests/libedata-book/test-book-cache-cursor-change-locale.c b/tests/libedata-book/test-book-cache-cursor-change-locale.c
index cce27a0b0..c98ecba38 100644
--- a/tests/libedata-book/test-book-cache-cursor-change-locale.c
+++ b/tests/libedata-book/test-book-cache-cursor-change-locale.c
@@ -84,7 +84,7 @@ main (gint argc,
tcu_step_test_add_assertion (data, 5, 17, 16, 18, 10, 14);
tcu_step_test_add_assertion (data, 5, 13, 12, 9, 19, 20);
- /* When changing from fr_CA to de_DE, two numbers change:
+ /* Depending on the libphonenumber, when changing from fr_CA to de_DE, two numbers change:
*
* sorted-5:
* 049-2459-4393 is now parsed with the national number as 4924594393
@@ -92,8 +92,9 @@ main (gint argc,
* sorted-4:
* 12 245999 is now parsed with national number 12245999 instead of 2245999
*
+ * or only one. Skip this check, because a lack of a way to get the libphonenumber version.
*/
- tcu_step_test_change_locale (data, "de_DE.UTF-8", 2);
+ tcu_step_test_change_locale (data, "de_DE.UTF-8", -1);
tcu_step_test_add_assertion (data, 5, 11, 1, 2, 5, 6);
tcu_step_test_add_assertion (data, 5, 7, 8, 4, 3, 15);
tcu_step_test_add_assertion (data, 5, 17, 16, 18, 10, 14);
diff --git a/tests/libedata-book/test-book-cache-utils.c b/tests/libedata-book/test-book-cache-utils.c
index 6ff294596..7be44e4dc 100644
--- a/tests/libedata-book/test-book-cache-utils.c
+++ b/tests/libedata-book/test-book-cache-utils.c
@@ -579,6 +579,7 @@ test_step (TCUCursorFixture *fixture,
* contact changes only happen because of e164 number interpretations.
*/
if (e_phone_number_is_supported () &&
+ assertion->count != -1 &&
assertion->count != n_locale_changes)
g_error ("Expected %d e164 numbers to change, %d actually changed.",
assertion->count, n_locale_changes);
diff --git a/tests/libedata-book/test-sqlite-cursor-change-locale.c b/tests/libedata-book/test-sqlite-cursor-change-locale.c
index 859857a39..65671d1df 100644
--- a/tests/libedata-book/test-sqlite-cursor-change-locale.c
+++ b/tests/libedata-book/test-sqlite-cursor-change-locale.c
@@ -87,7 +87,7 @@ main (gint argc,
step_test_add_assertion (data, 5, 17, 16, 18, 10, 14);
step_test_add_assertion (data, 5, 13, 12, 9, 19, 20);
- /* When changing from fr_CA to de_DE, two numbers change:
+ /* Depending on the libphonenumber, when changing from fr_CA to de_DE, two numbers change:
*
* sorted-5:
* 049-2459-4393 is now parsed with the national number as 4924594393
@@ -95,8 +95,9 @@ main (gint argc,
* sorted-4:
* 12 245999 is now parsed with national number 12245999 instead of 2245999
*
+ * or only one. Skip this check, because a lack of a way to get the libphonenumber version.
*/
- step_test_change_locale (data, "de_DE.UTF-8", 2);
+ step_test_change_locale (data, "de_DE.UTF-8", -1);
step_test_add_assertion (data, 5, 11, 1, 2, 5, 6);
step_test_add_assertion (data, 5, 7, 8, 4, 3, 15);
step_test_add_assertion (data, 5, 17, 16, 18, 10, 14);