summaryrefslogtreecommitdiff
path: root/tests/scanner/regress.h
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix GVariant handling in regress_test_closure_variantMartin Pitt2012-05-021-1/+1
| | | | | | | | | | | Commit 7c4fbbd6 introduced some low-level g_memdup()ing of the passed GVariant in regress_test_closure_variant(). This causes a race condition with GI clients like pygobject's test suite, which sometimes fail with (runtests.py:15653): GLib-CRITICAL **: g_variant_ref_sink: assertion `value->ref_count > 0' failed Drop the memduping again, and instead make the argument non-const (which is true, as the method temporarily increases the refcount).
* tests: Add GType property TestObj:gtypeBastian Winkler2012-04-191-0/+1
| | | | | | | | Needed for https://bugzilla.gnome.org/show_bug.cgi?id=674351 https://bugzilla.gnome.org/show_bug.cgi?id=674366 Signed-off-by: Martin Pitt <martinpitt@gnome.org>
* Revert "annotationparser: indent _parse_comment_block gtkdoc code"Dieter Verfaillie2012-04-171-8/+0
| | | | | | | | | This reverts commit f41525d54f53edd9b0d665397f7c6c755ee3616b and adds a more complete solution as the original commit only handled empty lines between the GTK-Doc comment block start token "/**" and the identifier. https://bugzilla.gnome.org/show_bug.cgi?id=673806
* annotationparser: indent _parse_comment_block gtkdoc codeAlban Browaeys2012-04-171-0/+8
| | | | | | | | | | | | | | | | | | | | The current logic in _parse_comment_block of the annotationparser check the identifier and use variables that only makes sense if a result was returned (column_offset, original_line). This patch indent the logic so it is only triggered if a result is found. Otherwise it returns None as expected by call chain "parse > parse_comment_block > _parse_comment_block": ie in "parse": comment_block = self.parse_comment_block(comment) if comment_block is not None: This still raises a lot of warnings but does not abort while generating gir for libgnomekbd, mutter or telepathy-glib (those thus have to be tweaked not to call g-ir-scanner with --warn-error at least until the parser mask those false positives or the doc from those projects is fixed to comply with the behaviour expected by giscanner). https://bugzilla.gnome.org/show_bug.cgi?id=673806
* Split parameter and tag storage in annotationparser parse treeDieter Verfaillie2012-04-051-0/+3
| | | | | | | | | | | This avoids tags overwriting parameters if they happen to share the same name. For example, this was triggered by valid code in libgnome-keyring. tests/scanner/regress.c and tests/scanner/regress.h test written by Colin Walters <walters@verbum.org>. https://bugzilla.gnome.org/show_bug.cgi?id=672254
* Fix malformed GTK-Doc comment blocks:Dieter Verfaillie2012-04-051-1/+1
| | | | | | | | | | | | | | | | | - add missing colons - invalid annotations - invalid parameters and tags - correct parameter name - preserve description indentation - no description parts - comment end marker - invalid empty lines - line numbers AnnotationParser now emits warnings which are considered as errors by "make check" so fix those warnings... https://bugzilla.gnome.org/show_bug.cgi?id=672254
* Add regression tests for GHashTable holding GValueAlberto Mardegan2012-03-271-0/+2
| | | | | | | | | | Add a couple of functions which can be used to test marshalling/demarshalling of GHashTables having GValue as keys. This is related to a python-gobject bug: https://bugzilla.gnome.org/show_bug.cgi?id=668903 Signed-off-by: Martin Pitt <martinpitt@gnome.org>
* Add test for a GPtrArray return with transfer fullMartin Pitt2012-02-161-0/+1
| | | | | This complements the already existing regress_test_garray_container_return() test.
* scanner: Allow adding annotations to vfuncs directlyJasper St. Pierre2012-02-091-0/+6
| | | | | | Some vfuncs may not have public invokers. In these cases, annotations may still be needed to correctly implement or chain up to a virtual method from a subclass's implementation.
* Add tests for array arguments in callbacksGiovanni Campagna2012-02-061-0/+9
| | | | | | Add a test that accepts a callback receiving array arguments https://bugzilla.gnome.org/show_bug.cgi?id=654406
* Add regress_test_null_gerror_callbackPaolo Borelli2012-02-061-0/+1
| | | | | | | It models the case where a callback that return a gerror succeds and set the error to NULL. https://bugzilla.gnome.org/show_bug.cgi?id=669415
* tests: Add another simple boxed type with a complex constructorJasper St. Pierre2012-02-031-0/+12
|