[Vala] glib-2.0 - glib-2.0.vapi mismatch bug: TestFixtureFunc vs TestFunc



Hello, using the glib-2.0 `GLib.TestCase` constructor triggers the
following warning:

warning: passing argument 4 of ‘g_test_create_case’ from incompatible
pointer type
             ts.add(new TestCase("context", (TestFunc)setup,
(TestFunc)test_context, (TestFunc)teardown));

It means, the `g_test_create_case` arguments of type TestFixtureFunc
which has been depecrated in the glib-2.0.vapi, note the following
lines of the /usr/share/vala-0.30/glib-2.0.vapi file:

#if GLIB_2_26
    [CCode (has_target = false)]
    public delegate void TestFunc ();
    public delegate void TestDataFunc ();
    public delegate void TestFixtureFunc (void* fixture);
#else
    public delegate void TestFunc (void* fixture);
    public delegate void TestDataFunc ();
#endif

The keyword `TestFixtureFunc` has been removed since version 2_26, but
it is still used in the glib-2.0 header
/usr/include/glib-2.0/glib/gtestutils.h:

/* semi-internal API */
GLIB_AVAILABLE_IN_ALL
GTestCase*    g_test_create_case        (const char       *test_name,
                                         gsize             data_size,
                                         gconstpointer     test_data,
                                         GTestFixtureFunc  data_setup,
                                         GTestFixtureFunc  data_test,
                                         GTestFixtureFunc  data_teardown);


-- 
Skype: felipeanl


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