summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-03-04 12:07:32 +0300
committermonsta <[email protected]>2016-03-04 12:07:32 +0300
commit226317d63b5bcf19e7ee888ef957379e10231c66 (patch)
tree1617f450f189214e4d4c69302a50e79e772a33e5
parent4d36400f979d31fa4295bbdd9111de2c45a375ae (diff)
downloadlibmatekbd-226317d63b5bcf19e7ee888ef957379e10231c66.tar.bz2
libmatekbd-226317d63b5bcf19e7ee888ef957379e10231c66.tar.xz
test: exit when option parsing fails
from https://git.gnome.org/browse/libgnomekbd/commit/?id=32eaea94a3b19ad3c6b7fcff5fec94454fbfd97f
-rw-r--r--test/matekbd-keyboard-drawing-test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/matekbd-keyboard-drawing-test.c b/test/matekbd-keyboard-drawing-test.c
index 5c350fd..0f489ba 100644
--- a/test/matekbd-keyboard-drawing-test.c
+++ b/test/matekbd-keyboard-drawing-test.c
@@ -164,6 +164,7 @@ main (gint argc, gchar ** argv)
gint monitor;
GdkRectangle rect;
GOptionContext *context;
+ GError *error = NULL;
MatekbdKeyboardDrawingGroupLevel groupLevels[4] =
{ {0, 0}, {1, 0}, {0, 1}, {1, 1} };
@@ -174,7 +175,11 @@ main (gint argc, gchar ** argv)
context = g_option_context_new ("kbdraw");
g_option_context_add_main_entries (context, options, NULL);
- g_option_context_parse (context, &argc, &argv, NULL);
+ if (!g_option_context_parse (context, &argc, &argv, &error)) {
+ g_message ("option parsing failed: %s", error->message);
+ g_option_context_free (context);
+ exit (EXIT_FAILURE);
+ }
g_option_context_free (context);
if (program_version) {