summaryrefslogtreecommitdiff
path: root/tests/repository
Commit message (Collapse)AuthorAgeFilesLines
* Reformat code to GNU styleMartin Pitt2013-02-271-216/+218
| | | | | This was achieved by running "indent -gnu -i2 -nut -l120" over C files which use a different style, and manually fixing pointer declarations and modelines.
* Add test case for signal with a C array and length argumentMartin Pitt2013-02-271-0/+43
| | | | By-product of https://bugzilla.gnome.org/show_bug.cgi?id=662241.
* girepository: gchar is a signed typeMartin Pitt2013-01-111-0/+55
| | | | | | | gchar is signed, not unsigned. Add "guchar" alias as unsigned for completeness (but usually it appears as guint8). https://bugzilla.gnome.org/show_bug.cgi?id=691524
* tests: work around make check warningDieter Verfaillie2012-10-311-2/+5
| | | | | | | | | | The tests in tests/repository/ depend on libregress.so from tests/scanner which cannot be loaded during make check. Fixing this properly would require migrating to non-recursive automake for the tests, but for now we can just work around and set LD_LIBRARY_PATH (for linux) and PATH (for win32). http://bugzilla.gnome.org/show_bug.cgi?id=675049
* Drop calls to g_type_init()Colin Walters2012-10-163-6/+0
| | | | And bump our GLib requirement.
* 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
* Avoid _get_func() consuming reference from input infoPavel Holejsovsky2012-04-071-0/+13
| | | | | | | | | | | | Fix of leak in 4c9424e18d71237f438a99bc5f2d45ae7de60b78 was a bit overaggressive, stealing also one reference from input 'info' argument. Also fixes another bug in that commit - local 'func' shadowing the return value, causing that function always returned NULL even when some result was actually found. https://bugzilla.gnome.org/show_bug.cgi?id=673282
* Revert "gitypelibtest: Remove test on TestStructE size"Colin Walters2011-10-031-0/+13
| | | | | | | | This reverts commit e17c09749c23edbd928db19a8162484ddb6299b8. We actually want the test for sizeof(GValue). https://bugzilla.gnome.org/show_bug.cgi?id=660338
* gitypelibtest: Remove test on TestStructE sizeColin Walters2011-09-301-27/+0
| | | | | | | It's redundant since we're already checking that it's equal to GValue, and a problem is that padding may break exact assertions on the size. https://bugzilla.gnome.org/show_bug.cgi?id=660338
* Bug 660338: Account for padding in struct size checkMartin Pitt2011-09-291-3/+4
| | | | | | | On some platform like armel or powerpc the compiler adds extra padding to structs. Make the test_size_of_struct_with_array_of_anon_unions() check more liberal by only requiring that the size of the struct is at least as big as expected. Also use g_assert_cmpuint() to make it easier to see the actual diff.
* repository: Fix g_irepository_get_c_prefix()Colin Walters2011-09-211-0/+5
| | | | | | It was returning the wrong data. https://bugzilla.gnome.org/show_bug.cgi?id=659749
* tests: Add gir/ to toplevel typelib pathColin Walters2011-09-131-1/+1
| | | | Fixes the test when running uninstalled.
* Fix g_type_info_is_pointer() for overriden types of arguments.Pavel Holejsovsky2011-09-121-0/+39
| | | | | | | | | Algorithm which detects whether argument type is pointer checks for trailing '*' characters in c:type .gir elements. This failed if ctype is either 'gpointer' or 'gconstpointer'. Add specific check for gpointer/gconstpointer types when deducing pointerness of the type. https://bugzilla.gnome.org/show_bug.cgi?id=658848
* scanner: correctly handle structs with arrays of anon unionsTorsten Schönfeld2011-09-112-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* scanner: Add "notify" signal to GObjectColin Walters2011-09-091-0/+9
| | | | | For gjs we want to switch to using introspection data for signals, and the "notify" signal being missing from GObject was a problem.
* tests: build tests only on make checkAlexandre Rostovtsev2011-08-231-1/+1
| | | | | | | | | | | | Use automake's check_ prefix and avoid putting anything nontrivial in BUILT_SOURCES so that tests are build only on make check. The dummy -rpath in AM_LDFLAGS in tests/scanner/Makefile.am is needed to force libtool to build shared libraries for check_LTLIBRARIESS targets (automake builds check_LTLIBRARIES as static by default); see http://lists.gnu.org/archive/html/automake/2005-10/msg00107.html https://bugzilla.gnome.org/show_bug.cgi?id=657066
* Allow enums and bitfields to have static methodsTorsten Schönfeld2011-08-161-2/+55
| | | | | | | | | | | | | This uses the same backcompat machinery that was introduced for static methods for non-class types, so this change does not break users of the existing presentations. New libgirepository API: g_enum_info_get_n_methods g_enum_info_get_method https://bugzilla.gnome.org/show_bug.cgi?id=656499
* Add g_irepository_find_by_error_domain()Dan Winship2011-08-121-0/+9
| | | | | | | | Add a method to look up a GIEnumInfo given its associated error quark. Based on a patch from Colin Walters. https://bugzilla.gnome.org/show_bug.cgi?id=602516
* Add "c:identifier" attribute to GIrNodeValue (for flags and enum values).GOBJECT_INTROSPECTION_0_10_3Laszlo Pandy2011-02-232-3/+77
| | | | | | | | | | | | | | | Flags and enums with a GType have a value_nick and value_name strings available in the class struct. But for flags and enums without GType, we need to get this information from introspection. g_base_info_get_name() gives the string for value_nick. In the GIR, the attribute "c:identifier" is the string neede for value_name. This patch adds the "c:identifier" from GIR to the typelib for all flags and enum values. It can be retireved using g_base_info_get_attribute(info, "c:identifier"). https://bugzilla.gnome.org/show_bug.cgi?id=642757
* Fix tests to look in correct directory for typelibsColin Walters2010-11-163-11/+1
| | | | With nonrecursive they're in $(top_builddir) now
* tests: Print an error messageColin Walters2010-11-161-2/+2
|
* Add g_object_info_find_signalColin Walters2010-11-121-0/+7
| | | | | | | This matches g_object_info_find_method, and allows us to add indexing later. https://bugzilla.gnome.org/show_bug.cgi?id=633204
* Switch to nonrecursive make for core (i.e. not tests/)Colin Walters2010-11-091-3/+3
| | | | | This is cleaner and faster, and prepares us better for an incoming import of CMPH.
* [GIRepository] Rename GTypelib to GITypelibJohan Dahlin2010-08-312-2/+2
| | | | | Keep a typedef for backwards compatibility, until the major bindings has moved over.
* [GIRepository] Rename GArgument to GIArgumentJohan Dahlin2010-08-311-2/+2
| | | | | Keep a typedef for backwards compatibility, until the major bindings has moved over.
* Bug 557383 - Virtual method supportColin Walters2009-03-052-2/+50
| | | | | | | | | | | | | | | | Broadly speaking, this change adds the concept of <vfunc> to the .gir. The typelib already had most of the infrastructure for virtual functions, though there is one API addition. The scanner assumes that any class callback slot that doesn't match a signal name is a virtual. In the .gir, we write out *both* the <method> wrapper and a <vfunc>. If we can determine an association between them (based on the names matching, or a new Virtual: annotation), then we notate that in the .gir. The typelib gains an association from the vfunc to the function, if it exists. This will be useful for bindings since they already know how to consume FunctionInfo.
* Bug 572434 - Associate interfaces with their C structuresColin Walters2009-02-251-0/+3
| | | | | | | | Similar to GObject class structs, we pair up GInterfaces with their C structures. Also, move some GLib-specific things into glibast.py, and make the naming more generic.
* Bug 555960 - Nested structs and unions (generation portion)Colin Walters2009-02-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch from Andreas Rottmann <a.rottmann@gmx.at>. * tests/scanner/utility.h (UtilityTaggedValue): Make the union member anonymous. (UtilityByte): New union typedef with an unnamed struct in it. * giscanner/transformer.py (Transformer._create_struct): Create unnamed structs for symbols with a None ident. (Transformer._create_union): Likewise. * giscanner/girwriter.py (GIRWriter._write_record): Allow name being None. (GIRWriter._write_union): Likewise. * girepository/girparser.c (start_struct): Allow a NULL name for non-toplevel structs. (start_union): Likewise. * tests/scanner/utility.h (UtilityTaggedValue): New struct typedef, which has a nested union member. * tests/scanner/utility-expected.gir: Adapted. * giscanner/transformer.py (Transformer._create_member): Create struct/union members if appropriate. (Transformer._create_struct, Transformer._create_union): Allow for structs/unions without a C type. * giscanner/glibtransformer.py (GLibTransformer._resolve_field): We don't need to resolve non-typef'd (GLibTransformer._resolve_field): Add cases for non-typedef'd struct/union "fields". * giscanner/girwriter.py (GIRWriter._write_record): Allow for records without a C type. (GIRWriter._write_field): structs and unions may appear in places where fields do. svn path=/trunk/; revision=1082
* Bug 567813 – Everything should be versionedJohan Dahlin2009-01-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 2009-01-15 Johan Dahlin <jdahlin@async.com.br> Bug 567813 – Everything should be versioned * gir/Makefile.am: * girepository/Makefile.am: * girepository/girepository.c (init_globals): * girepository/girparser.c (locate_gir): * giscanner/dumper.py: * giscanner/transformer.py: * gobject-introspection-1.0.pc.in: * tests/everything/Makefile.am: * tests/invoke/Makefile.am: * tests/offsets/Makefile.am: * tests/repository/Makefile.am: * tests/scanner/Makefile.am: * tools/Makefile.am: svn path=/trunk/; revision=1046
* Make it compilable with -Werror on my system by adding a couple ofJohan Dahlin2008-11-231-0/+3
| | | | | | | | | | 2008-11-23 Johan Dahlin <jdahlin@async.com.br> Make it compilable with -Werror on my system by adding a couple of prototypes and including headers. svn path=/trunk/; revision=960
* List in-tree libraries first in LDADD / LIBADDTommi Komulainen2008-10-311-2/+2
| | | | | | | | | | | | | 2008-10-31 Tommi Komulainen <tommi.komulainen@iki.fi> * giscanner/Makefile.am: * tests/invoke/Makefile.am: * tests/repository/Makefile.am: List in-tree libraries first in LDADD / LIBADD. If installed library is listed first, the resulting binary will prefer installed version to one in .libs, possibly making 'make check' behave strangely. svn path=/trunk/; revision=849
* g_irepository_require() returns GTypelib now, fix warningTommi Komulainen2008-10-271-2/+2
| | | | svn path=/trunk/; revision=817
* Bug 557791 – g_irepository_require() could return a GTypelib *Colin Walters2008-10-251-1/+1
| | | | svn path=/trunk/; revision=816
* Bug 557241 – "throws" flag for functionsJohan Bilien2008-10-212-3/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-21 Johan Bilien <jobi@via.ecp.fr> Bug 557241 – "throws" flag for functions * tests/scanner/drawable-1.0-expected.gir, tests/scanner/drawable-injected-1.0-expected.gir, tests/scanner/drawable.[ch]: add simple test for throwing function (has GError ** as last argument) * giscanner/ast.py: add a 'throws' flag to Function * giscanner/glibtransformer.py: if a function's last paramerter is a GError, set the 'throws' flag and remove that parameter * giscanner/girwriter.py: write out the 'throws' attribute * giscanner/girparser.py: support parsing the 'throws' attribute * tests/repository/gitestthrows.c: add a simple test to check the throws flag in a typelib and invoke the function * girepository/ginfo.c, girepository/girnode.[ch], girepository/girnode.h, girepository/girparser.c, girepository/girepository.h: Add and parse the GI_FUNCTION_THROWS flag * girepository/ginvoke.c: if a function throws, add a GError as last arguments, and propagate the error to the invoker. svn path=/trunk/; revision=773
* Bug 556185 - [test for] segfault on g_callable_info_get_return_typeColin Walters2008-10-162-1/+30
| | | | svn path=/trunk/; revision=737
* Prepend search path for $(top_builddir)/gir dirColin Walters2008-10-142-3/+10
| | | | svn path=/trunk/; revision=705
* Repository tests requires installed Gio - punt on this for nowColin Walters2008-10-141-1/+2
| | | | svn path=/trunk/; revision=704
* run 'gitestrepo' in 'make check' instantiate 'GCancellable' to ensure theTommi Komulainen2008-10-122-1/+6
| | | | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * tests/repository/Makefile.am: run 'gitestrepo' in 'make check' * tests/repository/gitestrepo.c (main): instantiate 'GCancellable' to ensure the GType is registered before using g_type_from_name() svn path=/trunk/; revision=699
* Add tests/repository which has some repository regression testsColin Walters2008-10-122-0/+41
svn path=/trunk/; revision=683