aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Write the enum name based on enum module, not the current module being ↵Hugo Lima2010-01-261-2/+10
| | | | generated.
* Fix implicitconv_numerical testsHugo Lima2010-01-221-3/+3
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fix bug on overflow check routines under 32 bits platforms.Hugo Lima2010-01-224-1/+16
|
* Adds support for Duck Punching (aka Monkey Patching).Marcelo Lira2010-01-211-0/+139
| | | | | | | | | | | | | | | | The simplest definition of duck punching for our purposes is the ability to change the definition of a method in an instance of a class. To allow this behaviour the SbkBaseWrapper structure had to be extended with a 'ob_dict' which is a PyObject pointer to the instance dictionary. It is originally set to NULL until the user tries to access it. This dictionary could be accessed through the '__dict__' instance property. For now it is read-only. The generator was updated to handle the instance dictionary, and an extensive duck punching test was also added. Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* Added another constructor to Str class, just to test the new char behaviour.Hugo Lima2010-01-202-0/+7
| | | | | The new behaviour consists in accepting numbers or 1-sized strings when a char is expected.
* Adds test case for overload with static and a non-static versions of a method.Hugo Lima2010-01-194-1/+98
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Bucket::m_locked is accessed by multiple threads and must be volatile,Hugo Lima2010-01-181-1/+1
| | | | | | otherwise the code won't work with some compiler optimizations turned on. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Expanded thread locking tests with two more cases.Marcelo Lira2010-01-184-2/+42
| | | | | Added a virtual method marked to allow threads and tests for C++ calling it and also a Python reimplemented version.
* Adds CppGenerator::writeCppSelfDefinition method.Marcelo Lira2010-01-151-1/+1
| | | | | | | | | | The code to write the definition of cppSelf was in two places and contained an #ifdef clause, now it is a writer method. Also added the ShibokenGenerator::cppSelfVariableName() method to be used instead of directly writing the "cppSelf" string. Updated custom code on test binding to remove warning. Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* Adding new tests related to threads/GIL lockingLauro Neto2010-01-1512-0/+393
| | | | | | | | | | | | | | | - Event loop - calling virtual methods from C++ - Event loop with thread - calling virtuals from C++ along with accessing the binding from another python thread - Thread locking - blocker C++ method that is unlocked from another python thread For these tests, a new ObjectType subclass was added, Bucket, which is just a container for the producer/consumer tests and has the lock/unlock method. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fixing shebang on runtest.shLauro Neto2010-01-151-1/+1
|
* Wrapped virtual methods now locking the GIL in the right places.Marcelo Lira2010-01-151-2/+0
| | | | | | A code injection on the tests was updated. Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* ProtectedVirtualDestructor must be object-type instead of value-type, ↵Hugo Lima2010-01-151-2/+2
| | | | | | because we can't pass a object with nonpublic destructor by value.
* Fix custom converters from libsample.Hugo Lima2010-01-153-5/+10
|
* Changed prefix of local generated C functions to avoid name clash with ↵Hugo Lima2010-01-141-1/+1
| | | | | | bindinded method names. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Removed type discovery tests from blacklist and added "other" binding ↵Hugo Lima2010-01-141-2/+2
| | | | directory to the PYTHONPATH.
* Added tests for the bug related to tp_new vs tp_init problem.Hugo Lima2010-01-111-1/+6
|
* Puts derived and otherderived tests on the black list.Marcelo Lira2009-12-291-1/+1
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Adds "libother" as a new test library.Marcelo Lira2009-12-299-2/+283
| | | | | | | | New test library and corresponding binding were added to check for intermodule problems. The CMake linkage type for the modules had to be changed from MODULE to SHARED. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Adds test for modified function using type system template.Marcelo Lira2009-12-294-0/+73
| | | | | | | | | | The new test adds a "toInt(bool* ok = 0, int base = 10)" method to Str class. The modification uses a type system template function that uses the variable "%2" to reference the "base" argument; in the case when the thing is called without parameters "%2" should be replaced by "10" instead of a converted C++ variable name. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Adds test case for type discovery.Marcelo Lira2009-12-281-0/+5
| | | | | | | C++ returns a new instance of Derived as its ancestor Abstract pointer and the bindings must produce a Python wrapper of Derived type. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Removes unnecessary comments from Complex converter test header.Marcelo Lira2009-12-211-9/+0
|
* New unit test for added function with varargs parameter.Marcelo Lira2009-12-182-0/+12
| | | | Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Tests for numerical implicit conversions and fixesLauro Neto2009-12-164-0/+170
| | | | | | | | | | | | Added a test for simple implicit numerical conversions involving doubles, signed and unsigned ints and longs. Some fixes to the converters were also made, mostly related to adding manual checks for boundaries with doubles for negative values Also put the overflow check in a single template Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
* New test adding a function to the module.Marcelo Lira2009-12-162-0/+14
| | | | Reviewed by Lauro Neto <lauro.neto@openbossa.org>
* Updates virtual method tests.Marcelo Lira2009-12-151-3/+9
|
* Fixed inconsistency on type system variables and added a new one.Marcelo Lira2009-12-081-36/+36
| | | | | | | | | | | | | | | | | | | The %# group of type system variables are meant to be replaced by C++ arguments and %PYARG_# by Python arguments. For some reason %0 is replaced by the Python return variable and %PYARG_0 is considered invalid by the replacement system. Now %PYARG_0 is replaced by the Python return variable and %0 by the C++ version. The %CONVERTTOCPP type system variable was added. Fixed ShibokenGenerator::injectedCodeHasReturnValueAttribution to consider a return value attribution when the user does "%PYARG_0 = ..." instead of "%0 = ...". The changes were documented and all the test bindings inject codes were updated to use the modified variables properly. Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Renamed a lot of Shiboken things with "Py" prefix to use "Sbk" prefix.Marcelo Lira2009-12-081-3/+3
| | | | | | | | | | | | | | To avoid confusion of Python stuff with Shiboken generated stuff. For example: a C++ class called "String" would have the PyString_Type wrapper generated for it, mixing with the proper Python PyString_Type; now the generate code will have things like SbkString_Type, SbkString_New, SbkString_someMethod, and so on. PyBaseWrapper and its variants were renamed to SbkBaseWrapper. PyType<T>() is now SbkType<T>() PyEnumObject was renamed to SbkEnumObject.
* Adds StrList test to check classes that inherit from containers.Marcelo Lira2009-12-078-2/+246
| | | | | | | StrList class inherits from std::list<Str> and expand it with a couple of methods. The added tests perform many different comparisons using other StrList objects, Python sequences of Str objects, and Python sequences of Python strings.
* Moved container converters from test library to libshiboken's converter header.Marcelo Lira2009-12-073-105/+0
| | | | | | | The implementation of converters for pair, list and map containers was moved from libsample test binding to libshiboken/conversions.h. The implementation must be used with types similar to the C++ STL containers of the same name.
* Adds Overflow check to integer types conversions.Marcelo Lira2009-12-073-0/+58
| | | | | | Unit tests were added also. Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Added unit test for Python class inheriting from a C++ class with multiple ↵Marcelo Lira2009-12-051-0/+41
| | | | inheritance.
* Remove multiple_derived from the test blacklist.Hugo Lima2009-12-041-1/+1
|
* Extended implicit conversion test with a case that uses a reference to an ↵Marcelo Lira2009-12-022-2/+10
| | | | | | ObjectType. Reviewed by Lauro Neto <lauro.neto@openbossa.org>
* Expanded protected method tests with cases of reimplemented grand parent and ↵Marcelo Lira2009-12-024-3/+94
| | | | grand grand parent methods.
* Expanded virtual methods tests with a case of reimplementation of a grand ↵Marcelo Lira2009-12-024-4/+61
| | | | parent method.
* Add test black list.Hugo Lima2009-12-021-4/+10
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Removed all undue usage of lambda with assertRaises on unit tests.Marcelo Lira2009-12-018-15/+15
| | | | Reviewed by Lauro Neto <lauro.neto@openbossa.org>
* Do not try to write the C++ version of an argument when the argument type is aHugo Lima2009-12-011-2/+2
| | | | custom type.
* Improved tests for the QLayout-like ObjectTypeLayout.Marcelo Lira2009-12-013-6/+129
| | | | | | | | In the new test case an ObjectType uses a layout that contains another layout, both created in C++, and then get deleted. Custom code was used to achieve the correct parentship handling Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Fixed inverted parentship semantics.Marcelo Lira2009-12-011-4/+7
| | | | | | | The parentship was expressed inverted in the type system and was working because the generator implementation was also screwed. Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Updated ObjectType and ObjectTypeLayout to resemble the Qt's QLayout class.Marcelo Lira2009-12-016-14/+217
| | | | Also added more test cases that use ObjectTypeLayout.
* Added tests for object reparenting.Marcelo Lira2009-12-011-0/+115
|
* Fix some ownership tests.Luciano Wolf2009-12-012-18/+5
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Implement 'child return' examples and support.Luciano Wolf2009-11-304-0/+131
|
* Added tests for something like QLayout.Hugo Lima2009-11-309-1/+191
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Add the generator flag "enable-parent-ctor-heuristic".Hugo Lima2009-11-302-6/+1
| | | | | When enabled, this heuristic will check every constructor for an argument named "parent", if the argument is a pointer, then it'll be the parent of this object.
* Added method to take care of the details of ownership transfer to C++.Marcelo Lira2009-11-302-0/+65
| | | | | | | | | | | | | | | | | | | Simple ownership transference, i.e. without parenting, is now performed by the new BindingManager::transferOwnershipToCpp method. It remove the parent of the transfered object and proceeds transfer or invalidation if needed. The generated code for simple ownership transfer from Python to C++ now reflects this change. Fixed the method BlackBox::keepObjectType that steals an ObjectType ownership to C++ to remove it from its parent also. The BlackBox class does not take care of the stolen object as a proper parent would, but its destructor deletes the object, so the "unparenting" is needed to avoid freeing the same memory twice. Created an unit test that adds children to a parent ObjectType and then steal the children to C++ with BlackBox.keepObjectType. Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Fixed some typos in tests' comments.Marcelo Lira2009-11-302-2/+2
|
* Wrapper invalidation method recursively updates children objects status.Marcelo Lira2009-11-301-3/+12
| | | | | | | | | | | BindingManager::invalidateWrapper checks if the object to be invalidated carries any children objects and recursively invalidates them. Shiboken::destroyParentInfo function was refactored to call the new recursive wrapper invalidator and then call a helper function that only destroy the parent information. The invalidate parent test was updated.