summaryrefslogtreecommitdiff
path: root/tests/scanner/regress.h
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* remove the flat struct array test and replace with object pointer array testJohn (J5) Palmieri2011-08-131-0/+2
|
* scanner: Don't throw away blank lines in the docsColin Walters2011-08-131-0/+2
| | | | | | For generating documentation, we actually want to preserve these. https://bugzilla.gnome.org/show_bug.cgi?id=656389
* Add Regress method for a closure taking and returning a GVariantMartin Pitt2011-08-121-0/+1
|
* Don't use soon-to-be deprecated G_CONST_RETURNColin Walters2011-06-091-5/+5
| | | | See https://bugzilla.gnome.org/show_bug.cgi?id=644611
* Fix accessing structure fields that are arraysGiovanni Campagna2011-06-081-4/+2
| | | | | | | | | | We need to distinguish inline arrays inside structures, and arrays that are pointers and annotations, and we can do it with g_type_info_is_pointer(), setting it to FALSE for fixed size arrays. As a side effect, (array fixed-size=N) on a pointer type has no longer the expected result. https://bugzilla.gnome.org/show_bug.cgi?id=646635
* scanner: Support _get_gtype() as a GType creation suffixColin Walters2011-06-031-1/+2
| | | | | | Based on a patch by Giovanni Campagna <gcampagna@src.gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=646635
* scanner: Parse GNUC expression statementsColin Walters2011-06-021-0/+4
| | | | | | This is needed so we don't fail to parse gatomic.h from GLib. https://bugzilla.gnome.org/show_bug.cgi?id=651548
* Regress: Add GVariant testsColin Walters2011-05-251-0/+5
|
* Add more coverage for recently added (skip) regress additionsDavid Zeuthen2011-05-131-5/+33
| | | | | | | Whilst doing the gjs patch, it turned out this was needed in order to do a robust test suite - we really want to cover all bases here. Signed-off-by: David Zeuthen <davidz@redhat.com>
* Move recently added (skip) tests to the regress moduleDavid Zeuthen2011-05-131-0/+12
| | | | Signed-off-by: David Zeuthen <davidz@redhat.com>
* GScannerParser: recognize character constantsGiovanni Campagna2011-05-121-1/+10
| | | | | | | Some enumerations (like GVariantClass) use characters instead of plain integers, so we need to recognize them. https://bugzilla.gnome.org/show_bug.cgi?id=646635
* giscanner: read (array) and (element-type) annotations for fieldsGiovanni Campagna2011-05-111-0/+22
| | | | | | | This way fields are no longer limited to basic types, and can be supported without accessor methods. https://bugzilla.gnome.org/show_bug.cgi?id=646635
* Add test function regress_test_struct_fixed_array_frobColin Walters2011-05-041-0/+2
|
* g_field_info_get_field: return correct pointer for C arrayMaxim Ermilov2011-05-041-0/+5
| | | | | | Also add a test case. https://bugzilla.gnome.org/show_bug.cgi?id=640468
* Add warnings for the (constructor) annotationTomeu Vizoso2011-02-221-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=641347
* Include cairo.h instead of cairo/cairo.hSimon van der Linden2011-02-111-1/+1
| | | | The cairo/ directory is searched for header files anyway.
* Add (method) overridesTomeu Vizoso2011-02-021-0/+1
| | | | | | So methods such as gtk_drag_dest_set() can be put inside Gtk.Widget https://bugzilla.gnome.org/show_bug.cgi?id=639945
* Add (constructor) annotationTomeu Vizoso2011-01-281-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=561264
* Make caller-allocates detection work for struct aliasesPavel Holejsovsky2011-01-131-0/+9
| | | | | | | | | | | | Scanner tries to detect caller-allocates attribute automatically if not explicitly specified by checking that parameter is not double-referenced and is struct or union. This patch adds resolving of aliases when checking whether parameter is struct or union. Also removes old incorrect method transformer.follow_aliases, which was never used in current code. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=639081
* scanner: support typedefs for container typesJonathan Matthew2010-12-161-0/+18
| | | | | | | | | | | Inside an alias definition, we only need the name of the alias target type. Add a method to GIRWriter to write out a type reference rather than full type definition and use it when writing out an alias. Determine introspectableness of aliases in IntrospectablePass so functions using aliases can be marked not-introspectable if the alias itself is not. https://bugzilla.gnome.org/show_bug.cgi?id=629682
* Support hexadecimal escapes in constantsColin Walters2010-12-021-0/+2
| | | | | | | g_strcompress() only does some of what we need; fork it and add support for \x escapes too. https://bugzilla.gnome.org/show_bug.cgi?id=595773
* scanner: Only mark structures and unions as out-caller-allocatesColin Walters2010-11-191-0/+2
| | | | | | | | These are the only things for which we expect native values to be preserved; for e.g. flags and integers, we expect bindings to convert. The particular rationale for this patch is to avoid flagging flags (sic) as (out caller-allocates).
* Add support for gunichar in typelibColin Walters2010-11-121-0/+1
| | | | | | | Some API such as gtk_text_iter_get_char returns an individual "gunichar"; we should support this. https://bugzilla.gnome.org/show_bug.cgi?id=633197
* Handle enumerations with the full range of signed and unsigned valuesOwen W. Taylor2010-11-011-1/+10
| | | | | | | | | | | | | The C compiler will pick an enumeration type that accomodates the specified values for the enumeration, so ignoring 64-bit enumerations, we can have enumeration values from MININT32 to MAXUINT32. To handle this properly: - Use gint64 for holding eumeration values when scanning - Add a 'unsigned_value' bit to ValueBlob so we can distinguish the int32 vs. uint32 cases in the typelib - Change the return value of g_value_info_get_value() to gint64. https://bugzilla.gnome.org/show_bug.cgi?id=629704
* Remove Regress tests with input args with transfer full or container.Pavel Holejsovsky2010-09-281-11/+0
| | | | | | | Declaring input parameters with transfer other than none is discouraged, so don't do it in the testsuite. https://bugzilla.gnome.org/show_bug.cgi?id=630788
* regress: Remove busted testsColin Walters2010-09-271-2/+0
| | | | | We don't want people making functions which take ownership of arguments, so don't do it in the test suite.
* [scanner] Support private/public directivesJohan Dahlin2010-09-201-0/+18
| | | | Fixes https://bugzilla.gnome.org/show_bug.cgi?id=594125
* scanner: Add c_type for callbacksColin Walters2010-09-141-0/+7
| | | | | | | We weren't doing this consistently, which broke nsname != cprefix cases. https://bugzilla.gnome.org/show_bug.cgi?id=629683
* scanner: Parse annotations for typedefsColin Walters2010-09-141-0/+16
| | | | | | | | * Explicitly check for ast.Alias in annotation pass * Add "generic" attribs handling for aliases like docs, introspectable=0 etc. https://bugzilla.gnome.org/show_bug.cgi?id=629668
* scanner: Skip functions with leading '_'Colin Walters2010-09-091-0/+2
| | | | | Multiple modules have '_' prefixed symbols in "public" headers meaning "don't use this in your app".