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



If fall in this case, as in GLib.Thread, first check if GLib C
documentation state the API is deprecated. If so, you need to use

*--**target-glib**=**MAJOR*.*MINOR*

to be sure you'll generate code for the GLib version you use or target,
this ensure too, using latest API an avoid valac to generate code
compatible with old glib versions.
El feb. 3, 2016 5:25 PM, "Felipe Lavratti" <felipelav gmail com> escribió:

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
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list



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