summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-geosciences/geocode-glib/files/3.26.3-tests-Fix-locale-in-pi-test.patch')
-rw-r--r--sci-geosciences/geocode-glib/files/3.26.3-tests-Fix-locale-in-pi-test.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/sci-geosciences/geocode-glib/files/3.26.3-tests-Fix-locale-in-pi-test.patch b/sci-geosciences/geocode-glib/files/3.26.3-tests-Fix-locale-in-pi-test.patch
new file mode 100644
index 000000000000..5df7814383c0
--- /dev/null
+++ b/sci-geosciences/geocode-glib/files/3.26.3-tests-Fix-locale-in-pi-test.patch
@@ -0,0 +1,43 @@
+From c9bbf13d76600492565fa042638b48cb737e492d Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Sat, 2 Jul 2022 10:11:10 +0200
+Subject: [PATCH] tests: Fix locale in "pi" test
+
+The test expects the locale to be en_GB.UTF-8, so set it as such.
+
+Closes: #27
+---
+ geocode-glib/tests/geocode-glib.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+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
+--
+2.35.1
+