GNOME Bugzilla – Bug 607664
Add support for nullable arguments
Last modified: 2010-04-18 14:46:35 UTC
/** * test_gi_int8_inout_null: * int8: (inout) (allow-none): */ void test_gi_int8_inout_null (gint8 *int8) { g_assert(int8 == NULL); } ====================================================================== ERROR: test_int8_inout_null (test_gi.TestInt8) ---------------------------------------------------------------------- Traceback (most recent call last):
+ Trace 220182
self.assertEquals(None, TestGI.int8_inout_null(None))
return info.invoke(*args)
The code that should support that is based on g_type_info_is_pointer, which shouldn't be used for that.
Hm, no, I read the code a little bit too quickly. Nullable arguments are not supported.
Created attachment 152004 [details] [review] Add tests for nullable strings Here are a few tests for null strings as arguments. That should be extended to all types that get passed by reference. Note that I'm not sure of the semantic of inout and out nullable arguments: passing NULL, or a pointer to NULL? In the first case, the caller discards the output argument, while in the second case the caller doesn't pass an input argument.
*** Bug 609200 has been marked as a duplicate of this bug. ***
Review of attachment 152004 [details] [review]: I was able to reuse a lot of this in 616035, thanks!
*** This bug has been marked as a duplicate of bug 616035 ***