Blame gtk/tests/defaultvalue.c

Packit Service fb6fa5
/* Gtk+ default value tests
Packit Service fb6fa5
 * Copyright (C) 2007 Christian Persch
Packit Service fb6fa5
 *               2007 Johan Dahlin
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Library General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service fb6fa5
 * Library General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Library General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#undef GTK_DISABLE_DEPRECATED
Packit Service fb6fa5
#define GTK_ENABLE_BROKEN
Packit Service fb6fa5
#include <string.h>
Packit Service fb6fa5
#include <gtk/gtk.h>
Packit Service fb6fa5
#include <gtk/gtkunixprint.h>
Packit Service fb6fa5
Packit Service fb6fa5
static void
Packit Service fb6fa5
check_property (const char *output,
Packit Service fb6fa5
	        GParamSpec *pspec,
Packit Service fb6fa5
		GValue *value)
Packit Service fb6fa5
{
Packit Service fb6fa5
  GValue default_value = { 0, };
Packit Service fb6fa5
  char *v, *dv, *msg;
Packit Service fb6fa5
Packit Service fb6fa5
  if (g_param_value_defaults (pspec, value))
Packit Service fb6fa5
      return;
Packit Service fb6fa5
Packit Service fb6fa5
  g_value_init (&default_value, G_PARAM_SPEC_VALUE_TYPE (pspec));
Packit Service fb6fa5
  g_param_value_set_default (pspec, &default_value);
Packit Service fb6fa5
      
Packit Service fb6fa5
  v = g_strdup_value_contents (value);
Packit Service fb6fa5
  dv = g_strdup_value_contents (&default_value);
Packit Service fb6fa5
  
Packit Service fb6fa5
  msg = g_strdup_printf ("%s %s.%s: %s != %s\n",
Packit Service fb6fa5
			 output,
Packit Service fb6fa5
			 g_type_name (pspec->owner_type),
Packit Service fb6fa5
			 pspec->name,
Packit Service fb6fa5
			 dv, v);
Packit Service fb6fa5
  g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__,
Packit Service fb6fa5
		       G_STRFUNC, msg);
Packit Service fb6fa5
  g_free (msg);
Packit Service fb6fa5
  
Packit Service fb6fa5
  g_free (v);
Packit Service fb6fa5
  g_free (dv);
Packit Service fb6fa5
  g_value_unset (&default_value);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
static void
Packit Service fb6fa5
test_type (gconstpointer data)
Packit Service fb6fa5
{
Packit Service fb6fa5
  GObjectClass *klass;
Packit Service fb6fa5
  GObject *instance;
Packit Service fb6fa5
  GParamSpec **pspecs;
Packit Service fb6fa5
  guint n_pspecs, i;
Packit Service fb6fa5
  GType type;
Packit Service fb6fa5
Packit Service fb6fa5
  type = * (GType *) data;
Packit Service fb6fa5
Packit Service fb6fa5
  if (!G_TYPE_IS_CLASSED (type))
Packit Service fb6fa5
    return;
Packit Service fb6fa5
Packit Service fb6fa5
  if (G_TYPE_IS_ABSTRACT (type))
Packit Service fb6fa5
    return;
Packit Service fb6fa5
Packit Service fb6fa5
  if (!g_type_is_a (type, G_TYPE_OBJECT))
Packit Service fb6fa5
    return;
Packit Service fb6fa5
Packit Service fb6fa5
  /* These can't be freely constructed/destroyed */
Packit Service fb6fa5
  if (g_type_is_a (type, GTK_TYPE_PRINT_JOB) ||
Packit Service fb6fa5
      g_type_is_a (type, GDK_TYPE_PIXBUF_LOADER) ||
Packit Service fb6fa5
      g_type_is_a (type, gdk_pixbuf_simple_anim_iter_get_type ()))
Packit Service fb6fa5
    return;
Packit Service fb6fa5
Packit Service fb6fa5
  /* The gtk_arg compat wrappers can't set up default values */
Packit Service fb6fa5
  if (g_type_is_a (type, GTK_TYPE_CLIST) ||
Packit Service fb6fa5
      g_type_is_a (type, GTK_TYPE_CTREE) ||
Packit Service fb6fa5
      g_type_is_a (type, GTK_TYPE_LIST) ||
Packit Service fb6fa5
      g_type_is_a (type, GTK_TYPE_TIPS_QUERY)) 
Packit Service fb6fa5
    return;
Packit Service fb6fa5
Packit Service fb6fa5
  klass = g_type_class_ref (type);
Packit Service fb6fa5
  
Packit Service fb6fa5
  if (g_type_is_a (type, GTK_TYPE_SETTINGS))
Packit Service fb6fa5
    instance = g_object_ref (gtk_settings_get_default ());
Packit Service fb6fa5
  else if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER))
Packit Service fb6fa5
    instance = g_object_ref (gdk_pango_renderer_get_default (gdk_screen_get_default ()));
Packit Service fb6fa5
  else if (g_type_is_a (type, GDK_TYPE_PIXMAP))
