summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* regress: Check that enum value assignments work for all membersEmmanuele Bassi2018-01-255-1/+16
| | | | | | | Value assignments can happen at any point in the enumeration declaration. https://bugzilla.gnome.org/show_bug.cgi?id=629667
* regress: Test for property and method with conflicting namesRico Tzschichholz2017-07-2114-2/+241
| | | | | | | | | | This is something that libraries are not supposed to do, but some do anyway (Soup and Clutter are two examples) and language bindings should handle it somehow or other. In GJS we want to make sure that the way it's handled doesn't change inadvertently, because buggy library code should not break existing user code. https://bugzilla.gnome.org/show_bug.cgi?id=785091
* Add a test for "(in) (transfer floating)" parameters beeing an alias for ↵Christoph Reiter2017-05-176-5/+37
| | | | | | | | | | | | | | | | | | | | | "(in) (transfer none)". The "(in)" alias was (unintenionally?) introduced in https://git.gnome.org/browse/gobject-introspection/commit/?id=699ad0fec427c79bec1 which added an alias for return annotations. This change makes sure that this continues to work. Functions which ref_sink in params are currently marked as transfer-none since in the case of non-floating objects (which all bindings use) no ownership gets transfered. But in case of floating objects, which is the common case when using the C API directly, the ownership _is_ transfered. Using transfer-floating should make this clearer while giving the same result for bindings. Functions where this could be used: gst_bin_add, gtk_container_add, gst_element_add_pad See https://bugzilla.gnome.org/show_bug.cgi?id=657202 and https://bugzilla.gnome.org/show_bug.cgi?id=702960 https://bugzilla.gnome.org/show_bug.cgi?id=742618
* Revert "removing $(srcdir) because it is not replaced correctly and not ↵Emmanuele Bassi2017-05-045-20/+20
| | | | | | | | necessary" This reverts commit 17ef691e9b3ebd475b01d1e623d3df7b1f534dfa. This breaks builddir != srcdir builds, like GNOME Continuous.
* Revert "build: Use $(srcdir) when calling Python scripts"Emmanuele Bassi2017-05-043-3/+3
| | | | This reverts commit b1200a87bc0bd4f4fcd5275f25422032104138ed.
* build: Use $(srcdir) when calling Python scriptsEmmanuele Bassi2017-05-043-3/+3
| | | | | | We need to point Python in the right direction, because unlike source rules, automake won't automatically expand commands in explicit make rules.
* removing $(srcdir) because it is not replaced correctly and not necessaryKarl-Philipp Richter2017-05-045-20/+20
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744021
* regress: Add test for setting a NULL strv in a GValueSam Spilsbury2017-04-257-0/+121
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=775679
* tests: Add marshalling tests for GValue-valued propertiesPhilip Chimento2017-04-032-0/+22
| | | | | | 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-282-0/+32
| | | | | | | 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: Update "expected" for Regress-1.0.girRico Tzschichholz2017-03-201-1/+1
|
* typedefs: fix type information.Mathieu Duponchelle2017-03-141-2/+0
| | | | | | | | | | | We now reuse _create_type_from_base instead of reimplementing it in a semi-broken way in transformer, and use complete_ctype when writing it out if available. This incidentally allows us to remove a test where the comment acknowledged the non-optimal behaviour. https://bugzilla.gnome.org/show_bug.cgi?id=779959
* tests: Update "expected" for hidden fundamental classRico Tzschichholz2017-01-1711-6/+108
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=760056
* tests: Add a hidden fundamental classLionel Landwerlin2017-01-142-0/+41
| | | | | | | We could have a fundamental type A derived by a subclass B. Class A happens to be introspected, but B isn't. This can cause some issues in Gjs. https://bugzilla.gnome.org/show_bug.cgi?id=760056
* tests: Test hashtables with allocated valuesPhilip Chimento2016-11-022-0/+97
| | | | | | | 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: Remove unused variablePhilip Chimento2016-10-181-1/+0
| | | | | | Left over from code review fix. https://bugzilla.gnome.org/show_bug.cgi?id=772790
* tests: Check against TRUE and FALSE for booleansPhilip Chimento2016-10-181-8/+8
| | | | | | | | For boolean arrays, we want to make sure that we actually got an array of TRUE and FALSE (1 and 0) instead of an array of integers that may have other values besides 1 and 0. https://bugzilla.gnome.org/show_bug.cgi?id=772790
* tests: const specifier for transfer-none out arrayPhilip Chimento2016-10-182-4/+4
| | | | | | | 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-132-1/+157
| | | | | | | | 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
* tests: add regression test for anonymous structScott D Phillips2016-05-0810-0/+226
| | | | | | | C11 which added support for anonymous unions (already supported) also adds support for anonymous structs. https://bugzilla.gnome.org/show_bug.cgi?id=766011
* Replace GNU -B extension with a more portable -I equivalentJasper Lievisse Adriaanse2016-04-261-4/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=765618
* tests: drop an assumption that time_t is same as glongAdam Borowski2016-02-141-2/+0
| | | | | | | | | | | This is false on x32, arm32 on Linux and on 32-bit archs of FreeBSD, OpenBSD. In general we've been moving g-i away from supporting time_t due to various problems - GLib-using apps should use GTimeVal or GDateTime etc. https://bugzilla.gnome.org/show_bug.cgi?id=736109
* tests: Add regression test for signal w. array+lenPhilip Chimento2016-02-0810-5/+141
| | | | | | | | This is a regression test for marshalling callback arguments from signals with an array parameter and separate length parameter into closures in the introspected language. https://bugzilla.gnome.org/show_bug.cgi?id=761659
* tests: Add regression test for out array of structPhilip Chimento2016-02-077-0/+168
| | | | | | | This is a regression test for returning out arrays of structs, like gdk_keymap_get_entries_for_keyval() for example. https://bugzilla.gnome.org/show_bug.cgi?id=761658
* tests: Add more regression tests for (not nullable)Philip Withnall2015-11-0610-0/+344
| | | | | | | | | | | | On bug #719966, the question arose of whether parameters annotated with (element-type) but not (not nullable) are regarded as nullable or non-nullable. Add some new unit tests to Regress-1.0.gir to check the behaviour is as expected: annotating a parameter with (element-type) implicitly makes it non-nullable (unless also annotated with (nullable)). https://bugzilla.gnome.org/show_bug.cgi?id=757678
* tests: Usage a single allocation for test_ghash_gvalue_returnSimon Feltman2015-10-191-22/+26
| | | | | | | | Use a single static allocation for the hash created in regress_test_ghash_gvalue_return(). This function is explicitly marked as returning the hash with transfer-none and doesn't need to re-create the hash each call. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* tests: Free input array in test_array_int_inout()Simon Feltman2015-10-191-0/+2
| | | | | | Transfer is annotated as full so the function should free its input. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* tests: Free input string in regress_test_utf8_inout()Simon Feltman2015-10-191-0/+1
| | | | | | | Transfer is annotated as full so the function should free its input after testing and before output assignment. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* tests: Unref async result after adding to idle callbackSimon Feltman2015-10-191-0/+1
| | | | | | | | g_simple_async_result_complete_in_idle() will add its own reference for managing the async result. We need to unref the result after calling this so we don't leak. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* Add support for function typedefs without pointerBen Iofel2015-10-1910-0/+214
| | | | | | | | | | g-ir-scanner now supports something like this: typedef void my_callback(int); Notice how my_callback is not a pointer. https://bugzilla.gnome.org/show_bug.cgi?id=755645
* maintransformer: Fix regression in callback closure assignmentColin Walters2015-10-102-27/+14
| | | | | | | The nullable code needs to search via index lookup of closure_name, which drops the need to (incorrectly) assign closure_name again. https://bugzilla.gnome.org/show_bug.cgi?id=756352
* build: Add test XML file to buildPhilip Withnall2015-10-051-0/+1
| | | | | | | Fixup to commit 10cb665fee2cc378dd2f13bad16e6384836a8b16. I failed to work git properly when submitting the patch. https://bugzilla.gnome.org/show_bug.cgi?id=729660
* giscanner: Mark gpointer nodes as nullable by defaultPhilip Withnall2015-10-044-16/+122
| | | | | | | | | | | | | gpointer parameters and return types should be marked as nullable by default, unless: • also annotated with (type) and not with (nullable); or • explicitly annotated with (not nullable). This introduces the (not nullable) annotation as a direct opposite to (nullable). In future, (not) could be extended to invert other annotations. https://bugzilla.gnome.org/show_bug.cgi?id=729660
* giscanner: Mark (closure) parameters as (nullable) by conventionPhilip Withnall2015-10-042-20/+100
| | | | | | | | All user_data pointers should be nullable, and they should all be annotated as closures too. I have not found any counter-examples where a closure is non-nullable. https://bugzilla.gnome.org/show_bug.cgi?id=729660
* scanner: Warn and ignore return annotations when there is no return valueGarrett Regier2015-10-042-0/+20
| | | | | | | | Otherwise the .gir can contain invalid data which would likely cause a crash at runtime. https://bugzilla.gnome.org/show_bug.cgi?id=752044 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* scanner: Warn and ignore on incorrect optional/nullable/allow-none annotationsGarrett Regier2015-10-044-0/+47
| | | | | | | These can easily be misunderstood, especially optional. https://bugzilla.gnome.org/show_bug.cgi?id=752065 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* scanner: Fix allow-none on return valuesGarrett Regier2015-09-2910-1/+234
| | | | | | | | The optional annotation was being applied which is invalid for return values. https://bugzilla.gnome.org/show_bug.cgi?id=752029 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* tests: Fix python2/3 difference with respect to rawunicodeescapeColin Walters2015-09-291-1/+1
| | | | | Apparently Python 2 still tries to interpret r"\u" in some circumstances?
* tests/warn: Fix test for previous GVariant floating commitColin Walters2015-09-291-1/+1
|
* giscanner: Use builtins module in Python 3Simon Feltman2015-09-292-4/+12
| | | | | | Add conditional import for Python 3's renamed builtins module. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use unicode literals in all Python filesSimon Feltman2015-09-295-5/+23
| | | | | | | | | | | | Add unicode_literals future import which turns any string literal into a unicode string. Return unicode strings from the Python C extension module. Force writing of annotations (g-ir-annotation-tool) to output utf8 encoded data to stdout. This is an initial pass at following the "unicode sandwich" model of programming (http://nedbatchelder.com/text/unipain.html) needed for supporting Python 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Replace repr format usage with string formatterSimon Feltman2015-09-291-4/+4
| | | | | | | | | | | Replace occurances of "%r" (repr) in format strings where the intended behaviour is to output a quoted string "'foo'" with explicit usage of "'%s'". This is needed to move the codebase to unicode literals in order to upgrade to Python 3. Python 2 unicode strings are expanded with repr formatting prefixed with a "u" as in "u'foo'" which causes failures for various text formatting scenarios. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use print as a function for Python 3 compatibilitySimon Feltman2015-09-296-2/+9
| | | | | | | Use future import "print_function" and update relevant uses of print as a function call. See: PEP 3105 https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Enable "true division" for all Python filesSimon Feltman2015-09-295-0/+5
| | | | | | | | | | Import Python 3 compatible "true division" from the future (PEP 238). This changes the Python 2 classic division which uses floor division on integers to true division. Verfied we don't actually use the division operator anywhere in the code base so this a safety for supporting both Python 2 and 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use absolute_import for all Python filesSimon Feltman2015-09-295-1/+8
| | | | | | Use absolute_import to ensure Python 3 compatibility of the code base. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* tests: Add expected files for previous commitColin Walters2015-09-283-0/+94
|
* scanner: GVariants are also valid to be floatingColin Walters2015-09-284-0/+21
| | | | More followup to https://bugzilla.gnome.org/show_bug.cgi?id=752047
* scanner: Tweak "invalid transfer" warning to show type tooColin Walters2015-09-271-6/+6
| | | | Should help debugging.
* scanner: Warn and ignore on incorrect transfer annotationsColin Walters2015-09-273-6/+30
| | | | This reverts commit 232f3c831260f596e36159112292897962a505b4.
* Revert "scanner: Warn and ignore on incorrect transfer annotations"Michael Catanzaro2015-09-273-30/+6
| | | | | | It broke at least atk and mutter. This reverts commit 5ae7bd58b6266997b61d897ad6562118eeb59210.