aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
Commit message (Collapse)AuthorAgeFilesLines
...
* Add hash function for Str and proper unit test.Hugo Lima2010-02-232-1/+44
|
* The C++-like enum values are now registered inside the related enums.Marcelo Lira2010-02-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Originally the values of an enum were registered in the scope that enclosed the enum declaration, just like C++ does, now in addition to this the values are registered inside the enum type. To exemplify, the following C++ enum: Scope { enum Foo { Value }; }; can be accessed in Python as this: Scope.Value as well as this: Scope.Foo.Value The enum unit tests were expanded to check for this new behaviour. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Remove warning in injected code related to comparison between signed and ↵Hugo Lima2010-02-221-1/+1
| | | | | | unsigned integer expressions. Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Adds test for C++ 'const char*' argument receiving a Python None as a null ↵Marcelo Lira2010-02-201-0/+49
| | | | | | | pointer. The test function 'countCharacters(const char*)' now returns -1 when receiving a null pointer.
* All enums are now extensible to match the C++ casting behaviour.Marcelo Lira2010-02-201-4/+11
| | | | | | | | | | | | | | | Now the user can build new values of a particular enum type passing an integer to its constructor. Thus, the following C++ code: MyEnum val = (MyEnum) 1; is the equivalent of this Python code: val = MyEnum(1) The enum unit tests were also updated. Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Added more tests for bugs found in overload resolution.Hugo Lima2010-02-192-1/+19
|
* Fixing array deallocation in exampleLauro Neto2010-02-191-1/+1
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Adding test for sequenceToIntArrayLauro Neto2010-02-192-0/+52
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* other binding does not link against sample binding.Hugo Lima2010-02-181-1/+1
|
* User definied converters are written outside Shiboken namespace.Hugo Lima2010-02-185-1/+10
|
* Adds 'reference-count' tag to ObjectView::setModel from test bindings.Marcelo Lira2010-02-101-1/+7
|
* Adds tests for reference counting in model/view style relationships.Marcelo Lira2010-02-104-0/+80
|
* Adds tests for classes with public member variables.Marcelo Lira2010-02-101-0/+122
| | | | | Three kinds of types are represented: primitive, value and object types. The unit tests also check for correct reference counting.
* Implement support to conversion rule.Renato Filho2010-02-092-14/+24
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Adds tests for argument removal and type modification for virtual methods.Marcelo Lira2010-02-092-1/+40
| | | | Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Fixes generation of binding reimplementation of modified virtual methods.Marcelo Lira2010-02-091-0/+3
| | | | | Argument removal and type modification no longer affects the generation of virtual method signatures in the binding code.
* Adds test for argument removal plus argument type modification.Marcelo Lira2010-02-082-0/+24
|
* Fixing sort overloadLauro Neto2010-02-082-0/+21
| | | | | | Now sorting OverloadData recursively Reviewer: Renato Filho <renato.filho@openbossa.org>
* Shiboken::setParent also accepts list of children.Renato Filho2010-02-051-6/+3
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Fix Weakreference supportLauro Neto2010-02-041-2/+14
| | | | | | | - Flag for types with private destructor - Cleaning weakrefs in normal destructor Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Adding support for weakreferenceLauro Neto2010-02-031-0/+49
| | | | Reviewer: Renato Filho <renato.filho@openbossa.org>
* Fix issue triggerd when an code injection on constructor tries to useHugo Lima2010-02-032-1/+50
| | | | | | the object being constructed before it was fully constructed. For this use case, use inject-code with position=end.
* Fix crash when a virtual function with enum in they arguments is called from ↵Hugo Lima2010-02-011-0/+9
| | | | | | C++ and have an implementation in Python.
* Create test for constructors with implicitly conversion and default args.Renato Filho2010-01-291-0/+3
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Add check of conversions errors on constructors.Hugo Lima2010-01-291-1/+5
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Add test for an impossible type discovery when the type has virtual functions.Hugo Lima2010-01-281-0/+42
|
* Adds support for void pointer conversions.Marcelo Lira2010-01-284-0/+54
| | | | | | | | | A new converter specialization was added to deal with 'void*' conversions. In the case of C++ generating a unknown void pointer a BaseWrapper is used to hold the said pointer. There is a new test for this situation. Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Changed API for PySequence_to_argc_argv.Hugo Lima2010-01-281-2/+2
| | | | | | | | | | It was renamed to PySequenceToArgcArgv and a new argument was added, besides some documentation. If the sequence is empty and defaultAppName (the new argument) was provided, argc will be 1 and argv will have a copy of defaultAppName because some libraries, like Qt, need at least one element in argv (the application name), otherwise it'll crash somewhere inside Qt. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Write cptr macro for inner classes.Hugo Lima2010-01-262-0/+2
|
* 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-222-1/+9
|
* 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>
* Adds test case for overload with static and a non-static versions of a method.Hugo Lima2010-01-192-1/+80
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Expanded thread locking tests with two more cases.Marcelo Lira2010-01-182-1/+30
| | | | | 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-157-0/+244
| | | | | | | | | | | | | | | - 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>
* 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-152-4/+9
|
* 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>
* Added tests for the bug related to tp_new vs tp_init problem.Hugo Lima2010-01-111-1/+6
|
* Adds "libother" as a new test library.Marcelo Lira2009-12-291-1/+1
| | | | | | | | 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-292-0/+46
| | | | | | | | | | 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-162-0/+135
| | | | | | | | | | | | 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>