glib/tests/option-context: remove unused tests
authorDan Winship <danw@gnome.org>
Wed, 8 Feb 2012 13:46:03 +0000 (08:46 -0500)
committerDan Winship <danw@gnome.org>
Wed, 8 Feb 2012 13:46:03 +0000 (08:46 -0500)
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.

glib/tests/option-context.c

index ba8fcf1..5b839d9 100644 (file)
@@ -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,