summaryrefslogtreecommitdiff
path: root/tests/scanner/regress.h
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Add regress test methods for callbacks taking GError and GHashTableMartin Pitt2012-01-241-0/+14
| | | | | | | This covers both "transfer none" and "transfer full" cases. This is a requisite for writing a pygobject test case for https://bugzilla.gnome.org/show_bug.cgi?id=666270
* tests: Add a long string constant testColin Walters2011-12-201-0/+8
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=662888
* Add regress test method for a (skip) return value without out argumentsMartin Pitt2011-10-211-0/+4
| | | | | This is a requisite for writing a pygobject test case for https://bugzilla.gnome.org/show_bug.cgi?id=662383
* add test for checking refcounting of signals with transfer none object paramsJohn (J5) Palmieri2011-10-141-0/+1
|
* scanner: correctly handle structs with arrays of anon unionsTorsten Schönfeld2011-09-111-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This applies mainly to GValue, which is defined as: struct _GValue { /*< private >*/ GType g_type; /* public for GTypeValueTable methods */ union { gint v_int; guint v_uint; glong v_long; gulong v_ulong; gint64 v_int64; guint64 v_uint64; gfloat v_float; gdouble v_double; gpointer v_pointer; } data[2]; }; Previously, the scanner did not understand the array of unions. This resulted in g_struct_info_get_size returning an incorrect size for GValue (at least on 32bit systems). Fix this by making up a separate union declaration for the GIR that can be referenced by the array. https://bugzilla.gnome.org/show_bug.cgi?id=657040
* add regression test for skipped #defineXavier Claessens2011-08-261-0/+2
|
* Add a regress test for a method returning GPtrArrayXavier Claessens2011-08-261-0/+3
|
* annotationparser: Don't eat lines that look like parameters outside param listColin Walters2011-08-141-0/+1
| | | | | | | | | If we're done parsing parameters, previously we would simply eat lines that looked like @foo: blah blah Example is in gtkcssprovider.c. https://bugzilla.gnome.org/show_bug.cgi?id=656504