summaryrefslogtreecommitdiff
path: root/tests/scanner/Regress-1.0-expected.gir
Commit message (Collapse)AuthorAgeFilesLines
* Add support for element-type to GListModelissue-328Emmanuele Bassi2020-04-281-0/+29
| | | | | | | | | | 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. Fixes: #328
* Revert "Add support for element-type to GListModel"Rico Tzschichholz2020-04-281-31/+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-261-0/+31
| | | | | | | | 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
* 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
* Fix regress scanner testsChun-wei Fan2020-02-061-1/+1
| | | | | | | | | There is no way that non-GCC/CLang compilers will pass this test because the source position will never match the position that is in tests/scanner/Regress-1.0-expected.gir. Fix this the fast way: define a macro according to the compiler check and update the corresponding source position
* Support array arguments with static keywordEmmanuele Bassi2019-09-151-303/+320
| | | | | | | | | | | | | | | | | | | | | | | 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
* tests: Don't include "config.h" in installed filesPhilip Chimento2019-08-151-153/+153
| | | | | | These tests get installed, so config.h may not be available. Do the same thing that gimarshallingtests.c and regress.c already do, and include config.h conditionally.
* regress: Add regression test for signal with GError paramPhilip Chimento2019-08-011-283/+339
| | | | | | | | 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.
* transformer: only include function macros from headers. See #159Christoph Reiter2019-07-221-18/+0
| | | | | We already do the same thing for constants (see _create_const()). Otherwise macros in .c files which aren't namespaced will trigger a warning.
* scanner: parse and expose function macrosMathieu Duponchelle2019-07-191-1/+352
| | | | | This is useful for documentation tools, and other utilities that rely on full introspection of the C API of a given library.
* regress: Check array length before accessingPhilip Chimento2019-04-151-36/+36
|
* tests: Mark unused function arguments with G_GNUC_UNUSEDPhilip Chimento2019-04-151-140/+140
| | | | | | | These files are exported for other projects to compile, so they should compile with as few compiler warnings as possible. If GJS or PyGObject has -Wunused-parameter turned on, then there should not be warnings in these files.
* Revert "Restore original meaning of disguised attribute."Christoph Reiter2019-01-161-3/+9
| | | | | | This reverts commit f606183a010fbec4382acb728882cc0eddbaf7f7. See https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/9#note_409979
* Restore original meaning of disguised attribute.Tomasz Miąsko2019-01-101-9/+3
| | | | | | | | | | | | | | | | > Certain types like GIConv and GdkAtom are pointers internally but don't > look like pointers when referenced. They have the form. > > typedef struct _X *X; > > Parse these as structures/records but mark them in the gir with a 'disguised' > attribute so that we know that they need special handling. Additionally, stop relaying on disguised attribute when deciding whether to render a page. Check number of fields instead, so as to avoid introducing large regression in the docs. Fixes #101.
* tests: Add functions using flat struct arraysTomasz Miąsko2019-01-081-0/+188
| | | | | | | | | | | | | | 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: Remove incorrect c:type generated for array of synthesized unionsTomasz Miąsko2019-01-061-1/+1
| | | | | | | | This also reverts workaround introduced to support this use case in f77cfc4275b1fba4f9fedea6e40b00e0ebbe142c, since it is no longer necessary. Fixes issue #141.
* scanner: Remove incorrect c:type from fields with array typeTomasz Miąsko2019-01-061-13/+9
| | | | | | | | | | Neither `_create_source_type` nor `_create_complete_source_type` actually support fixed size arrays, so previously generated C types were incorrect. Remove C types from array fields instead of producing incorrect ones. Fixes issue #145.
* scanner: Merge specifiers and qualifiers when merging basic types.Tomasz Miąsko2019-01-051-1/+1
|
* scanner: Merge basic types in `specifier_qualifier_list` production.Tomasz Miąsko2019-01-051-185/+188
| | | | | | | | | | | 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`.
* writer: Include documentation and symbol position in source filesThibault Saunier2018-11-281-361/+1523
| | | | | | | | | | | Some documentation tool (as hotdoc[0]) need to have information about symbol declaration and documentation positions in the source files to be able to do smart indexing (automatically build the documenation index). [0] https://hotdoc.github.io/ Fixes #175
* Define grefcount and gatomicrefcount as aliases to gintTomasz Miąsko2018-11-231-0/+8
|
* regress: Implement interface and override propertiesPhilip Chimento2018-11-071-0/+19
| | | | | | | | 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-221-0/+6
| | | | | | | 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/+5
| | | | | It was added as part of !25 but without any implementation. This made instantiating TestObject fail which we do in the pygobject test suite.
* regress: Add test with signal inout parameterPhilip Chimento2018-06-201-0/+30
| | | | | | | This is modeled after GtkEditable::insert-text which isn't marshalled properly in GJS. See gjs#147.
* regress: Add test for interface signalPhilip Chimento2018-06-201-0/+24
| | | | | | | It includes a pointer parameter; for some reason, the pointer parameter breaks g_object_info_find_signal() but a parameter-less signal doesn't. See gjs#147.
* Preserve complete C type when applying array annotations.Tomasz Miąsko2018-06-201-6/+6
|
* Merge branch 'array-to-pointer-adjustment' into 'master'Christoph Reiter2018-06-181-1/+1
|\ | | | | | | | | | | | | Perform array to pointer adjustment in function parameters. Closes #189 See merge request GNOME/gobject-introspection!8
| * Perform array to pointer adjustment in function parameters.Tomasz Miąsko2018-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A declaration of a parameter as "array of type" shall be adjusted to "qualified pointer to type". This change performs this adjustment. For example, this makes parameters of following functions equivalent: ``` void f1(const char s[]); void f2(const char s[10]); void f3(const char *s); ``` Fixes issue #189.
* | Add regression tests for default ByteArray element type.Tomasz Miąsko2018-04-151-0/+8
|/
* Reuse const_table between calls to SourceScanner parse_files and parse_macros.Tomasz Miąsko2018-02-131-0/+5
| | | | | | | | Macro constants may now refer to constants defined in source files. Test case provided by Philip Chimento. Fixes issues #173 and #75.
* Preserve complete_ctype when using type from annotation.Tomasz Miąsko2018-02-091-1/+1
| | | | | | | | When replacing type with one from user annotation we already preserve ctype, do the same for complete_ctype to preserve const / volatile qualifiers if any. Fixes issue #190.
* regress: Check that enum value assignments work for all membersEmmanuele Bassi2018-01-251-0/+5
| | | | | | | 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-211-0/+21
| | | | | | | | | | 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-0/+6
| | | | | | | | | | | | | | | | | | | | | "(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/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=775679
* tests: Update "expected" for Regress-1.0.girRico Tzschichholz2017-03-201-1/+1
|
* tests: Update "expected" for hidden fundamental classRico Tzschichholz2017-01-171-0/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=760056
* tests: add regression test for anonymous structScott D Phillips2016-05-081-0/+22
| | | | | | | 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-081-1/+14
| | | | | | | | 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/+23
| | | | | | | 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-061-0/+38
| | | | | | | | | | | | 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-191-0/+20
| | | | | | | | | | 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-101-23/+12
| | | | | | | 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
* giscanner: Mark gpointer nodes as nullable by defaultPhilip Withnall2015-10-041-10/+21
| | | | | | | | | | | | | 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-041-17/+85
| | | | | | | | 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: Fix allow-none on return valuesGarrett Regier2015-09-291-1/+13
| | | | | | | | 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>
* scanner: GVariants are also valid to be floatingColin Walters2015-09-281-0/+6
| | | | More followup to https://bugzilla.gnome.org/show_bug.cgi?id=752047
* scanner: Warn and ignore on incorrect transfer annotationsColin Walters2015-09-271-1/+1
| | | | This reverts commit 232f3c831260f596e36159112292897962a505b4.