summaryrefslogtreecommitdiff
path: root/tests/scanner/regress.h
Commit message (Collapse)AuthorAgeFilesLines
* regress: Add test for setting a NULL strv in a GValueSam Spilsbury2017-04-251-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=775679
* tests: Add a hidden fundamental classLionel Landwerlin2017-01-141-0/+4
| | | | | | | 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: add regression test for anonymous structScott D Phillips2016-05-081-0/+13
| | | | | | | 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-0/+3
| | | | | | | | 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/+3
| | | | | | | 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/+7
| | | | | | | | | | | | 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/+4
| | | | | | | | | | 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-291-0/+7
| | | | | | | | 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/+3
| | | | More followup to https://bugzilla.gnome.org/show_bug.cgi?id=752047
* regress: Add a test for (nullable)Colin Walters2015-09-031-0/+2
| | | | Related to: https://bugzilla.gnome.org/719966
* test: Add a test for GList containing GType.Christoph Reiter2015-07-051-0/+3
| | | | | | See https://bugzilla.gnome.org/show_bug.cgi?id=749696 https://bugzilla.gnome.org/show_bug.cgi?id=751978
* tests: Add regression test for (transfer full) returning callbacksDebarshi Ray2015-06-181-0/+8
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=750286
* tests: Change names with case-only distinctionPhilip Chimento2014-10-011-2/+2
| | | | | | | | | | | | | | | | | | RegressIntSet and RegressIntset, aliases of one another, were causing two documentation pages to be built by the documentation tests that were named identically except for letter case. On OSX and Windows, the most common filesystems are case-insensitive, and those two files can't exist in the same directory on case- insensitive filesystems. That caused the tests to fail. It also caused problems when checking out the repository, because the expected documentation set also contains those files. This commit fixes the symptom (so that JHbuild will stop erroring out on this module) but not the problem of generating a documentation set for two identifiers which differ (perfectly legally) only by case. https://bugzilla.gnome.org/show_bug.cgi?id=725264
* tests/scanner: Decorate Symbols for ExportChun-wei Fan2014-08-151-0/+419
| | | | | | | | | | 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. Update the CFLAGS as well so that the header that defines the export decoration macro can be found. https://bugzilla.gnome.org/show_bug.cgi?id=732669
* tests: Add regression test for callbacks with an inout arrayGarrett Regier2014-08-071-0/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=702508
* Parse and expose ownership transfer for instance parametersGiovanni Campagna2014-07-031-0/+1
| | | | | | | | | | | 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
* tests: Fix function pointer prototype in regress.hSimon Feltman2014-03-031-1/+1
| | | | | This was causing a "warning: function declaration isn't a prototype" with strict-prototypes enabled.
* g-ir-compiler: Add support for callback fields on GObjectsSimon Feltman2014-02-271-0/+3
| | | | | | | | | | | | | | | | | 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
* maintransformer: don't pair methods if the symbol prefix does not match with ↵Giovanni Campagna2014-02-261-0/+3
| | | | | | | | | | | a final underscore In cases like g_resources_register() and gdk_events_get_angle(), the c_symbol_prefix of the first parameter (resp. g_resource and gdk_event) is a prefix of the symbol, but the next character is not _, so that should not be considered a method. For backward compatibility reasons, we still generate one, but then it's not included in the documentation (because of moved_to)
* scanner: support virtual functions with a typedef-ed callbackGiovanni Campagna2014-02-201-0/+4
| | | | | | | | | | The field of a callback need not be anonymous, it could be a typedef, with a proper Type node. Fixes TelepathyGlib.BaseClient having no virtual functions (and probably others) https://bugzilla.gnome.org/show_bug.cgi?id=723439
* scanner: Support boolean constantsFlorian Müllner2013-11-291-0/+1
| | | | | | | | Aliasing TRUE or FALSE is not very common, but done occasionally for extra clarity. Namely G_SOURCE_REMOVE / G_SOURCE_CONTINUE are self-explanatory, unlike the "raw" booleans. https://bugzilla.gnome.org/show_bug.cgi?id=719566
* scanner: Don't barf on anonymous unionsColin Walters2013-10-301-0/+12
| | | | | | | | I'd like to be able to use this inside GTK+. See: https://bugzilla.gnome.org/show_bug.cgi?id=711153 https://bugzilla.gnome.org/show_bug.cgi?id=711157
* giscanner: Respect __GI_SCANNER__ when scanning for macrosStef Walter2013-10-211-0/+12
| | | | | | | | | When scanning for macros respect ifdefs of __GI_SCANNER__ in the various header files. Only #ifdef and #ifndef are supported. If __GI_SCANNER__ appears in plain #if statements, a warning is printed. https://bugzilla.gnome.org/show_bug.cgi?id=698367
* Revert addition of __int128 testsColin Walters2013-05-071-5/+0
| | | | | | | | It's not available on 32 bit architectures, which is a pain for our testing because we can't easily make Regress architecture independent. This reverts commit ca93f8474c9f6ca184d0b5806a4e459ad3dcd132.
* scanner: Parse __int128 and friends as "int"Colin Walters2013-05-071-0/+7
| | | | | | | | | This is a hack, but all we really want to do is ignore them for now. See https://mail.gnome.org/archives/gtk-devel-list/2013-May/msg00013.html https://bugzilla.gnome.org/show_bug.cgi?id=699722
* tests: Add a struct with fixed-size gcharColin Walters2013-04-191-0/+7
| | | | See https://bugzilla.redhat.com/920595
* sourcescanner: Fix symbolic references in enum membersJasper St. Pierre2013-02-161-0/+10
| | | | | | | We need to copy the source symbols, otherwise we'll overwrite their values. This isn't good. https://bugzilla.gnome.org/show_bug.cgi?id=693939
* Clean up cairo handling somewhatColin Walters2013-01-071-1/+5
| | | | | | | | | | | | I'm building on RHEL6 which doesn't have cairo-gobject. Now, we tried to support this in that 'make' would succeed, but 'make check' would blow up. This patch allows more of 'make check' to succeed - I just need to figure out how to make the diff against the -expected.gir work. What's more important though, is this will allow gjs to also #define _GI_DISABLE_CAIRO.
* Add more tests for boxed typesGiovanni Campagna2012-11-201-0/+10
| | | | | | | gjs needs a boxed type that cannot be trivially allocated but has also a complex constructor. https://bugzilla.gnome.org/show_bug.cgi?id=612033
* scanner: Correctly handle large 64 bit integer constantsColin Walters2012-10-301-0/+5
| | | | | | | | | | | | | | | | In C, positive integer constants are by default unsigned. This means an expression like 0x8000000000000000 will be "unsigned long long". In the actual scanner code, we were parsing them as "gint64", and storing them as gint64. This was incorrect; we need to parse them as guint64, and store the bits we get from that. This gives us an equivalent result to what the C compiler does. However, when we actually return the value as a Python "long" (arbitrary length integer), we need to treat the value as unsigned if the result indicated it was. https://bugzilla.gnome.org/show_bug.cgi?id=685022
* Add documentation for enumeration membersGiovanni Campagna2012-10-281-0/+7
| | | | | | | | Enum members were Annotated in the AST, and most code already assumed they could have docs. What was missing was reading the docs from the comment blocks and writing them in the XML. https://bugzilla.gnome.org/show_bug.cgi?id=683046
* regress: Add a test case for skipping a function with an unannotated callbackColin Walters2012-10-271-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=685399
* scanner: Ignore #defines starting with _Colin Walters2012-10-271-1/+5
| | | | | | | | | This matches our behavior for symbols (and we should probably fix this more globally...I think we still scan _-prefixed enums). Noticed from gudev which had #define _GUDEV_INSIDE_H 1 https://bugzilla.gnome.org/show_bug.cgi?id=674072
* [gobject-introspection] Add test method for GDestroy with no user dataSimon Feltman2012-10-111-0/+2
| | | | | | | Added regress_test_callback_destroy_notify_no_user_data. Updated Regress-1.0-expected.gir https://bugzilla.gnome.org/show_bug.cgi?id=685922
* regress: Add API to test signals with (u)int64 paramsNicolas Dufresne2012-09-121-0/+2
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=683596 Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
* scanner: methods cannot have an out-arg as their first argTorsten Schönfeld2012-08-211-0/+1
| | | | | | | | | | | | This ensures that if the first argument of a function like gboolean gdk_rgba_parse (GdkRGBA *rgba, const gchar *spec); is annotated as being an out-arg, the result is a class function with two arguments, not a method with one argument. Previously, the (out) annotation was simply ignored. https://bugzilla.gnome.org/show_bug.cgi?id=682124
* Revert "Implement "rename to" annotation for records"Colin Walters2012-08-131-17/+0
| | | | | | | | | | | | | This reverts commit 764366f7e4ef5a765a24ffac8c60b811f38b9ad9. It can't work right now because to really use the structures, you need to register them as a boxed, and that means we also need to rename the boxed type. A future version of this patch will need to handle both the structure name and the GType name. https://bugzilla.gnome.org/show_bug.cgi?id=675985
* tests: Fix coding style and compiler warning in regressColin Walters2012-08-051-2/+2
| | | | Previous commit used old-style declarations which was broken.
* Test typedef in #defineAlban Browaeys2012-08-031-0/+3
| | | | requires "handle unsigned properly for type of defined size" patch.
* scanner: handle unsigned properly for type of defined sizeAlban Browaeys2012-08-031-0/+1
|
* giscanner: special case G_GINT64_CONSTANT and G_GUINT64_CONSTANT + miscAlban Browaeys2012-08-031-0/+1
| | | | | | | | | This let the macro expands to its value as gint64/guint64. Also - fix lexer identifier/typdef detection for macro and misc - do not discard cast
* tests: Fix comment about expected resultJon Nordby2012-07-291-1/+1
|
* Add test for "rename to" annotation for recordsJon Nordby2012-07-271-0/+17
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=675985
* regress: Fix regress_test_versioningJasper St. Pierre2012-07-161-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679981
* scanner: support stability tagEvan Nemerson2012-07-101-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679160
* scanner: Ensure "complete_ctype" patch doesn't throw an exception for ↵Colin Walters2012-07-081-0/+11
| | | | | | | | anonymous unions The previous patch introduced a regression where we would crash on encountering an anonymous union. Work around this by just writing out 'gpointer' in this case, and add a regression test.
* giscanner: Write detailed information in "type" tag's "c:type" attribute.Krzesimir Nowak2012-07-071-0/+14
| | | | | | | | That is - write also type qualifiers (const and volatile here). Update existing tests and add a new struct to regress.h having members with type qualifiers. https://bugzilla.gnome.org/show_bug.cgi?id=656445
* scanner: complete the enum-to-error-quark fixGiovanni Campagna2012-06-181-0/+62
| | | | | | | | | | Turns out that the problem was not only in the wrong matching to GType enums, but also that the non-GType heuristics used to_underscores instead of to_underscores_noprefix, turning DBusError into D_Bus_Error instead of DBus_Error. Complete with various tests. https://bugzilla.gnome.org/show_bug.cgi?id=669350
* tests: Add a refcounting boxedJasper St. Pierre2012-06-011-0/+11
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=677249
* tests: Add a foreign struct signal testJasper St. Pierre2012-05-251-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=671687