[gtk] tests: improve error handling



commit fd7f6ca7ad35391c6137da5209cfe6cae3f32c74
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jul 25 13:48:52 2019 -0400

    tests: improve error handling

 testsuite/gsk/compare-render.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/testsuite/gsk/compare-render.c b/testsuite/gsk/compare-render.c
index 59a0bd2a3c..e61fa71e66 100644
--- a/testsuite/gsk/compare-render.c
+++ b/testsuite/gsk/compare-render.c
@@ -140,7 +140,7 @@ main (int argc, char **argv)
   GError *error = NULL;
   GOptionContext *context;
 
-  context = g_option_context_new ("- run GSK node tests");
+  context = g_option_context_new ("NODE REF - run GSK node tests");
   g_option_context_add_main_entries (context, options, NULL);
   g_option_context_set_ignore_unknown_options (context, TRUE);
 
@@ -149,8 +149,12 @@ main (int argc, char **argv)
       g_error ("Option parsing failed: %s\n", error->message);
       return 1;
     }
-
-  g_assert (argc == 3);
+  else if (argc != 3)
+    {
+      char *help = g_option_context_get_help (context, TRUE, NULL);
+      g_print ("%s", help);
+      return 1;
+    }
 
   gtk_init ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]