diff options
author | Colin Walters <walters@verbum.org> | 2015-09-27 14:32:38 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-09-27 14:32:45 -0400 |
commit | 7c37a16ade424cf063414ce0dd4d170fd2f9c9b1 (patch) | |
tree | 0b09436c3e8c6dafd98c2e539fc9d2d8c8aecd6e /tests | |
parent | 4d9453f218074d03a5c44dbd44eeadb8e9e89f6c (diff) | |
download | gobject-introspection-7c37a16ade424cf063414ce0dd4d170fd2f9c9b1.tar.gz |
scanner: Warn and ignore on incorrect transfer annotations
This reverts commit 232f3c831260f596e36159112292897962a505b4.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gimarshallingtests.c | 2 | ||||
-rw-r--r-- | tests/scanner/Regress-1.0-expected.gir | 2 | ||||
-rw-r--r-- | tests/warn/invalid-transfer.h | 32 |
3 files changed, 30 insertions, 6 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 76beb92e..69311de7 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -3409,7 +3409,7 @@ glong /** * gi_marshalling_tests_pointer_in_return: * - * Returns: (transfer none): The same pointer + * Returns: The same pointer */ gpointer gi_marshalling_tests_pointer_in_return (gpointer pointer) diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index aeb3fdbc..bc3d29dc 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -1461,7 +1461,7 @@ uses a C sugar return type.</doc> c:identifier="regress_foo_object_new_cookie" introspectable="0"> <doc xml:space="preserve">Not sure why this test is here...</doc> - <return-value> + <return-value transfer-ownership="none"> <type name="FooObjectCookie" c:type="RegressFooObjectCookie"/> </return-value> <parameters> diff --git a/tests/warn/invalid-transfer.h b/tests/warn/invalid-transfer.h index ec43f2ac..054bb768 100644 --- a/tests/warn/invalid-transfer.h +++ b/tests/warn/invalid-transfer.h @@ -1,12 +1,36 @@ +#include "common.h" + +typedef char TestChar; /** * test_transfer_invalid: * @param: (transfer): * @param2: (transfer invalid): * @param3: (transfer full foo): + * @param4: (transfer full): + * @param5: (transfer full): + * @param6: (transfer full): + * @param7: (transfer container): + * @param8: (transfer floating): + */ +void test_transfer_invalid(GObject *param, GObject *param2, GObject *param3, + char param4, TestChar param5, GType param6, + GObject *param7, GDateTime *param8); + +// EXPECT:7: Warning: Test: "transfer" annotation needs one option, none given +// EXPECT:8: Warning: Test: invalid "transfer" annotation option: "invalid" +// EXPECT:9: Warning: Test: "transfer" annotation needs one option, 2 given +// EXPECT:10: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types +// EXPECT:11: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types +// EXPECT:12: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types +// EXPECT:13: Warning: Test: invalid "transfer" annotation: only valid for container types +// EXPECT:14: Warning: Test: invalid "transfer" annotation: only valid for object and interface types + +/** + * test_transfer_return_invalid: + * + * Returns: (transfer full): */ -void test_transfer_invalid(int param, int param2, int param3); +char test_transfer_return_invalid (void); -// EXPECT:4: Warning: Test: "transfer" annotation needs one option, none given -// EXPECT:5: Warning: Test: invalid "transfer" annotation option: "invalid" -// EXPECT:6: Warning: Test: "transfer" annotation needs one option, 2 given +// EXPECT:32: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types |