mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
Merge branch '1433-rename-timezones-in-tests' into 'master'
tests: Don’t use a potentially-existent timezone in a test for failure Closes #1433 See merge request GNOME/glib!213
This commit is contained in:
commit
291bb0c584
@ -2131,13 +2131,15 @@ test_posix_parse (void)
|
|||||||
GTimeZone *tz;
|
GTimeZone *tz;
|
||||||
GDateTime *gdt1, *gdt2;
|
GDateTime *gdt1, *gdt2;
|
||||||
|
|
||||||
tz = g_time_zone_new ("PST");
|
/* Check that an unknown zone name falls back to UTC. */
|
||||||
|
tz = g_time_zone_new ("nonexistent");
|
||||||
g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "UTC");
|
g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "UTC");
|
||||||
g_assert_cmpstr (g_time_zone_get_abbreviation (tz, 0), ==, "UTC");
|
g_assert_cmpstr (g_time_zone_get_abbreviation (tz, 0), ==, "UTC");
|
||||||
g_assert_cmpint (g_time_zone_get_offset (tz, 0), ==, 0);
|
g_assert_cmpint (g_time_zone_get_offset (tz, 0), ==, 0);
|
||||||
g_assert (!g_time_zone_is_dst (tz, 0));
|
g_assert (!g_time_zone_is_dst (tz, 0));
|
||||||
g_time_zone_unref (tz);
|
g_time_zone_unref (tz);
|
||||||
|
|
||||||
|
/* An existent zone name should not fall back to UTC. */
|
||||||
tz = g_time_zone_new ("PST8");
|
tz = g_time_zone_new ("PST8");
|
||||||
g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "PST8");
|
g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "PST8");
|
||||||
g_assert_cmpstr (g_time_zone_get_abbreviation (tz, 0), ==, "PST");
|
g_assert_cmpstr (g_time_zone_get_abbreviation (tz, 0), ==, "PST");
|
||||||
|
Loading…
Reference in New Issue
Block a user