summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-06-13 16:53:45 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2019-06-14 13:32:33 +0800
commit73db86530d1c976196f5434f61a2ff12337e922a (patch)
treef8da2cfacab9c7f2eff736d8a7a352fe5bfb80b1
parent236a4837246e2d66d8387e1f99f133b25fb64bd0 (diff)
downloadglib-win32-enhance-gtimezone-2-60.tar.gz
glib/tests/gdatetime.c: Fix TZ envvar test on Windowswin32-enhance-gtimezone-2-60
Windows does not recognize the "America/Recife" as a valid timezone identifier, so setting the TZ envvar to that will result "UTC" to be returned on Windows. Instead, set TZ to be the Windows equivilant "SA Eastern Standard Time", and see whether that is indeed our identifier when we create the GTimeZone using that.
-rw-r--r--glib/tests/gdatetime.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index 4e6559ad8..c805a8edf 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -2441,12 +2441,21 @@ test_identifier (void)
g_time_zone_unref (tz);
/* Local timezone tests. */
+#ifdef G_OS_WIN32
+ if (g_setenv ("TZ", "SA Eastern Standard Time", TRUE))
+ {
+ tz = g_time_zone_new_local ();
+ g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "SA Eastern Standard Time");
+ g_time_zone_unref (tz);
+ }
+#else
if (g_setenv ("TZ", "America/Recife", TRUE))
{
tz = g_time_zone_new_local ();
g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "America/Recife");
g_time_zone_unref (tz);
}
+#endif
if (g_setenv ("TZ", "some rubbish", TRUE))
{