diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-02-11 18:28:42 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-02-11 18:28:42 +0000 |
commit | f5542c90e3ee184dc9936ec4d816da14d2a2660d (patch) | |
tree | 03fbfe1e4c0a6f3912f137d4e5c3f302990cd53e | |
parent | 92aaf63ec0443a04e9b8b50439ea23a582ecc5e6 (diff) | |
download | glib-f5542c90e3ee184dc9936ec4d816da14d2a2660d.tar.gz |
Make the g_test_add macro work with gcc 4.3
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.
svn path=/trunk/; revision=6500
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | glib/gtestutils.h | 11 | ||||
-rw-r--r-- | tests/gobject/paramspec-test.c | 4 |
3 files changed, 17 insertions, 6 deletions
@@ -1,5 +1,13 @@ 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. + +2008-02-10 Matthias Clasen <mclasen@redhat.com> + * glib/gtestutils.c: Fix a typo in the docs. 2008-02-09 Matthias Clasen <mclasen@redhat.com> diff --git a/glib/gtestutils.h b/glib/gtestutils.h index f93a0a46e..7deb2a388 100644 --- a/glib/gtestutils.h +++ b/glib/gtestutils.h @@ -90,14 +90,17 @@ void g_test_add_data_func (const char *testpath, 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); diff --git a/tests/gobject/paramspec-test.c b/tests/gobject/paramspec-test.c index 16ee3b19b..498aed0b0 100644 --- a/tests/gobject/paramspec-test.c +++ b/tests/gobject/paramspec-test.c @@ -193,13 +193,13 @@ test_param_spec_gtype (void) 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); |