tests: Add descriptions to environment tests

Prompted by !500.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2018-11-29 09:45:10 +00:00 committed by Philip Withnall
parent fa5a99bffd
commit 109dc30581

View File

@ -26,6 +26,10 @@ test_listenv (void)
gchar **list;
gint i;
g_test_summary ("Test g_get_environ() returns an array of unique keys, all "
"of which can be individually queried using g_getenv() to "
"return the same value.");
table = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
@ -68,6 +72,9 @@ test_getenv (void)
const gchar *value1 = "works";
const gchar *value2 = "again";
g_test_summary ("Test setting an environment variable using g_setenv(), and "
"that the updated value is queryable using g_getenv().");
/* Check that TEST_G_SETENV is not already set */
g_assert_null (g_getenv (variable));
@ -168,6 +175,9 @@ test_environ_array (void)
gchar **env;
const gchar *value;
g_test_summary ("Test getting and setting variables on a local envp array "
"(rather than the global envp).");
env = g_new (gchar *, 1);
env[0] = NULL;
@ -242,6 +252,8 @@ test_environ_null (void)
gchar **env;
const gchar *value;
g_test_summary ("Test getting and setting variables on a NULL envp array.");
env = NULL;
value = g_environ_getenv (env, "foo");
@ -261,6 +273,10 @@ test_environ_case (void)
gchar **env;
const gchar *value;
g_test_summary ("Test that matching environment variables is case-insensitive "
"on Windows and not on other platforms, since envvars were "
"case-insensitive on DOS.");
env = NULL;
env = g_environ_setenv (env, "foo", "bar", TRUE);