diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-04-05 05:56:47 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-04-05 05:56:47 +0000 |
commit | 8741c8bf5aacbacc4071019d23c47e9d0ea9a4ee (patch) | |
tree | 1438a322188c6d8eec30f2d051427cd977c29bcd /tests | |
parent | 5525aa52c9191ff621ff4526167d554af902dc68 (diff) |
Check the return value of g_get_prgname for NULL before passing to strcmp.
2006-04-05 Behdad Esfahbod <behdad@gnome.org>
* tests/option-test.c: Check the return value of g_get_prgname for
NULL before passing to strcmp.
* tests/slice-test.c: Report the correct name in Usage summary.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/option-test.c | 4 | ||||
-rw-r--r-- | tests/slice-test.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/option-test.c b/tests/option-test.c index cd3a01ad6..48dd2531f 100644 --- a/tests/option-test.c +++ b/tests/option-test.c @@ -916,6 +916,7 @@ empty_test1 (void) GOptionContext *context; GOptionEntry entries [] = { { NULL } }; + char *prgname; g_set_prgname (NULL); context = g_option_context_new (NULL); @@ -924,7 +925,8 @@ empty_test1 (void) g_option_context_parse (context, NULL, NULL, NULL); - g_assert (strcmp (g_get_prgname (), "<unknown>") == 0); + prgname = g_get_prgname (); + g_assert (prgname && strcmp (prgname, "<unknown>") == 0); g_option_context_free (context); } diff --git a/tests/slice-test.c b/tests/slice-test.c index 9c39b666a..52d9572ad 100644 --- a/tests/slice-test.c +++ b/tests/slice-test.c @@ -189,7 +189,7 @@ test_sliced_mem_thread (gpointer data) static void usage (void) { - g_print ("Usage: gslicedmemory [n_threads] [G|S|M|O][f][c] [maxblocksize] [seed]\n"); + g_print ("Usage: slice-test [n_threads] [G|S|M|O][f][c] [maxblocksize] [seed]\n"); } int |