tests: Relax the time zone identifier tests

On closer reading of `man 3 timezone`, it’s actually permissible for
`TZ` to contain an absolute path which points to a tzfile file outside
the system time zone database. This is indeed what happens when building
GLib under Fedora’s toolbox, so relax that check in the tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-10-16 14:29:15 +01:00
parent 3dec72b946
commit c4d46d632f

View File

@ -2585,11 +2585,11 @@ test_identifier (void)
g_time_zone_unref (tz);
/* System timezone. We cant change this, but we can at least assert that
* the identifier is non-NULL and doesnt start with a slash. */
* the identifier is non-NULL and non-empty. */
tz = g_time_zone_new (NULL);
g_test_message ("System time zone identifier: %s", g_time_zone_get_identifier (tz));
g_assert_nonnull (g_time_zone_get_identifier (tz));
g_assert_cmpstr (g_time_zone_get_identifier (tz), !=, "");
g_assert_true (*g_time_zone_get_identifier (tz) != '/');
g_time_zone_unref (tz);
/* Local timezone tests. */