[gnome-desktop/jbicha/gnome-desktop-tests-unset-env: 3/3] tests: Further improve uselocale useage
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/jbicha/gnome-desktop-tests-unset-env: 3/3] tests: Further improve uselocale useage
- Date: Thu, 21 Feb 2019 00:27:21 +0000 (UTC)
commit f1767323406aa5ee324336be2331cd8b9c639533
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Feb 20 18:25:45 2019 -0600
tests: Further improve uselocale useage
tests/wallclock-reftest.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/tests/wallclock-reftest.c b/tests/wallclock-reftest.c
index 42783869..8ac630f2 100644
--- a/tests/wallclock-reftest.c
+++ b/tests/wallclock-reftest.c
@@ -439,18 +439,17 @@ test_ui_file (GFile *file,
GnomeWallClock *clock;
GDateTime *datetime;
char *str;
- locale_t loc, set_locale;
+ locale_t loc, previous_locale;
ui_file = g_file_get_path (file);
locale = get_locale_for_file (ui_file);
g_assert (locale);
loc = newlocale (LC_ALL_MASK, locale, (locale_t) 0);
- set_locale = uselocale (loc);
- /*TODO: CI fails when I tried to use freelocale (loc); later */
- g_assert_true (set_locale != (locale_t) 0);
+ previous_locale = uselocale (loc);
+ g_assert_true (previous_locale != (locale_t) 0);
- clock = gnome_wall_clock_new();
+ clock = gnome_wall_clock_new ();
datetime = g_date_time_new_local (2014, 5, 28, 23, 59, 59);
str = gnome_wall_clock_string_for_datetime (clock,
datetime,
@@ -460,6 +459,9 @@ test_ui_file (GFile *file,
g_date_time_unref (datetime);
g_object_unref (clock);
+ uselocale (previous_locale);
+ freelocale (loc);
+
provider = add_extra_css (ui_file, ".css");
ui_image = snapshot_ui_file (ui_file, str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]