Make timeval tests independent of the environment

Some of the tested formats are locale-dependent, so unset
the TZ environment variable before testing them.
This commit is contained in:
Matthias Clasen 2014-01-01 21:39:51 -05:00
parent cda4080af0
commit 6106e38c8e

View File

@ -152,6 +152,8 @@ test_timeval_from_iso8601 (void)
gboolean success; gboolean success;
gint i; gint i;
g_unsetenv ("TZ");
for (i = 0; i < G_N_ELEMENTS (tests); i++) for (i = 0; i < G_N_ELEMENTS (tests); i++)
{ {
out.tv_sec = 0; out.tv_sec = 0;
@ -183,6 +185,8 @@ test_timeval_to_iso8601 (void)
GTimeVal val; GTimeVal val;
gboolean ret; gboolean ret;
g_unsetenv ("TZ");
for (i = 0; i < G_N_ELEMENTS (tests); i++) for (i = 0; i < G_N_ELEMENTS (tests); i++)
{ {
out = g_time_val_to_iso8601 (&(tests[i].val)); out = g_time_val_to_iso8601 (&(tests[i].val));