summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* scanner: Correctly handle large 64 bit integer constantsColin Walters2012-11-122-0/+20
| | | | | | | | | | | | | | | | | | | | 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 Conflicts: tests/scanner/Regress-1.0-expected.gir tests/scanner/regress.h
* gimarshallingtests: Fix return data typeMartin Pitt2012-11-092-2/+2
| | | | | | gi_marshalling_tests_genum_returnv() should (and does) return a GIMarshallingTestsGEnum, not a GIMarshallingTestsEnum. The latter is already covered by gi_marshalling_tests_enum_returnv().
* [gobject-introspection] Add test method for GDestroy with no user dataSimon Feltman2012-10-173-0/+36
| | | | | | | Added regress_test_callback_destroy_notify_no_user_data. Updated Regress-1.0-expected.gir https://bugzilla.gnome.org/show_bug.cgi?id=685922
* gimarshallingtests: Add array/GList uint32/64 in/out APIMartin Pitt2012-10-112-0/+68
| | | | | | | | Add in/out API for testing arrays containing uint64, as well as GList containing uint32 (GList and GHash can't contain 64 bit values as they store them in pointers). https://bugzilla.gnome.org/show_bug.cgi?id=685860
* regress: Add API to test signals with (u)int64 paramsNicolas Dufresne2012-09-123-0/+102
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=683596 Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
* gimarshallingtests: Add in/out int64 GValue method argumentsMartin Pitt2012-09-102-0/+30
| | | | See https://bugzilla.gnome.org/show_bug.cgi?id=683596
* Update tests to show off some new featuresJasper St. Pierre2012-08-294-17/+86
| | | | These includes more proper links and fundamentals.
* tests: Don't error out if there is no existing directoryJasper St. Pierre2012-08-291-2/+2
|
* scanner: methods cannot have an out-arg as their first argTorsten Schönfeld2012-08-213-0/+51
| | | | | | | | | | | | 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
* gimarshallingtests: Add GParamSpec return and (out) argumentMathieu Duponchelle2012-08-202-0/+25
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=681565 Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
* build: Ensure cairo-gobject always ends up in cairo.girColin Walters2012-08-141-6/+5
| | | | | | | | | | | We were conditionalizing on the presence of cairo in the buildroot, but that's super lame since it makes a huge mess of the build dependency graph. Let's just always stick cairo-gobject in there. I doubt anyone cares anymore about building g-i on really old systems without it. If they do...well, we can revisit this again.
* Revert "Implement "rename to" annotation for records"Colin Walters2012-08-133-63/+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-052-5/+8
| | | | Previous commit used old-style declarations which was broken.
* Test typedef in #defineAlban Browaeys2012-08-032-0/+11
| | | | requires "handle unsigned properly for type of defined size" patch.
* scanner: handle unsigned properly for type of defined sizeAlban Browaeys2012-08-032-0/+6
|
* giscanner: special case G_GINT64_CONSTANT and G_GUINT64_CONSTANT + miscAlban Browaeys2012-08-032-0/+6
| | | | | | | | | 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
* gimarshallingtests: More useful assertionsMartin Pitt2012-08-021-257/+257
| | | | | | Convert the simple g_assert() statements into g_assert_cmp*, to show what the actual value is in case of a failure. This makes it easier to port g-i/pygobject/etc. to new architectures which exhibit bugs, like powerpc64.
* Regress: Update expected gir for previous changesColin Walters2012-07-311-1/+1
|
* gimarshallingtests: Squash compiler warningColin Walters2012-07-311-2/+2
|
* tests: Fix comment about expected resultJon Nordby2012-07-291-1/+1
|
* Add test for "rename to" annotation for recordsJon Nordby2012-07-273-0/+60
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=675985
* regress: Use G_DEFINE_INTERFACEJasper St. Pierre2012-07-161-14/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679981
* regress: Fix regress_test_versioningJasper St. Pierre2012-07-162-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679981
* GIMarshallingTests: Add method taking array of variantsMikkel Kamstrup Erlandsen2012-07-122-0/+56
| | | | | | | | | | | Add a new interface GIMarshallingTestsInterface3 with a method that takes an array of variants as argument. This can be used for testing the passing of array of variants from C to introspection clients, which is not otherwise covered in the tests for arrays of variants. https://bugzilla.gnome.org/show_bug.cgi?id=667244 Signed-off-by: Martin Pitt <martinpitt@gnome.org>
* Fix GI_MARSHALLING_TESTS_INTERFACE2_GET_IFACE() definitionMartin Pitt2012-07-121-1/+1
| | | | | This used the non-existing G_TYPE_INSTANCE_GET_INTERFACE2 macro, likely a copy&paste error.
* scanner: support stability tagEvan Nemerson2012-07-103-0/+25
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679160
* scanner: Ensure "complete_ctype" patch doesn't throw an exception for ↵Colin Walters2012-07-082-1/+26
| | | | | | | | 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-075-50/+88
| | | | | | | | 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
* Maintransfomer: fix again paring error domains with unregistered enumsGiovanni Campagna2012-07-023-0/+27
| | | | | | | | | Previous fix was wrong, as it called to_underscores_noprefix on a prefixed type name. The actual fix is to call the transformer to do the prefix / type_name split, and turn the latter to underscores. Test case included. https://bugzilla.gnome.org/show_bug.cgi?id=634202
* Add missing SLetter expected girColin Walters2012-07-021-0/+44
|
* tests: Add GSpawnError-alike to SLetterColin Walters2012-07-022-0/+15
| | | | See https://bugzilla.gnome.org/show_bug.cgi?id=637025 for motivation.
* tests: Add SLetterColin Walters2012-07-023-0/+35
| | | | | | | This test case has a single-letter symbol prefix, which triggers edge cases in the difference between prefix handling. See https://bugzilla.gnome.org/show_bug.cgi?id=637025
* scanner: complete the enum-to-error-quark fixGiovanni Campagna2012-06-183-0/+269
| | | | | | | | | | 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 marshalling test for a boxed struct propertyMartin Pitt2012-06-052-1/+19
| | | | | | | Also make the _copy()/_free() methods for GIMarshallingTestsBoxedStruct get along with NULL values. https://bugzilla.gnome.org/show_bug.cgi?id=676603
* tests: Add a refcounting boxedJasper St. Pierre2012-06-013-0/+60
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=677249
* tests: Add vfunc taking a caller-allocated out parameterMartin Pitt2012-06-012-0/+20
| | | | | This reproduces https://bugzilla.gnome.org/show_bug.cgi?id=653151
* tests: Add marshalling test for a caller-allocated out GValue parameterMartin Pitt2012-06-012-0/+12
| | | | | This came up as a side issue in https://bugzilla.gnome.org/show_bug.cgi?id=653151
* scanner: allow for functions that look like constructors but aren'tDan Winship2012-05-263-0/+24
| | | | | | | | | | | | If the scanner found a function with _new in its name, but not prefixed by the name of a known type, it would assume that the function was a constructor, and then complain that it couldn't figure out what it was a constructor for, and mark it introspectable=0. Instead, just assume that the function is not actually a constructor in that case (unless it's explicitly tagged as such). https://bugzilla.gnome.org/show_bug.cgi?id=676815
* tests: Fix a memory leakJasper St. Pierre2012-05-251-1/+4
| | | | | | | We need to unref the cairo surface here, as we are making the context be the sole owner of it. https://bugzilla.gnome.org/show_bug.cgi?id=671687
* tests: Add a foreign struct signal testJasper St. Pierre2012-05-253-0/+45
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=671687
* tests: Fix warningsJasper St. Pierre2012-05-251-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=671687
* girepository: avoid crash when querying nonexistent infoPavel Holejsovsky2012-05-121-0/+11
| | | | | | | | | It appears that cmph library can return (n+1) when querying item not present in its original n-item-sized set. Adjust code so that it detects this condition and do not chase stray pointers resulting from this bogus(?) hash result. https://bugzilla.gnome.org/show_bug.cgi?id=675939
* GIMarshallingTests: Add GStrv propertyMartin Pitt2012-05-052-1/+14
|
* Fix regress_test_closure_variant return valueMartin Pitt2012-05-052-2/+4
| | | | | | | | | | | We need to g_variant_ref() the return type: the closure delivers it wrapped in a GValue, and the subsequent g_value_unset() unrefs it to zero otherwise. This was uncovered by the now working TestClosures.test_variant() test case in PyGObject. Also allow passing NULL as argument, to be able to test these code paths as well.
* Fix GVariant handling in regress_test_closure_variantMartin Pitt2012-05-022-5/+3
| | | | | | | | | | | 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).
* g-ir-doc-tool: Update expected fileRico Tzschichholz2012-04-261-5/+5
| | | | Should have signal arguments in the right order
* tests: Add flags and enum to GValue GHash in/outMartin Pitt2012-04-241-0/+18
| | | | | | | Add a flag and enum check to the GHashes returned/expected by regress_test_ghash_gvalue_{return,in}(). https://bugzilla.gnome.org/show_bug.cgi?id=637466
* tests: Add array marshalling test for array without length argumentBastian Winkler2012-04-202-0/+16
| | | | | | | | | | | A test case with an array in-argument that is neither zero terminated, nor fixed length, nor blessed with a length argument. This is, for example, the case in clutter_texture_set_from_rgb_data() https://bugzilla.gnome.org/show_bug.cgi?id=674271 Signed-off-by: Martin Pitt <martinpitt@gnome.org>
* tests: Add GType property TestObj:gtypeBastian Winkler2012-04-193-1/+30
| | | | | | | | 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>
* annotationparser: add test for comment lines not starting with ' * 'Dieter Verfaillie2012-04-171-0/+14
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=673806