diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-07-02 10:11:10 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-07-02 17:01:48 +0200 |
commit | c9bbf13d76600492565fa042638b48cb737e492d (patch) | |
tree | 69999b82af52c85df6cbdafbfbfb3d161cf27c67 | |
parent | 0eb5c21cf4deb2c45aedf5a4393d4208b8dc6d58 (diff) | |
download | geocode-glib-c9bbf13d76600492565fa042638b48cb737e492d.tar.gz |
tests: Fix locale in "pi" test
The test expects the locale to be en_GB.UTF-8, so set it as such.
Closes: #27
-rw-r--r-- | geocode-glib/tests/geocode-glib.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/geocode-glib/tests/geocode-glib.c b/geocode-glib/tests/geocode-glib.c index f74d031..ef20716 100644 --- a/geocode-glib/tests/geocode-glib.c +++ b/geocode-glib/tests/geocode-glib.c @@ -410,10 +410,14 @@ test_pi (void) { g_autoptr (GHashTable) params = NULL; GeocodeForward *object; + g_autofree char *old_locale = NULL; GError *error = NULL; GList *res; GeocodePlace *place; + old_locale = g_strdup (setlocale(LC_ALL, NULL)); + setlocale (LC_ALL, "en_GB.UTF-8"); + /* The query parameters the mock server expects to receive. */ params = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); add_attr_string (params, "q", "Jack Cole Building, St Andrews"); @@ -439,6 +443,8 @@ test_pi (void) g_assert_cmpstr (geocode_place_get_street_address (place), ==, "North Haugh π"); g_object_unref (place); g_list_free (res); + + setlocale (LC_ALL, old_locale); } static void |