[gimp] app/tests: Do role tests on the dock windows, not the docks



commit 3cd7c5a6cdcfa82c01e258575834c066823416fe
Author: Martin Nordholts <martinn src gnome org>
Date:   Sat Sep 26 12:48:44 2009 +0200

    app/tests: Do role tests on the dock windows, not the docks

 app/tests/test-window-management.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/app/tests/test-window-management.c b/app/tests/test-window-management.c
index c526502..e5fea31 100644
--- a/app/tests/test-window-management.c
+++ b/app/tests/test-window-management.c
@@ -23,6 +23,8 @@
 #include "dialogs/dialogs.h"
 
 #include "widgets/gimpdialogfactory.h"
+#include "widgets/gimpdock.h"
+#include "widgets/gimpdockwindow.h"
 
 #include "core/gimp.h"
 #include "core/gimpcontext.h"
@@ -85,15 +87,22 @@ static void
 gimp_test_window_roles (GimpTestFixture *fixture,
                         gconstpointer    data)
 {
-  GtkWidget *dock    = gimp_dialog_factory_dock_new (global_dock_factory,
-                                                     gdk_screen_get_default ());
-  GtkWidget *toolbox = gimp_dialog_factory_dock_new (global_toolbox_factory,
-                                                     gdk_screen_get_default ());
-
-  g_assert_cmpstr (gtk_window_get_role (GTK_WINDOW (toolbox)), ==,
-                   "gimp-toolbox");
-  g_assert_cmpstr (gtk_window_get_role (GTK_WINDOW (dock)), ==,
+  GtkWidget      *dock           = NULL;
+  GtkWidget      *toolbox        = NULL;
+  GimpDockWindow *dock_window    = NULL;
+  GimpDockWindow *toolbox_window = NULL;
+
+  dock           = gimp_dialog_factory_dock_new (global_dock_factory,
+                                                 gdk_screen_get_default ());
+  toolbox        = gimp_dialog_factory_dock_new (global_toolbox_factory,
+                                                 gdk_screen_get_default ());
+  dock_window    = gimp_dock_window_from_dock (GIMP_DOCK (dock));
+  toolbox_window = gimp_dock_window_from_dock (GIMP_DOCK (toolbox));
+
+  g_assert_cmpstr (gtk_window_get_role (GTK_WINDOW (dock_window)), ==,
                    "gimp-dock");
+  g_assert_cmpstr (gtk_window_get_role (GTK_WINDOW (toolbox_window)), ==,
+                   "gimp-toolbox");
 
   /* When we get here we have a ref count of one, but the signals we
    * emit cause the reference count to become less than zero for some



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]