From 109dc305819310d8d3dc0e8d5d8cd258ba1a8620 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 29 Nov 2018 09:45:10 +0000 Subject: [PATCH] tests: Add descriptions to environment tests Prompted by !500. Signed-off-by: Philip Withnall --- glib/tests/environment.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/glib/tests/environment.c b/glib/tests/environment.c index c262c47cd..83385863e 100644 --- a/glib/tests/environment.c +++ b/glib/tests/environment.c @@ -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);