glib r6500 - in trunk: . glib tests/gobject



Author: matthiasc
Date: Mon Feb 11 18:28:42 2008
New Revision: 6500
URL: http://svn.gnome.org/viewvc/glib?rev=6500&view=rev

Log:
2008-02-10  Matthias Clasen <mclasen redhat com>

        * glib/gtestutils.h: Make the g_test_add macro work with
        gcc 4.3

        * tests/gobject/paramspec-test.c: Adapt to recent changes in
        GParamGType initialization.



Modified:
   trunk/ChangeLog
   trunk/glib/gtestutils.h
   trunk/tests/gobject/paramspec-test.c

Modified: trunk/glib/gtestutils.h
==============================================================================
--- trunk/glib/gtestutils.h	(original)
+++ trunk/glib/gtestutils.h	Mon Feb 11 18:28:42 2008
@@ -90,14 +90,17 @@
                                          void          (*test_func) (gconstpointer));
 /* hook up a test with fixture under test path */
 #define g_test_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
-                                        ((void (*) (const char*,       \
+					G_STMT_START {			\
+                                         void (*add_vtable) (const char*,       \
                                                     gsize,             \
                                                     gconstpointer,     \
                                                     void (*) (Fixture*, gconstpointer),   \
                                                     void (*) (Fixture*, gconstpointer),   \
-                                                    void (*) (Fixture*, gconstpointer)))  \
-                                         (void*) g_test_add_vtable) \
-                                          (testpath, sizeof (Fixture), tdata, fsetup, ftest, fteardown)
+                                                    void (*) (Fixture*, gconstpointer)) =  (void (*) (const gchar *, gsize, gconstpointer, void (*) (Fixture*, gconstpointer), void (*) (Fixture*, gconstpointer), void (*) (Fixture*, gconstpointer))) g_test_add_vtable; \
+                                         add_vtable \
+                                          (testpath, sizeof (Fixture), tdata, fsetup, ftest, fteardown); \
+					} G_STMT_END
+
 /* add test messages to the test report */
 void    g_test_message                  (const char *format,
                                          ...) G_GNUC_PRINTF (1, 2);

Modified: trunk/tests/gobject/paramspec-test.c
==============================================================================
--- trunk/tests/gobject/paramspec-test.c	(original)
+++ trunk/tests/gobject/paramspec-test.c	Mon Feb 11 18:28:42 2008
@@ -193,13 +193,13 @@
 			      G_TYPE_PARAM, G_PARAM_READWRITE);
   
   g_value_init (&value, G_TYPE_GTYPE);
-  g_value_set_gtype (&value, G_TYPE_NONE);
+  g_value_set_gtype (&value, G_TYPE_PARAM);
 
   g_assert (g_param_value_defaults (pspec, &value));
   
   g_value_set_gtype (&value, G_TYPE_INT);
   modified = g_param_value_validate (pspec, &value);
-  g_assert (modified && g_value_get_gtype (&value) == G_TYPE_NONE);
+  g_assert (modified && g_value_get_gtype (&value) == G_TYPE_PARAM);
 
   g_value_set_gtype (&value, G_TYPE_PARAM_INT);
   modified = g_param_value_validate (pspec, &value);



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