[PATCH] building test cases with glib2.0 past 2.25.11



Hi,

I just checked, it seems at least that Fedora 14 development is still
at glib2-2_25_11-1_fc14 if I understand the CVS repo correctly...

In any case, I just hit this issue while building NM master on Ubuntu
maverick. It seems that somewhere past glib2 version 2.25.11, and
definitely at version 2.25.13, src/tests/test-policy-hosts.c refuses
to build:

test-policy-hosts.c: In function ‘main’:
test-policy-hosts.c:686: error: passing argument 5 of
‘g_test_create_case’ from incompatible pointer type
/usr/include/glib-2.0/glib/gtestutils.h:167: note: expected
‘GTestFixtureFunc’ but argument is of type ‘void (*)(void)’

The fix is pretty obvious but here's a patch anyway :)

Mathieu Trudel-Lapierre
mathieu tl gmail com
diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c
index 682c996..c7c6ac5 100644
--- a/src/tests/test-policy-hosts.c
+++ b/src/tests/test-policy-hosts.c
@@ -671,9 +671,7 @@ test_find_token (void)
 	}
 }
 
-typedef void (*TCFunc)(void);
-
-#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL)
+#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (GTestFixtureFunc) t, NULL)
 
 int main (int argc, char **argv)
 {


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