From: Dan Winship Date: Wed, 8 Feb 2012 13:46:03 +0000 (-0500) Subject: glib/tests/option-context: remove unused tests X-Git-Tag: 2.31.18~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8f516f61e42de970c78a2905a309a7c17eb02c2;p=platform%2Fupstream%2Fglib.git glib/tests/option-context: remove unused tests These tests were written, but then never used since it was decided to add g_warnings() to goption.c in the cases they were supposed to be testing. So anyway, just remove them. --- diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c index ba8fcf1..5b839d9 100644 --- a/glib/tests/option-context.c +++ b/glib/tests/option-context.c @@ -1057,74 +1057,6 @@ callback_test_optional_8 (void) g_option_context_free (context); } -static void -callback_test_optional_9 (void) -{ - GOptionContext *context; - gboolean retval; - GError *error = NULL; - gchar **argv; - gchar **argv_copy; - int argc; - gchar *string = NULL; - GOptionEntry entries [] = - { { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_STRING, - &string, NULL, NULL }, - { NULL } }; - - context = g_option_context_new (NULL); - g_option_context_add_main_entries (context, entries, NULL); - - /* Now try parsing */ - argv = split_string ("program -t", &argc); - argv_copy = copy_stringv (argv, argc); - - retval = g_option_context_parse (context, &argc, &argv, &error); - g_assert_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE); - g_assert (!retval); - g_assert (string == NULL); - check_identical_stringv (argv_copy, argv); - - g_error_free (error); - g_strfreev (argv_copy); - g_free (argv); - g_option_context_free (context); -} - -static void -callback_test_optional_10 (void) -{ - GOptionContext *context; - gboolean retval; - GError *error = NULL; - gchar **argv; - gchar **argv_copy; - int argc; - gchar *string = NULL; - GOptionEntry entries [] = - { { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_STRING, - &string, NULL, NULL }, - { NULL } }; - - context = g_option_context_new (NULL); - g_option_context_add_main_entries (context, entries, NULL); - - /* Now try parsing */ - argv = split_string ("program --test", &argc); - argv_copy = copy_stringv (argv, argc); - - retval = g_option_context_parse (context, &argc, &argv, &error); - g_assert_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE); - g_assert (!retval); - g_assert (string == NULL); - check_identical_stringv (argv_copy, argv); - - g_error_free (error); - g_strfreev (argv_copy); - g_free (argv); - g_option_context_free (context); -} - static GPtrArray *callback_remaining_args; static gboolean callback_remaining_test1_callback (const gchar *option_name, const gchar *value,