Merge branch 'wip/pwithnall/fix-environment-tests' into 'main'

tests: Fix environment test on FreeBSD

See merge request GNOME/glib!2407
This commit is contained in:
Sebastian Dröge 2021-12-24 10:08:50 +00:00
commit 8ca2a7d7c8

View File

@ -113,8 +113,11 @@ test_getenv (void)
g_assert_true (g_setenv ("foo", "bar=baz", TRUE));
/* Different OSs return different values; some return NULL because the key
* is invalid, but some are happy to return what we set above. */
data = g_getenv ("foo=bar");
g_assert_cmpstr (data, ==, "baz");
if (data != NULL)
g_assert_cmpstr (data, ==, "baz");
data = g_getenv ("foo");
g_assert_cmpstr (data, ==, "bar=baz");