summaryrefslogtreecommitdiff
path: root/tests/gimarshallingtests.h
Commit message (Collapse)AuthorAgeFilesLines
* tests/gimarshallingtests: Add a test case for zero-terminated GValue arraysMarco Trevisan (Treviño)2023-04-101-0/+2
| | | | Required to test how gjs handles this case.
* gimarshallingtests: Add Structured Union types, unions with struct fieldsMarco Trevisan (Treviño)2022-11-211-0/+79
| | | | | | This allows to perform more introspection tests in gjs and other implementations when it comes to set/get fields or "cast" an union member to the main union type
* GIMarshallingTests: Add tests for caller allocated fixed size arraysMarco Trevisan (Treviño)2022-11-211-0/+6
| | | | | | | Such kind of arrays can be easily be allocated as we know the size of each array element. See: https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/806
* gimarshallingtests: Add GValue round-trip and copy functionsMarco Trevisan (Treviño)2022-01-111-0/+6
| | | | | We can use them in Gjs to verify whether a value is properly packed and unpacked to GValue.
* gimarshallingtests: Add some-string property to PropertiesObjectMarco Trevisan (Treviño)2022-01-111-0/+1
| | | | It's the only basic type missing, better to have for consistency.
* introspection: Remove 'caller-allocates' from POD typesPhilip Chimento2021-07-291-2/+2
| | | | | | | | | The (out caller-allocates) and (out callee-allocates) annotations are meant for structured or pointer types. Plain old data types are just regular out parameters and don't need the annotation about who allocates them. See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2005
* tests: Add "signals" test objectwip/carlosg/signal-testsCarlos Garnacho2021-03-031-0/+34
| | | | | | | | It is worth to test marshalling of signal arguments, add a basic (and barebones) object to add signals and emission methods to, so bindings can test the signal handlers. Related: https://gitlab.gnome.org/GNOME/gjs/-/issues/377
* gimarshallingtests: Add more tests for flagsSimon McVittie2020-09-191-0/+6
| | | | | | | | Bindings sometimes need to handle flags and enums separately, so everything that is tested for enums should ideally be tested separately for flags. Signed-off-by: Simon McVittie <smcv@debian.org>
* tests: Add a test-case for a vfunc returning flags in different waysSimon McVittie2020-09-191-0/+17
| | | | | | | We already had a test for enums, but flags are not precisely the same, so testing both can give bindings better coverage. Signed-off-by: Simon McVittie <smcv@debian.org>
* gimarshallingtests: Add marshalling tests for virtual functions with inout ↵Marco Trevisan (Treviño)2020-03-161-0/+38
| | | | | | | | | parameters Virtual functions may use input/output parameters but this is not currently well handled by gjs, so adding test cases to gobject-introspection to verify that virtual functions correctly receive valid input values and can return them.
* gimarshallingtests: Add a marshalling test case for GPtrArrays and GArrays ↵Stéphane Seng2019-07-141-0/+6
| | | | | | | | | | | | | | | of structures Prior to this, the only marshalling test cases available for GPtrArrays were for GPtrArrays of strings. This commit adds a marshalling test case for GPtrArrays of structures, with the same objective than the gi_marshalling_tests_array_zero_terminated_return_struct() test case. This also adds a similar marshalling test case for GArrays of structures, for completeness. This is a follow-up to https://gitlab.gnome.org/GNOME/gjs/issues/9 where a regression has been detected with these types of GPtrArrays.
* gimarshallingtests: Remove declarations of nonexistent functionsPhilip Chimento2019-01-011-8/+0
| | | | | | | These functions were removed a long time ago in commit af7be95a. Being present in the header file means they are present in the generated GIR file, but trying to resolve them with dlsym will fail and crash the program.
* Add marshalling tests for ByteArray property.Tomasz Miąsko2018-04-151-0/+1
| | | | | | Note this is currently supported by neither [PyGObject][0] nor GJS. [0] https://gitlab.gnome.org/GNOME/pygobject/issues/37
* tests: Fix const-ness warningsPhilip Chimento2018-03-311-5/+5
| | | | | Compiling these gives warnings about const or non-const expressions. Fix it by using the correct const-ness of types.
* tests: Add marshalling tests for GValue-valued propertiesPhilip Chimento2017-04-031-0/+1
| | | | | | This is to test GJS's support of GValues boxed inside GValues. https://bugzilla.gnome.org/show_bug.cgi?id=688128
* gimarshallingtests: Add a flags and enum propertyChristoph Reiter2017-03-281-0/+2
| | | | | | | These will be used by pygobject in https://bugzilla.gnome.org/show_bug.cgi?id=726484 https://bugzilla.gnome.org/show_bug.cgi?id=780652
* tests: Test hashtables with allocated valuesPhilip Chimento2016-11-021-0/+13
| | | | | | | In order to test GJS's support for GHashTables with float, double, gint64, and guint64 value types, here are some new GI marshalling tests. https://bugzilla.gnome.org/show_bug.cgi?id=773763
* tests: const specifier for transfer-none out arrayPhilip Chimento2016-10-181-2/+2
| | | | | | | Since we return a static const array as the out value, the function must have a const type for its out parameter. https://bugzilla.gnome.org/show_bug.cgi?id=772790
* tests: Marshalling tests for new GJS functionalityPhilip Chimento2016-10-131-1/+29
| | | | | | | | GJS has gained some support for marshalling arrays of previously unsupported types. These are the marshalling tests that are needed to test that new functionality. https://bugzilla.gnome.org/show_bug.cgi?id=772790
* scanner: allow (array zero-terminated) instead of (array zero-terminated=1)Dieter Verfaillie2015-03-031-1/+1
| | | | | | | | | | | | | | What we already had: - (array zero-terminated=1) > array which is NULL terminated - (array zero-terminated=0) > array which is not NULL terminated - (array) > array which is not NULL terminated - (array zero-terminated=X) > array which is not NULL terminated where X can be anything What this patch adds: - (array zero-terminated) > array which is NULL terminated https://bugzilla.gnome.org/show_bug.cgi?id=657754
* tests/: Decorate Symbols for ExportChun-wei Fan2014-08-151-0/+745
| | | | | | | | | This updates the test headers and sources to decorate the symbols with the macro that can be used to export the symbols, and include config.h first in the c-sources so that the macro can be defined with the compiler directive to export the symbols. https://bugzilla.gnome.org/show_bug.cgi?id=732669
* tests: Add constructor with an error argumentGarrett Regier2014-08-071-0/+1
| | | | | | Make sure a constructor that sets a GError works correctly. https://bugzilla.gnome.org/show_bug.cgi?id=727004
* tests: add implementation of an interfaceLionel Landwerlin2014-04-111-0/+29
| | | | | | | The implementation as a method returning itself as its implemented interface type. https://bugzilla.gnome.org/show_bug.cgi?id=727824
* Add test passing an owned boxed structure to a callbackMike Gorse2014-01-271-0/+10
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=722899
* gimarshalingtests: Add tests for mixed allow-none and implicit argsSimon Feltman2013-09-261-0/+3
| | | | | | | | Add test method with an allow-none in the middle of non allow-none arguments. Add test method with an array and its length argument interleaved with allow-none arguments. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* gimarshalingtests: Add tests for multiple utf8 args with allow-noneSimon Feltman2013-09-261-0/+2
| | | | | | | | Add test function which accepts multiple allow-none utf8 arguments. This can be used for testing a default of NULL for unsupplied arguments annotated with allow-none. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* gimarshallingtests: Add test for GValue pass-by-referenceSimon Feltman2013-07-021-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=701058
* GIMarshallingTests: remove a function that does not existsGiovanni Campagna2013-04-231-1/+0
| | | | | | It's breaking the gjs test suite https://bugzilla.gnome.org/show_bug.cgi?id=698698
* gimarshallingtests: Fix vfunc_return_enum typeSimon Feltman2013-04-041-1/+1
| | | | | | | Change mistaken return type of GIMarshallingTestsFlags to GIMarshallingTestsEnum in vfunc_return_enum. https://bugzilla.gnome.org/show_bug.cgi?id=637832
* gimarshallingtests: Add tests for enum returned from vfuncSimon Feltman2013-03-181-2/+13
| | | | | | | Add vfuncs and methods for an object returning an enum or using one as an output argument. https://bugzilla.gnome.org/show_bug.cgi?id=637832
* gimarshalingtests: fix spelling mistake in new vfunc object helpersSimon Feltman2013-02-061-8/+8
|
* gimarshallingtests: Add test helpers for marshaling of object argumentsSimon Feltman2013-01-301-0/+49
| | | | | | | | | | | | | | Add a number of vfuncs and methods which can be used for testing marshaling of objects with different combinations of ownership transference. An important part of these test vfuncs and methods is they do not pass object returns and arguments through them. Instead the methods return reference counts and floating attributes. This allows isolation and ensures any problem with round trip object marshaling does not obscure what should be tested from the perspective of C as the caller of a vfunc. Tests and vfuncs can then be written in any language with gi bindings. https://bugzilla.gnome.org/show_bug.cgi?id=687522
* tests: Fix compiler warningsMartin Pitt2013-01-151-1/+1
| | | | | Fix (void) function declarations that occur with -Wstrict-prototypes, and the g_param_spec_get_name() which drops the const from its argument.
* gimarshallingtests: Add method taking a GParamSpec argumentMartin Pitt2013-01-141-0/+1
| | | | | | | Add gi_marshalling_tests_param_spec_in_bool(), supplementing the already existing tests for a GParamSpec out argument and return value. https://bugzilla.gnome.org/show_bug.cgi?id=682355
* gimarshallingtests: Add boxed GList propertyMartin Pitt2013-01-141-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=684059
* gimarshallingtests: Add string_ to boxed structureVadim Rutkovsky2013-01-111-2/+3
| | | | | | Co-Authored-By: Martin Pitt <martinpitt@gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=678401
* gimarshallingtests: Add vfunc with an array outputPaolo Borelli2013-01-111-0/+7
| | | | | | Add vfunc_array_out_param to GIMarshallingTestsObjectClass. https://bugzilla.gnome.org/show_bug.cgi?id=690851
* gimarshallingtests: Add test for value array of boxed structsMartin Pitt2012-12-181-0/+1
| | | | | | | | We already have tests for "array of simple structs" (gi_marshalling_tests_array_simple_struct_in) and "array of pointers to boxed structs" (gi_marshalling_tests_array_struct_in), but were missing "array of boxed structs", which reproduces https://bugzilla.gnome.org/show_bug.cgi?id=656312
* gimarshallingtests:: Add test for returning a caller-allocated GArrayGonzalo Odiard2012-12-171-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=690041
* gimarshallingtests: Add a utf8-in-bytearray testColin Walters2012-11-291-0/+4
| | | | Will be used by gjs
* GIMarshallingTests: Add more virtual methods with out argumentsMartin Pitt2012-11-211-0/+23
| | | | | | | Add virtuals method which takes both an (in) and and (out) argument, and variants with both caller and callee allocation. This came up in https://bugzilla.gnome.org/show_bug.cgi?id=688783
* GIMarshallingTests: Add GVariant propertyMartin Pitt2012-11-141-0/+1
|
* gimarshallingtests: Fix return data typeMartin Pitt2012-11-091-1/+1
| | | | | | gi_marshalling_tests_genum_returnv() should (and does) return a GIMarshallingTestsGEnum, not a GIMarshallingTestsEnum. The latter is already covered by gi_marshalling_tests_enum_returnv().
* gimarshallingtests: Add some GBytes testsColin Walters2012-11-071-0/+5
| | | | | | Will be used by gjs for new byte array work. https://bugzilla.gnome.org/show_bug.cgi?id=687696
* gimarshallingtests: Attempt to avoid using reserved wordsColin Walters2012-10-271-66/+66
| | | | | | | | "int8" apparently blows up on AIX. It was kind of lame how we would just ad-hoc append a _. Since we only have one value for a lot of these, let's just go with the couldn't-be-any-simpler "v". https://bugzilla.gnome.org/show_bug.cgi?id=664166
* gmarshallingtests: Fix prototype () -> (void)Colin Walters2012-10-271-1/+1
| | | | Dear Python programmers, () doesn't mean what you think it means in C.
* gimarshallingtests: Add array/GList uint32/64 in/out APIMartin Pitt2012-10-111-0/+4
| | | | | | | | Add in/out API for testing arrays containing uint64, as well as GList containing uint32 (GList and GHash can't contain 64 bit values as they store them in pointers). https://bugzilla.gnome.org/show_bug.cgi?id=685860
* gimarshallingtests: Add in/out int64 GValue method argumentsMartin Pitt2012-09-101-0/+2
| | | | See https://bugzilla.gnome.org/show_bug.cgi?id=683596
* gimarshallingtests: Add GParamSpec return and (out) argumentMathieu Duponchelle2012-08-201-0/+4
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=681565 Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
* GIMarshallingTests: Add method taking array of variantsMikkel Kamstrup Erlandsen2012-07-121-0/+24
| | | | | | | | | | | Add a new interface GIMarshallingTestsInterface3 with a method that takes an array of variants as argument. This can be used for testing the passing of array of variants from C to introspection clients, which is not otherwise covered in the tests for arrays of variants. https://bugzilla.gnome.org/show_bug.cgi?id=667244 Signed-off-by: Martin Pitt <martinpitt@gnome.org>