summaryrefslogtreecommitdiff
path: root/sci-geosciences/geocode-glib/files/3.26.3-tests-Fix-locale-in-pi-test.patch
blob: 5df7814383c09f831f07b5cf2a70e9af5e69941c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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