mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +01:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user