Check the return value of g_get_prgname for NULL before passing to strcmp.
authorBehdad Esfahbod <behdad@gnome.org>
Wed, 5 Apr 2006 05:56:47 +0000 (05:56 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Wed, 5 Apr 2006 05:56:47 +0000 (05:56 +0000)
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.

ChangeLog
ChangeLog.pre-2-12
tests/option-test.c
tests/slice-test.c

index 1a581cf..b047a8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
 2006-04-05  Matthias Clasen  <mclasen@redhat.com>
 
        * tests/run-collate-tests.sh: Fix up shell script.
index 1a581cf..b047a8b 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2006-04-05  Matthias Clasen  <mclasen@redhat.com>
 
        * tests/run-collate-tests.sh: Fix up shell script.
index cd3a01a..48dd253 100644 (file)
@@ -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);
 }
index 9c39b66..52d9572 100644 (file)
@@ -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