Use the new g_option_context_parse_strv() to patch up some leaks in some
insufficiently-argv-emulating testcases in option-context.c.
This gives some test coverage of the new function while also making
option-context now leak-free.
https://bugzilla.gnome.org/show_bug.cgi?id=721947
argv = split_string ("program --test bla", &argc);
argv = split_string ("program --test bla", &argc);
- retval = g_option_context_parse (context, &argc, &argv, &error);
+ retval = g_option_context_parse_strv (context, &argv, &error);
g_assert (retval == TRUE);
g_assert_no_error (error);
g_strfreev (argv);
g_option_context_free (context);
g_assert (retval == TRUE);
g_assert_no_error (error);
g_strfreev (argv);
g_option_context_free (context);
argv = split_string ("program --test 5", &argc);
argv = split_string ("program --test 5", &argc);
- retval = g_option_context_parse (context, &argc, &argv, &error);
+ retval = g_option_context_parse_strv (context, &argv, &error);
g_assert (retval == TRUE);
g_assert_no_error (error);
g_strfreev (argv);
g_assert (retval == TRUE);
g_assert_no_error (error);
g_strfreev (argv);