Packit Service fb6fa5
    instance = g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1));
Packit Service fb6fa5
  else if (g_type_is_a (type, GDK_TYPE_COLORMAP))
Packit Service fb6fa5
    instance = g_object_ref (gdk_colormap_new (gdk_visual_get_best (), TRUE));
Packit Service fb6fa5
  else if (g_type_is_a (type, GDK_TYPE_WINDOW))
Packit Service fb6fa5
    {
Packit Service fb6fa5
      GdkWindowAttr attributes;
Packit Service fb6fa5
      attributes.window_type = GDK_WINDOW_TEMP;
Packit Service fb6fa5
      attributes.event_mask = 0;
Packit Service fb6fa5
      attributes.width = 100;
Packit Service fb6fa5
      attributes.height = 100;
Packit Service fb6fa5
      instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
Packit Service fb6fa5
    }
Packit Service fb6fa5
  else
Packit Service fb6fa5
    instance = g_object_new (type, NULL);
Packit Service fb6fa5
Packit Service fb6fa5
  if (g_type_is_a (type, G_TYPE_INITIALLY_UNOWNED))
Packit Service fb6fa5
    g_object_ref_sink (instance);
Packit Service fb6fa5
Packit Service fb6fa5
  pspecs = g_object_class_list_properties (klass, &n_pspecs);
Packit Service fb6fa5
  for (i = 0; i < n_pspecs; ++i)
Packit Service fb6fa5
    {
Packit Service fb6fa5
      GParamSpec *pspec = pspecs[i];
Packit Service fb6fa5
      GValue value = { 0, };
Packit Service fb6fa5
      
Packit Service fb6fa5
      if (pspec->owner_type != type)
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if ((pspec->flags & G_PARAM_READABLE) == 0)
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GDK_TYPE_DISPLAY_MANAGER) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "default-display") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "screen") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_ABOUT_DIALOG) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "program-name") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
      
Packit Service fb6fa5
      /* These are set to the current date */
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_CALENDAR) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "year") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "month") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "day") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_CELL_RENDERER_TEXT) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "background-gdk") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "foreground-gdk") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "font") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "font-desc") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_CELL_VIEW) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "background-gdk") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "foreground-gdk") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_COLOR_BUTTON) &&
Packit Service fb6fa5
	  strcmp (pspec->name, "color") == 0)
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_COLOR_SELECTION) &&
Packit Service fb6fa5
	  strcmp (pspec->name, "current-color") == 0)
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_COLOR_SELECTION_DIALOG) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "color-selection") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "ok-button") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "help-button") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "cancel-button") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      /* Default invisible char is determined at runtime */
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_ENTRY) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "invisible-char") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "buffer") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      /* Gets set to the cwd */
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_FILE_SELECTION) &&
Packit Service fb6fa5
	  strcmp (pspec->name, "filename") == 0)
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_FONT_SELECTION) &&
Packit Service fb6fa5
	  strcmp (pspec->name, "font") == 0)
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_LAYOUT) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "hadjustment") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "vadjustment") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_MESSAGE_DIALOG) &&
Packit Service fb6fa5
          (strcmp (pspec->name, "image") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "message-area") == 0))
Packit Service fb6fa5
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_PRINT_OPERATION) &&
Packit Service fb6fa5
	  strcmp (pspec->name, "job-name") == 0)
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_PRINT_UNIX_DIALOG) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "page-setup") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "print-settings") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_PROGRESS_BAR) &&
Packit Service fb6fa5
          strcmp (pspec->name, "adjustment") == 0)
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      /* filename value depends on $HOME */
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_RECENT_MANAGER) &&
Packit Service fb6fa5
          (strcmp (pspec->name, "filename") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "size") == 0))
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_SCALE_BUTTON) &&
Packit Service fb6fa5
          strcmp (pspec->name, "adjustment") == 0)
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_SCROLLED_WINDOW) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "hadjustment") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "vadjustment") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      /* these defaults come from XResources */
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_SETTINGS) &&
Packit Service fb6fa5
          strncmp (pspec->name, "gtk-xft-", 8) == 0)
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_SETTINGS) &&
Packit Service fb6fa5
          (strcmp (pspec->name, "color-hash") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-cursor-theme-name") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-cursor-theme-size") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-dnd-drag-threshold") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-double-click-time") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-fallback-icon-theme") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-file-chooser-backend") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-icon-theme-name") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-im-module") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-key-theme-name") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "gtk-theme-name") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "gtk-sound-theme-name") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "gtk-enable-input-feedback-sounds") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "gtk-enable-event-sounds") == 0))
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_SPIN_BUTTON) &&
Packit Service fb6fa5
          (strcmp (pspec->name, "adjustment") == 0))
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_STATUS_ICON) &&
Packit Service fb6fa5
          (strcmp (pspec->name, "size") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "screen") == 0))
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_TEXT_BUFFER) &&
Packit Service fb6fa5
          (strcmp (pspec->name, "tag-table") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "copy-target-list") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "paste-target-list") == 0))
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      /* language depends on the current locale */
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_TEXT_TAG) &&
Packit Service fb6fa5
          (strcmp (pspec->name, "background-gdk") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "foreground-gdk") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "language") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "font") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "font-desc") == 0))
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_TEXT) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "hadjustment") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "vadjustment") == 0))
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_TEXT_VIEW) &&
Packit Service fb6fa5
          strcmp (pspec->name, "buffer") == 0)
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_TOOL_ITEM_GROUP) &&
Packit Service fb6fa5
          strcmp (pspec->name, "label-widget") == 0)
