mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
tests: Fix environment test on FreeBSD
Fix for commit 20c8ea1bc651bc4b79d39b80d42b468f6e7a2dc8; while Linux seems happy to return the value for the invalid key we set above, BSD returns NULL (which is probably a more valid thing to do). Accept both. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
eaa52ddfc5
commit
4bb9e20fff
@ -103,8 +103,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");
|
||||
|
Loading…
Reference in New Issue
Block a user