[evolution-data-server/openismus-phonenumber-work] client tests: Setup proper locale for testing



commit 3bc1942c0199709b9c1350d87e15ad33370b2546
Author: Mathias Hasselmann <mathias openismus com>
Date:   Tue Dec 11 13:58:18 2012 +0100

    client tests: Setup proper locale for testing
    
    This is needed now for the phone-number and country code magic.

 tests/libebook/client/client-test-utils.c          |    3 +++
 .../client/test-client-change-country-code.c       |    9 ++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/tests/libebook/client/client-test-utils.c b/tests/libebook/client/client-test-utils.c
index 57a7716..ba6fc42 100644
--- a/tests/libebook/client/client-test-utils.c
+++ b/tests/libebook/client/client-test-utils.c
@@ -22,6 +22,7 @@
  *          Tristan Van Berkom <tristanvb openismus com>
  */
 
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -104,6 +105,8 @@ main_initialize (void)
 	if (initialized)
 		return;
 
+	setlocale (LC_ALL, "en_US.UTF-8");
+
 	g_type_init ();
 	e_gdbus_templates_init_main_thread ();
 
diff --git a/tests/libebook/client/test-client-change-country-code.c b/tests/libebook/client/test-client-change-country-code.c
index 0ecc7d8..97f6b39 100644
--- a/tests/libebook/client/test-client-change-country-code.c
+++ b/tests/libebook/client/test-client-change-country-code.c
@@ -138,16 +138,15 @@ main (gint argc,
 
 	/*** Setup ****/
 
+	/* Initializing fake D-Bus and event loop machinery */
+	main_initialize ();
+	sleep_in_main_loop (500);
+
 	/* Setting with U.S. locale for addresses */
 	g_setenv ("LC_ADDRESS", "en_US.UTF-8", TRUE);
 	setlocale (LC_ADDRESS, "");
-
 	g_assert_cmpstr (nl_langinfo (_NL_ADDRESS_COUNTRY_AB2), ==, "US");
 
-	/* Initializing fake D-Bus and event loop machinery */
-	main_initialize ();
-	sleep_in_main_loop (500);
-
 	/* Launching addressbook factory on fake-dbus */
 	success = spawn_addressbook_factory (&factory_pid, &error);
 	g_assert_cmpstr (error ? error->message : NULL, ==, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]