Packit Service fb6fa5
        continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_TREE_VIEW) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "hadjustment") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "vadjustment") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_VIEWPORT) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "hadjustment") == 0 ||
Packit Service fb6fa5
           strcmp (pspec->name, "vadjustment") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_type_is_a (type, GTK_TYPE_WIDGET) &&
Packit Service fb6fa5
	  (strcmp (pspec->name, "name") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "screen") == 0 ||
Packit Service fb6fa5
	   strcmp (pspec->name, "style") == 0))
Packit Service fb6fa5
	continue;
Packit Service fb6fa5
Packit Service fb6fa5
      if (g_test_verbose ())
Packit Service fb6fa5
      g_print ("Property %s.%s\n", 
Packit Service fb6fa5
	     g_type_name (pspec->owner_type),
Packit Service fb6fa5
	     pspec->name);
Packit Service fb6fa5
      g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
Packit Service fb6fa5
      g_object_get_property (instance, pspec->name, &value);
Packit Service fb6fa5
      check_property ("Property", pspec, &value);
Packit Service fb6fa5
      g_value_unset (&value);
Packit Service fb6fa5
    }
Packit Service fb6fa5
  g_free (pspecs);
Packit Service fb6fa5
Packit Service fb6fa5
  if (g_type_is_a (type, GTK_TYPE_WIDGET))
Packit Service fb6fa5
    {
Packit Service fb6fa5
      pspecs = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (klass), &n_pspecs);
Packit Service fb6fa5
      
Packit Service fb6fa5
      for (i = 0; i < n_pspecs; ++i)
Packit Service fb6fa5
	{
Packit Service fb6fa5
	  GParamSpec *pspec = pspecs[i];
Packit Service fb6fa5
	  GValue value = { 0, };
Packit Service fb6fa5
	  
Packit Service fb6fa5
	  if (pspec->owner_type != type)
Packit Service fb6fa5
	    continue;
Packit Service fb6fa5
Packit Service fb6fa5
	  if ((pspec->flags & G_PARAM_READABLE) == 0)
Packit Service fb6fa5
	    continue;
Packit Service fb6fa5
	  
Packit Service fb6fa5
	  g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
Packit Service fb6fa5
	  gtk_widget_style_get_property (GTK_WIDGET (instance), pspec->name, &value);
Packit Service fb6fa5
	  check_property ("Style property", pspec, &value);
Packit Service fb6fa5
	  g_value_unset (&value);
Packit Service fb6fa5
	}
Packit Service fb6fa5
Packit Service fb6fa5
      g_free (pspecs);
Packit Service fb6fa5
    }
Packit Service fb6fa5
  
Packit Service fb6fa5
  if (g_type_is_a (type, GDK_TYPE_WINDOW))
Packit Service fb6fa5
    gdk_window_destroy (GDK_WINDOW (instance));
Packit Service fb6fa5
  else
Packit Service fb6fa5
    g_object_unref (instance);
Packit Service fb6fa5
  
Packit Service fb6fa5
  g_type_class_unref (klass);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
extern void pixbuf_init (void);
Packit Service fb6fa5
Packit Service fb6fa5
int
Packit Service fb6fa5
main (int argc, char **argv)
Packit Service fb6fa5
{
Packit Service fb6fa5
  const GType *otypes;
Packit Service fb6fa5
  guint i;
Packit Service fb6fa5
Packit Service fb6fa5
  gtk_test_init (&argc, &argv);
Packit Service fb6fa5
  pixbuf_init ();
Packit Service fb6fa5
  gtk_test_register_all_types();
Packit Service fb6fa5
  
Packit Service fb6fa5
  otypes = gtk_test_list_all_types (NULL);
Packit Service fb6fa5
  for (i = 0; otypes[i]; i++)
Packit Service fb6fa5
    {
Packit Service fb6fa5
      gchar *testname;
Packit Service fb6fa5
      
Packit Service fb6fa5
      testname = g_strdup_printf ("/Default Values/%s",
Packit Service fb6fa5
				  g_type_name (otypes[i]));
Packit Service fb6fa5
      g_test_add_data_func (testname,
Packit Service fb6fa5
                            &otypes[i],
Packit Service fb6fa5
			    test_type);
Packit Service fb6fa5
      g_free (testname);
Packit Service fb6fa5
    }
Packit Service fb6fa5
  
Packit Service fb6fa5
  return g_test_run();
Packit Service fb6fa5
}