]> Pileus Git - ~andy/gtk/commitdiff
Make it pass again.
authorJohan Dahlin <johan@gnome.org>
Thu, 3 Jan 2008 08:51:03 +0000 (08:51 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Thu, 3 Jan 2008 08:51:03 +0000 (08:51 +0000)
2008-01-03  Johan Dahlin  <johan@gnome.org>

* tests/defaultvaluetest.c: Make it pass again.

svn path=/trunk/; revision=19300

ChangeLog
tests/defaultvaluetest.c

index 3f5e7662193e5b3da2db5368b6285b1d1496a17d..e7d9a969fbcf624c74bc1ee6ac16178ee7ee6742 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-03  Johan Dahlin  <johan@gnome.org>
+
+       * tests/defaultvaluetest.c: Make it pass again.
+
 2008-01-02  Johan Dahlin  <johan@gnome.org>
 
        * tests/defaultvaluetest.c (test_type): Ignore a few more tests to 
index 26f83f9c326e615d592e88ec1a90b903b08665cc..f3c41e192bc4c070d3c42bc3b3fadd2d77dbc5a3 100644 (file)
  */
 
 #undef GTK_DISABLE_DEPRECATED
+#define GTK_ENABLE_BROKEN
 #include <string.h>
 #include <gtk/gtk.h>
-#include <gtk/gtktypebuiltins.h>
-#include <gtk/gtkprinter.h>
-#include <gtk/gtkpagesetupunixdialog.h>
 #include <gtk/gtkprintunixdialog.h>
 
 static void
@@ -78,20 +76,34 @@ test_type (gconstpointer data)
     return;
 
   /* These can't be freely constructed/destroyed */
-  if (g_type_is_a (type, GTK_TYPE_PRINT_JOB))
+  if (g_type_is_a (type, GTK_TYPE_PRINT_JOB) ||
+      g_type_is_a (type, GDK_TYPE_PIXBUF_LOADER) ||
+      g_type_is_a (type, gdk_pixbuf_simple_anim_iter_get_type ()))
     return;
 
   /* The gtk_arg compat wrappers can't set up default values */
   if (g_type_is_a (type, GTK_TYPE_CLIST) ||
       g_type_is_a (type, GTK_TYPE_CTREE) ||
       g_type_is_a (type, GTK_TYPE_LIST) ||
-      g_type_is_a (type, GTK_TYPE_TIPS_QUERY))
+      g_type_is_a (type, GTK_TYPE_TIPS_QUERY)) 
     return;
 
   klass = g_type_class_ref (type);
   
   if (g_type_is_a (type, GTK_TYPE_SETTINGS))
     instance = g_object_ref (gtk_settings_get_default ());
+  else if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER))
+    instance = g_object_ref (gdk_pango_renderer_get_default (gdk_screen_get_default ()));
+  else if (g_type_is_a (type, GDK_TYPE_PIXMAP))
+    instance = g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1));
+  else if (g_type_is_a (type, GDK_TYPE_COLORMAP))
+    instance = g_object_ref (gdk_colormap_new (gdk_visual_get_best (), TRUE));
+  else if (g_type_is_a (type, GDK_TYPE_WINDOW))
+    {
+      GdkWindowAttr attributes;
+      attributes.window_type = GDK_WINDOW_TEMP;
+      instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
+    }
   else
     instance = g_object_new (type, NULL);
 
@@ -110,11 +122,12 @@ test_type (gconstpointer data)
       if ((pspec->flags & G_PARAM_READABLE) == 0)
        continue;
 
-      /* Filter these out */
-      if (g_type_is_a (type, GTK_TYPE_WIDGET) &&
-         (strcmp (pspec->name, "name") == 0 ||
-          strcmp (pspec->name, "screen") == 0 ||
-          strcmp (pspec->name, "style") == 0))
+      if (g_type_is_a (type, GDK_TYPE_DISPLAY_MANAGER) &&
+         (strcmp (pspec->name, "default-display") == 0))
+       continue;
+
+      if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER) &&
+         (strcmp (pspec->name, "screen") == 0))
        continue;
 
       if (g_type_is_a (type, GTK_TYPE_ABOUT_DIALOG) &&
@@ -235,6 +248,11 @@ test_type (gconstpointer data)
           strcmp (pspec->name, "font-desc") == 0))
         continue;
 
+      if (g_type_is_a (type, GTK_TYPE_TEXT) &&
+         (strcmp (pspec->name, "hadjustment") == 0 ||
+           strcmp (pspec->name, "vadjustment") == 0))
+        continue;
+
       if (g_type_is_a (type, GTK_TYPE_TEXT_VIEW) &&
           strcmp (pspec->name, "buffer") == 0)
         continue;
@@ -249,6 +267,12 @@ test_type (gconstpointer data)
            strcmp (pspec->name, "vadjustment") == 0))
        continue;
 
+      if (g_type_is_a (type, GTK_TYPE_WIDGET) &&
+         (strcmp (pspec->name, "name") == 0 ||
+          strcmp (pspec->name, "screen") == 0 ||
+          strcmp (pspec->name, "style") == 0))
+       continue;
+
       g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
       g_object_get_property (instance, pspec->name, &value);
       check_property ("Property", pspec, &value);
@@ -277,7 +301,11 @@ test_type (gconstpointer data)
        }
     }
   
-  g_object_unref (instance);
+  if (g_type_is_a (type, GDK_TYPE_WINDOW))
+    gdk_window_destroy (GDK_WINDOW (instance));
+  else
+    g_object_unref (instance);
+  
   g_type_class_unref (klass);
 }