summaryrefslogtreecommitdiff
path: root/tests/scanner/Regress-1.0-Python-expected
Commit message (Collapse)AuthorAgeFilesLines
* Revert "scanner: don't accept invalid symbols in binary expressions"Emmanuele Bassi2023-01-081-0/+14
| | | | This reverts commit b37f24b7e27a77c398f41cc331608aff806f0d42.
* test: Add regression test for the new tagsEmmanuele Bassi2023-01-081-1/+1
|
* scanner: don't accept invalid symbols in binary expressionsLubomir Rintel2023-01-081-14/+0
| | | | | | | | | | | | | | | | | | | | | The rules for binary expressions were entirely oblivious to the type of the operand symbols and assumed they're integer constants. This is very unfortunate, since it caused all sort of nonsense to end up getting accepted. One such example is the following define from NetworkManager's libnm: #define NM_SETTING_PARAM_SECRET (1 << (2 + G_PARAM_USER_SHIFT)) As G_PARAM_USER_SHIFT is unknown, it was parsed as an invalid symbol. The addition didn't care, treated it as: #define NM_SETTING_PARAM_SECRET (1 << (2 + 0)) Let's just ensure we get CSYMBOL_TYPE_CONST only when both operands actually have const_int_set. Otherwise just create CSYMBOL_TYPE_INVALID. That will cause the symbol to be dropped on the floor eventually, but that's probably much better than a having an invalid value.
* tests/scanner: add some tests for #definesLubomir Rintel2023-01-082-0/+28
| | | | | | | | Add one expanding to an expression we can't get a constant value from and another one for which we can. Note that the bad on one currently does evaluate, and it does so to a bad value. A separate commit with a diff to test suite will address that.
* Revert "scanner: Mark colliding properties as not introspectable"Emmanuele Bassi2022-02-131-0/+18
| | | | | | | | | This reverts commit 8e85d1ca937c166f07675d02fc84abb27d06ae11. Marking colliding properties as not introspectable breaks a bunch of existing API when compiling the GIR into the typelib, so we'll have to find another solution during the grace period.
* scanner: Mark colliding properties as not introspectableEmmanuele Bassi2022-02-121-18/+0
| | | | | We prefer methods, signals, and virtual methods to properties, in case of a collision.
* regress: Add Fundamental type with no set/get-value-func'sMarco Trevisan (Treviño)2022-01-115-0/+206
| | | | | | | | | | A fundamental type may or may not provide set and get value functions, the regress implementations always provide one, so define a new type with no such functions so that we can test this case in Gjs. To avoid repeating lots of duplicated code, we re-use the same functions of RegressTestFundamentalObject when possible, by using the same structure.
* tests: Check new property accessors annotationsEmmanuele Bassi2021-08-052-0/+86
| | | | Add an accessors pair to Regress.TestObj and annotate them.
* Merge branch 'standalone-doc-sections' into 'master'Mathieu Duponchelle2020-07-221-0/+15
|\ | | | | | | | | Add the notion of standalone doc sections. See merge request GNOME/gobject-introspection!226
| * Add the notion of standalone doc sections.Mathieu Duponchelle2020-07-121-0/+15
| | | | | | | | | | | | | | | | Up to now, section annotations had to match a class or interface name in order to be serialized in the gir. With this commit, they now get serialized as docsection nodes, for potential use by documentation tools.
* | giscanner: parse block comments for members and fieldsMathieu Duponchelle2020-07-122-0/+18
|/ | | | | | | | | | | | | | | | | | | | | | | | | | There was previously no mechanism for tagging enum members and struct fields with Since tags (or other, eg deprecation tags). While the customary place to add Since tags for these symbols is inline in the parent symbol's documentation eg: /** * Foo: * * @FOO_BAR: some bar. Since X.Y */ And variations on that theme, implementing parsing for that scheme would result in a pretty ambiguous grammar, especially if we also want support for multiple tags. Instead, the solution implemented here is to allow providing documentation for individual members and fields through their own separate block, as is done for virtual functions already. Inline comments are still used, with a lower precedence. Fixes #348
* Revert "Add support for element-type to GListModel"Rico Tzschichholz2020-04-282-64/+0
| | | | | | Breaks vapigen and changes GListModel definition in Gio-2.0.gir This reverts commit a9f45431684e6be3623e272e54d481e4c5d9423d.
* Add support for element-type to GListModelEmmanuele Bassi2020-04-262-0/+64
| | | | | | | | GListModel is an interface for creating typed, list-like containers. The data stored is GObject instances, but it's useful to be able to annotate the actual type, for both documentation and code generation purposes. The annotation should be optional, to maintain backward compatibility.
* Revert "Add element-type support to GListModel"Emmanuele Bassi2020-04-261-32/+0
| | | | | | This reverts commit b4c058bba4d95ae10e1e4238f9417fe954f97795. See: #336
* Revert "Generate appropriate docs for ListModel with element-type"Emmanuele Bassi2020-04-261-2/+2
| | | | | | This reverts commit ffe3e435e0b7943a0872034223b5f6ea02258ffa. See: #336
* Generate appropriate docs for ListModel with element-typeEmmanuele Bassi2020-04-241-2/+2
| | | | | | We need to special case the ListModel container type in the documentation writer so that we don't fall back into array/list automatic conversion in the code snippets.
* Add element-type support to GListModelEmmanuele Bassi2020-04-241-0/+32
| | | | | | | | GListModel is an interface for creating typed, list-like containers. The data stored is GObject instances, but it's useful to be able to annotate the actual type, for both documentation and code generation purposes. Fixes: #328
* Support array arguments with static keywordEmmanuele Bassi2019-09-151-0/+37
| | | | | | | | | | | | | | | | | | | | | | | C99 allows defining an array argument with a fixed size as: void foo (int arr[static 10]) Compilers conforming to the C99 specification will be able to warn if the function is called with NULL or with an array smaller than the specified length, something that does not happen when using pre-C99 declarations like: void foo (int arr[10]) As the declaration above is identical to: void foo (int arr[]) Which is, in turn, identical to: void foo (int *arr) Fixes: #309
* regress: Add regression test for signal with GError paramPhilip Chimento2019-08-013-0/+114
| | | | | | | | This exercises the little-used code path where a signal is emitted with a nullable GError as a parameter. It's modeled after GstPbutils.Discoverer's 'discovered' signal. See GNOME/gjs#262.
* tests: Add functions using flat struct arraysTomasz Miąsko2019-01-087-0/+269
| | | | | | | | | | | | | | Relatively common in practice are: * output with transfer full, which is already covered by `regress_test_array_struct_out`, * input with transfer none, covered by a new `regress_test_array_struct_in_none` Other variants are quite esoteric, but it still might be useful to include them so that bindings can verify that they are handled gracefully, e.g., by reporting an error instead of crashing. Issue #90
* scanner: Merge basic types in `specifier_qualifier_list` production.Tomasz Miąsko2019-01-051-0/+14
| | | | | | | | | | | This is necessary to parse types like `unsigned char` or `long double`, and is already done when parsing `declarations_specifiers`. Examples that are fixed by this change include: * `GLib.TestLogMsg.nums` previously parsed as `long` but should be `long double`. * `GMime.Encoding.uubuf` previously parsed as `unsigned` but should be `unsigned char`.
* Define grefcount and gatomicrefcount as aliases to gintTomasz Miąsko2018-11-233-0/+68
|
* regress: Implement interface and override propertiesPhilip Chimento2018-11-073-3/+21
| | | | | | | | This adds a property to RegressTestInterface which can be overridden, and makes RegressTestSubObj implement it and override the property. This is in order to catch the regressions in GJS around property access. See gjs#193.
* regress: Add test for write-only propertyPhilip Chimento2018-10-222-1/+17
| | | | | | | GTK contains a few write-only properties, so it makes sense to have one in the regress test suite. See gjs!246
* regress: implement the getter/setter for the new byte-array property.Christoph Reiter2018-08-111-0/+14
| | | | | It was added as part of !25 but without any implementation. This made instantiating TestObject fail which we do in the pygobject test suite.
* Fix scanner tests for new functions added with !32Christoph Reiter2018-07-224-0/+147
| | | | These tests only get run with autotools atm
* Add regression tests for default ByteArray element type.Tomasz Miąsko2018-04-152-1/+19
|
* Reuse const_table between calls to SourceScanner parse_files and parse_macros.Tomasz Miąsko2018-02-131-0/+14
| | | | | | | | Macro constants may now refer to constants defined in source files. Test case provided by Philip Chimento. Fixes issues #173 and #75.
* regress: Check that enum value assignments work for all membersEmmanuele Bassi2018-01-251-0/+4
| | | | | | | 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-214-1/+70
| | | | | | | | | | 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-171-1/+10
| | | | | | | | | | | | | | | | | | | | | "(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
* regress: Add test for setting a NULL strv in a GValueSam Spilsbury2017-04-251-0/+32
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=775679
* tests: Update "expected" for hidden fundamental classRico Tzschichholz2017-01-173-2/+34
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=760056
* tests: add regression test for anonymous structScott D Phillips2016-05-083-0/+68
| | | | | | | C11 which added support for anonymous unions (already supported) also adds support for anonymous structs. https://bugzilla.gnome.org/show_bug.cgi?id=766011
* tests: Add regression test for signal w. array+lenPhilip Chimento2016-02-082-1/+40
| | | | | | | | 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-071-0/+45
| | | | | | | 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-062-0/+98
| | | | | | | | | | | | 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
* Add support for function typedefs without pointerBen Iofel2015-10-192-0/+58
| | | | | | | | | | 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
* scanner: Fix allow-none on return valuesGarrett Regier2015-09-292-0/+64
| | | | | | | | 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: Add expected files for previous commitColin Walters2015-09-281-0/+32
|
* regress: Add a test for (nullable)Colin Walters2015-09-031-0/+37
| | | | Related to: https://bugzilla.gnome.org/719966
* test: Add a test for GList containing GType.Christoph Reiter2015-07-051-0/+37
| | | | | | See https://bugzilla.gnome.org/show_bug.cgi?id=749696 https://bugzilla.gnome.org/show_bug.cgi?id=751978
* tests: fix make distcheckDieter Verfaillie2015-06-202-0/+62
| | | | | Add missing doc-tool tests, fixes "make distcheck" breakage introduced by 09daa28c5b4625b6f274b3b340bc85e33bef80b5
* scanner: Honor nested types on array declarations as wellColin Walters2014-09-052-1/+19
| | | | | | | | | We have special code to look at (type GLib.List(utf8)), but (type GLib.PtrArray(utf8)) didn't work. This allows NetworkManager to annotate the ActiveConnections property. https://bugzilla.gnome.org/show_bug.cgi?id=733879
* tests: Add regression test for callbacks with an inout arrayGarrett Regier2014-08-072-0/+71
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=702508
* Parse and expose ownership transfer for instance parametersGiovanni Campagna2014-07-031-0/+37
| | | | | | | | | | | Knowing the ownership transfer for instance parameters is necessary for correct memory management of functions which "eat" their instance argument, such as g_dbus_method_invocation_return_*. Parse this information from the gir file and store in the typelib, and then provide new API on GICallableInfo to retrieve this. https://bugzilla.gnome.org/show_bug.cgi?id=729662
* doctool: update testsGiovanni Campagna2014-03-055-10/+77
|
* tests: Add missing regress documentation test pageSimon Feltman2014-03-021-0/+14
| | | | | | Add missing page needed for tests to run after commit 7027bb256 https://bugzilla.gnome.org/show_bug.cgi?id=725198
* g-ir-compiler: Add support for callback fields on GObjectsSimon Feltman2014-02-271-0/+21
| | | | | | | | | | | | | | | | | Use ParseState enum instead of a boolean for the ParseContexts embedded_type flag. This allows specific tracking of the embedded type currently being parsed which can now either be STATE_STRUCT_FIELD or STATE_CLASS_FIELD (or allow for future expansion). Add ParseState::STATE_NONE as the default for this field. Fix GObject FieldBlob validation to take into account the sizeof CallbackBlobs (copied from the struct validator). Add static g_object_info_get_field_offset which parallels g_struct_info_get_field_offset which is needed since callback fields may vary in size. https://bugzilla.gnome.org/show_bug.cgi?id=725198
* doctool: update testsGiovanni Campagna2014-02-2633-68/+185
|