summaryrefslogtreecommitdiff
path: root/tests/testhelpermodule.c
Commit message (Collapse)AuthorAgeFilesLines
* gi/pygi-value: Don't wrap GValue in GValue when creating GValueArrayStian Selnes2018-05-041-0/+38
| | | | | | | | | | | | | | | | | | | | If a GValueArray is created from a list of GValues, it should not wrap these GValues in a second layer of GValues before appending to the array. The end result should be a GValueArray of GValues, not a GValueArray of GValues holding another GValue (unless the user explicitly creates such a value). With this patch the behavior is now consistent when creating a GValueArray and appending GValues directly, and creating a GValueArray within a GValue based on a list of GValues. For instance, to create a GValueArray of G_TYPE_UINT the user must create GValues manually and create a GValueArray from these. The result should be a GValueArray of GValues that hold G_TYPE_UINT, not a GValueArray that contain GValues that hold a GValue that holds G_TYPE_UINT. See !66
* Add tests for pyg_gil_state_ensure/pyg_gil_state_releaseChristoph Reiter2018-04-241-0/+10
|
* Add tests for pyg_constant_strip_prefix()Christoph Reiter2018-04-241-0/+14
|
* pyg_pyobj_to_unichar_conv: port to new converters and add some testsChristoph Reiter2018-04-121-0/+15
| | | | | This allows us to get rid of the deprecated Py_UNICODE API and the deprecation warnings with Python 3.7.
* build: use -Wconversion -Wno-sign-conversion. Fixes #191Christoph Reiter2018-04-051-2/+2
| | | | | | | | | | In some cases changing the type used was enough, in some others I just force casted things as too many changes would be required and overflow unlikely (for array marshalling the cache uses gssize while the marshalling code uses garray and thus guint) My hope is that having this enabled will improve things gradually with future cleanups.
* Rename pyglib-python-compat.h to pygi-python-compat.hChristoph Reiter2018-03-231-1/+1
| | | | There is no pyglib anymore
* tests: add a basic test for pyg_parse_constructor_args()Christoph Reiter2018-03-191-0/+23
|
* Remove pyglib_gil_state_ensure/pyglib_gil_state_releaseChristoph Reiter2017-03-221-6/+6
| | | | | | Use PyGILState_Ensure/PyGILState_Release instead. https://bugzilla.gnome.org/show_bug.cgi?id=699440
* testhelper: propagate exception if _gobject could not be importedMikhail Fludkov2017-03-201-2/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=772949
* Ignore GValueArray deprecationsSimon Feltman2014-03-241-0/+3
| | | | | | | | Wrap calls to GValueArray related calls with G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS. Although GValueArray is deprecated, we still need to support the marshaling of them in PyGObject. The deprecations add noise to the build processes in which new warnings could be lost. Essentially losing the element of surprise a new warning should have on maintainers.
* testhelper: Fix import requirement for GObjectSimon Feltman2013-07-061-1/+1
| | | | | | | | | | | | | Replace the importing of gi._gobject._gobject with gi.repository.GObject in tests/testhelpermodule.c The testhelper module was only importing the static bindings (gi._gobject._gobject) and not the overrides (gi.repository.GObject). This was causing some tests to fail when test_thread was the first test to run in the suite due to it registering new types based on PyGObject_Type. https://bugzilla.gnome.org/show_bug.cgi?id=703647
* testhelpermodule: Fix build warning for PyGObject_Type redefinitionSimon Feltman2013-03-171-13/+1
| | | | | Remove dynamic retrieval of PyGObject_Type as it is available in pygobject.h since commit 2656bc47 (causing this compile warning)
* Support GParamSpec signal arguments from PythonMartin Pitt2013-01-141-0/+13
| | | | | | | | | In pyg_value_from_pyobject(), recognize both the real GI GObject.ParamSpec type as well as the statically wrapped _gobject.GParamSpec type. This fixes marshalling GObject.ParamSpec signal/vfunc arguments. https://bugzilla.gnome.org/show_bug.cgi?id=683099
* testhelpermodule.c: Do not unref called methodMartin Pitt2012-12-181-1/+0
| | | | | | In _wrap_test_gerror_exception(), do not unref the method arguments. This causes a crash when being run with the stricter refcounting/memory checks with debug-enabled Python builds.
* Add support for overriding GObject.ObjectSimon Feltman2012-11-071-1/+1
| | | | | | | | | | | Shift pygi module mechanics so the introspection generated 'Object' class becomes derived from the static GObject class. Add initial GObject.Object override which sets all static methods back essentially leapfrogging the introspection methods. This sets the stage for having the ability to remove static methods piecemeal in favor of introspection/python in future commits. https://bugzilla.gnome.org/show_bug.cgi?id=672727
* testhelpermodule.c: Drop obsolete g_thread_init()Martin Pitt2012-11-051-1/+0
| | | | | | We already require a new enough glib version as we dropped g_thread_init() in the main code a long time ago. But for formality's sake, bump glib requirement to >= 2.32.
* tests: Fix wrong return type in test_int64_callback()Martin Pitt2012-09-251-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=684700
* Add test cases for GValue signal argumentsMartin Pitt2012-09-111-0/+17
| | | | | | | | These cover various types, (u)int(64) and string. Keep the test case for implicit int64 GValues disabled, as this currently does not work and it is not clear whether it should: https://bugzilla.gnome.org/show_bug.cgi?id=683775
* Add test for GValue signal return valuesMartin Pitt2012-09-111-0/+36
| | | | | | Another attempt to reproduce the reported error in https://bugzilla.gnome.org/show_bug.cgi?id=683596 but this works already.
* Test gint64 C signal arguments and return valuesMartin Pitt2012-09-101-0/+14
|
* Add test for a signal that returns a GParamSpecMartin Pitt2012-09-031-0/+12
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=683265
* Add missing static declarationsMartin Pitt2012-07-271-2/+2
| | | | | | This fixes a lot of -Wmissing-prototype warnings. Also remove _pygi_marshal_cleanup_closure_unref() which is not used anywhere.
* Drop support for old constructor style.Steve Frécinaux2011-08-261-5/+0
| | | | | | | | Bindings don't write their own constructors anymore, and the old style has been deprecated for ages, so let's just drop them now and make pygobject simpler. https://bugzilla.gnome.org/show_bug.cgi?id=657413
* Drop support for sink functions.Steve Frécinaux2011-08-261-23/+9
| | | | | | | Sink functions were meant to deal with floating references in a custom way. They are not useful anymore with the dynamic bindings. https://bugzilla.gnome.org/show_bug.cgi?id=642233
* refactor tests to only use PyGObject 3 syntaxJohn (J5) Palmieri2011-08-111-1/+1
| | | | | | | | | | | * for PyGObject 3 we want to discourage the use of legacy interfaces * Using interfaces like from gi.repository import GObject makes sure that the internal _gobject module is loaded and not PyGObject 2's gobject module which would cause the application to not work correctly https://bugzilla.gnome.org/show_bug.cgi?id=642048
* [gi] return PYGLIB_MODULE_ERROR_RETURN on error and use pygobject_initIgnacio Casal Quinteiro2011-02-021-3/+3
|
* Fix reference leaks for GInitiallyUnowned objectsSteve Frécinaux2011-01-201-0/+50
| | | | | | | | References were leaked for GInitiallyUnowned objects which got their wrappers created several times, because someone else holds reference on it and it got out of python scope at some point. https://bugzilla.gnome.org/show_bug.cgi?id=639949
* Add tests for refcount of a GObject owned by a librarySteve Frécinaux2011-01-201-0/+51
| | | | | | | | When the object is constructed, its refcount is 2 because the library refs it once. It should remain around until we ask the library to release its reference. https://bugzilla.gnome.org/show_bug.cgi?id=639949
* fix up testshelper module so it compiles in python 3.xJohn (J5) Palmieri2010-08-251-194/+27
| | | | | | | | | * include the compat header * fix up PyInts to be PYGLIB_Long * Use PYGLIB_DEFINE_TYPE macros to define module objects * Use PYGLIB_MODULE_START/END to define modules https://bugzilla.gnome.org/show_bug.cgi?id=615872
* Don't use == to compare doubles, use <= and =>.Simon van der Linden2010-07-261-1/+1
| | | | | | This avoids inequality due to small precisions difference. https://bugzilla.gnome.org/show_bug.cgi?id=625326
* Fall back to use the floating references API in glib if there isn't a ↵Tomeu Vizoso2010-06-211-0/+109
| | | | | | | | | | | sinkfunc defined. * tests/*: Add ref counting tests for floating objects * gobject/gobjectmodule.c, gobject/pygobject.c: Fall back to g_object_ref_sink or g_object_ref if there isn't a sinkfunc defined. Make sure that pygobject_sink gets called only once per GObject instance. https://bugzilla.gnome.org/show_bug.cgi?id=583909
* Bug 351072 – Cannot handle signals with parameter type G_TYPE_VALUE ↵Gustavo J. A. M. Carneiro2007-07-071-0/+19
| | | | | | (marshal/unmarshal for GValue-wrapped GValue) svn path=/trunk/; revision=680
* reviewed by: Johan DahlinSebastian Granjoux2007-07-021-0/+27
| | | | | | | | | | | | | | | 2007-07-02 Sebastian Granjoux <seb.sfo@free.fr> reviewed by: Johan Dahlin * gobject/gobjectmodule.c: (pyg_gerror_exception_check): * tests/test_gtype.py: * tests/testhelpermodule.c: (_wrap_test_gerror_exception): Fix a bug in pyg_error_exception_check, add a test, Fixes #449879 svn path=/trunk/; revision=678
* fix GSlice thread init warningGustavo J. A. M. Carneiro2007-04-301-1/+1
| | | | svn path=/trunk/; revision=660
* Treat None in a GValueArray as pointer/NULL, patch by Ed Catmur, fixesJohan Dahlin2007-04-301-0/+19
| | | | | | | | | | | | | | 2007-04-29 Johan Dahlin <johan@gnome.org> * gobject/pygtype.c: (pyg_value_array_from_pyobject): * tests/test_gtype.py: * tests/testhelpermodule.c: (_wrap_test_value_array): Treat None in a GValueArray as pointer/NULL, patch by Ed Catmur, fixes #352209. svn path=/trunk/; revision=656
* Add a generic CClosure marshaller based on ffi. This makes it possible toJohan Dahlin2007-04-291-9/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | 2007-04-29 Johan Dahlin <jdahlin@async.com.br> * README: * configure.ac: * gobject/Makefile.am: * gobject/ffi-marshaller.c: (g_value_to_ffi_type), (g_value_from_ffi_type), (g_cclosure_marshal_generic_ffi): * gobject/ffi-marshaller.h: * gobject/gobjectmodule.c: (create_signal), (init_gobject): * pygobject-2.0.pc.in: * tests/test_signal.py: * tests/testhelpermodule.c: (test1_callback), (test1_callback_swapped), (test2_callback), (test3_callback), (test4_callback), (test_float_callback), (test_double_callback), (test_string_callback), (test_object_callback), (connectcallbacks), (_wrap_connectcallbacks), (inittesthelper): Add a generic CClosure marshaller based on ffi. This makes it possible to connect to signals on PyGObjects from C. libffi is now an optional dependency Fixes #353816 (Edward Hervey) svn path=/trunk/; revision=651
* Add Interface implementation testJohan Dahlin2006-07-101-1/+235
|
* Split out PyGObject from PyGTK.Johan Dahlin2006-01-091-3/+3
|
* Clean up tests, we don't need a C binding to access tp_basicsize, clean upJohan Dahlin2005-07-251-71/+24
| | | | | | | | * tests/test_subtype.py: * tests/testhelpermodule.c: (test_type_get_type), (_wrap_get_unknown), (_wrap_test_g_object_new), (inittesthelper): Clean up tests, we don't need a C binding to access tp_basicsize, clean up the C tests, quite a bit aswell.
* Bug 161177: Allow creation of python classes from g_object_newGustavo J. A. M. Carneiro2005-07-091-0/+75
|
* Make the build of atk, pango and gtk conditional. Fixes bug #74144.PYGTK_2_5_2Johan Dahlin2005-01-101-1/+0
| | | | | | | | | | | | * .cvsignore: * Makefile.am: * configure.in: * gtk/Makefile.am: * pygtk-2.0.pc.in: * setup.py: * tests/common.py: * tests/testhelpermodule.c: Make the build of atk, pango and gtk conditional. Fixes bug #74144.
* Add tests for dynamic/unknown objects and interfacesJohan Dahlin2004-11-041-113/+66
|
* Apply slighly modified fix from bug 149845PYGTK_2_3_97Johan Dahlin2004-09-281-1/+1
| | | | | | This is make threading usable for both users of the threading module and users that requires interaction with threads from other extension modules.
* Add thread stuff, that emits stuff from another thread and does some enumJohan Dahlin2004-09-271-6/+134
| | | | | | * tests/testhelpermodule.c: * tests/test_thread.py: Add thread stuff, that emits stuff from another thread and does some enum magic.
* Small c module to help testingJohan Dahlin2004-09-271-0/+23
* tests/testhelper.c: Small c module to help testing * tests/test_subtype.py: tests for this, use testhelper here aswell