aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
Commit message (Collapse)AuthorAgeFilesLines
* Remove rejection lines that cause the sample_list test to failJohn Cummings2014-04-171-6/+0
| | | | | | | | | | | These functions (except createComplexList) are are needed by the test. Prior to 5b39f7fd9e21, the rejections were not being recognized; removing them returns the wrappings to their previous state and allows the test to pass again. Change-Id: I3efb08383b2d59f9917a4e4a0200e0516db9c83e Reviewed-by: Matthew Woehlke <mw_triad@users.sourceforge.net> Reviewed-by: John Ehresman <jpe@wingware.com>
* Fix function rejections (i.e. support overloads)Matthew Woehlke2014-04-161-0/+5
| | | | | | | | | | | | | | | | | | | | | Add an additional check to AbstractMetaBuilder::traverseFunction to also perform a quick-and-dirty construction of the function signature, and to check that against the rejections. Add a unit test for matching full signatures. Before, we were only testing the function name; as a result, a rejection like 'foo()' would never match (because the name does not have ()'s). This is especially helpful for rejecting specific overloads of functions while allowing others to be wrapped normally. (The unit test shows a not-so-far-fetched example why one might want to do this.) The signature building logic isn't very sophisticated and likely requires a very exacting match to the signature as it appears in the wrapped sources, but that's likely not a serious issue, and at any rate this is much better than not being able to match overloads at all. Change-Id: Ic686377477aacf54f79c7bd2013e9aea8521a4ea Reviewed-by: John Ehresman <jpe@wingware.com>
* Fix for containers with 'const' valuesMatthew Woehlke2014-01-073-0/+6
| | | | | | | | | Fix omission of 'const' specifier when generating binding code for containers whose value type is 'const', which would lead to binding code that does not compile due to 'const' mismatch. Includes test case. Change-Id: Iff99a16ee071bb255f78e86e2456e5206cc00cfb Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Don't warn when inheriting from containerMatthew Woehlke2013-10-091-2/+0
| | | | | | | | | | Change AbstractMetaBuilder::setupInheritance to not warn about classes that inherit from known container types, even if the container type does not have a corresponding wrapper class (which in many or most cases it won't). Remove now-unneeded suppression for the same in 'sample'. Change-Id: I0a45636791eba36cf070ea082eb6ead6cb5947ef Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Refactor and improve added function resolvingMatthew Woehlke2013-09-262-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | Add a public function to create an AddedFunction::TypeInfo from a signature string. Change translateType to use this to do full recursive resolution on template arguments. Create a new helper function to do more intelligent parsing of template type name signatures, and use this in translateType. Taken together, this means that we now recognize both multiple arguments to template types of added functions, as well as template arguments that are themselves template types. We couldn't do this before due to the use of a regular expression to attempt to separate the template type name from its arguments. The test cases are updated to test these new features. Note, however, that it is now a fatal error if the template argument type cannot be determined. (Before we would just drop it and treat the type as a non-container.) However, 1) this should not be happening in a well formed type system, and 2) it's questionable if things wouldn't have fallen apart anyway from treating the presumed container as something else. Change-Id: I23c3a7f7e311e046642d951d6ad2236571fda6b8 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Write inititializations in topological orderMatthew Woehlke2013-09-242-0/+2
| | | | | | | | | | | | | | | | | | Add methods to various places in the hierarchy so that the generator can access the topologically ordered class list (in addition to the unordered class list). Modify CppGenerator::finishGeneration to use this. This fixes a failure to correctly create Python wrapper classes due to subclass wrappers being initialized before their base class (with the result that the looked-up type object for the base class is null, causing the derived class to be created without referencing the base). Also change one of the test cases to test that we correctly wrap a typedef of a template class derived from a non-template base (which was failing before this change for the aforementioned reason). Change-Id: Ib4dc2626a41cb7bb905ff4a302c2613ea12d026b Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix description of sample/transform unit testMatthew Woehlke2013-08-061-1/+1
| | | | | Change-Id: I942d2f450c8c57bed779925636a9abae572da98c Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix '%#' substitution for # > 9Matthew Woehlke2013-07-303-0/+75
| | | | | | | | | | | | Change '%#' substitution to use a regular expression for the 'old' text to enforce a word boundary after '#', such that we don't perform e.g. '%1' replacement on inputs like '%10'. This fixes problems trying to modify functions with more than nine arguments, such as the example from the previous commit (which now compiles and passes). Also add a test case for this. Change-Id: I9956804b3c65bddf7e36838866641b24ceb87c57 Reviewed-by: John Ehresman <jpe@wingware.com>
* Improve dependencies for testsMatthew Woehlke2013-07-301-3/+2
| | | | | | | | | | | | | | | | | | | | | Add the global header and typesystem XML, and shiboken itself, as dependencies to running Shiboken for generating the wrapped code used in the unit tests. This gives a better example in case of users looking at this code for how to do things in their own projects, and also makes test writing easier by removing the need to do a clean build or touch files to force the wrapping code to be recreated when modifying the test code or the generator. Change command invocation to use shiboken as a target name (CMake will recognize it as a target and use the correct path automatically), and remove the now redundant dependency of the wrapping libraries on the same. (This is superfluous both because using shiboken as a target will cause CMake to add an implicit dependency on it for users of the generated files, but also because it isn't really needed; the generate command having it as a dependency covers needing it built first, and is what we really care about as far as rebuilding anything if it changes.) Change-Id: If5cdf2e98602e500b49ba7b000e4e30e77e1a136 Reviewed-by: John Ehresman <jpe@wingware.com>
* Return None for .name of enum if no name for value.John Ehresman2013-07-121-0/+5
| | | | | | | | | This fixes segfaults when trying to get the name of a dead key from a qt key event. Change-Id: Ie631e2245bca0a3fee8616854f6479d3dec0c2bb Reviewed-by: Roman Lacko <backup.rlacko@gmail.com> Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Decref reference to type objectJohn Ehresman2013-06-242-0/+27
| | | | | | | | A decref is needed if the type is not subclassed when an instance is deallocated Change-Id: I2c64d7cb5b726c5bf108c1cbc5283cf315a5f8e9 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix segfault when using shiboken.deleteJohn Ehresman2013-06-241-0/+42
| | | | | | | | When an object is deleted, invalidate / releaseWrapper needs to be called before cptr array is deleted. Change-Id: I82f71f569d5a0f52084fbe1cc3d7846e764c7ef6 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix bug introduced when recursive_invalidate was added.John Cummings2013-06-241-1/+15
| | | | | | | | | | If a Python object is passed to recursive_invalidate and is a sequence, each item in the sequence is invalidated Add unit test for recursive invalidate of a sequence Change-Id: I70834f8e027bd17a04c0e443bc7d584d1fde26c1 Reviewed-by: John Ehresman <jpe@wingware.com> Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Prevent infinite recursion in invalidateJohn Ehresman2013-06-132-0/+13
| | | | | Change-Id: I8946a8572b608bf8ede211d270f797f135f8083a Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Replaced Nokia copyrights in headerTeemu Kaukoranta2013-05-28105-105/+105
| | | | | | | | | | | | | | | | | | | | | | | | Replaced old Nokia copyrights with Digia copyrights. Removed "All rights reserved" strings without leading copyrights were removed (for example, 'Copyright SomeCompany, all rights reserved remain untouched). Did NOT touch contact details, will change them later. Excluded folders that have '3rdparty' in path. Used command: find . -path '*/3rdparty/*' -prune -o -exec grep -ilI -E '.*Copyright.*Nokia.*' {} \; | tee >(xargs sed -i -r '1,10 s/([ \t#*]*)(.*Copyright.*Nokia.*)/ \1Copyright \(C\) 2013 Digia Plc and\/or its subsidiary\(-ies\)\./I') >(xargs sed -i -r '1,10 s/(^[ \t#*]*)(all rights reserved.*)/\1/I') This excludes binary files and retains whitespace and #* characters in the beginning of the edited lines. Change-Id: I0d49f991c3dbd45d804843f185714e8681bc6c51 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com>
* Fix handling of unsigned long long and provide unittests.Sébastien Sablé2013-03-142-0/+22
| | | | | | Change-Id: I29674a2d758ebf4650e2fe26cdc2e663c0bae5c7 Reviewed-by: Sébastien Sablé <sable@users.sourceforge.net> Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* Fix PYSIDE-108 bug and add exampleJohn Cummings2012-09-112-0/+6
| | | | | | | | Replace "::" with "_" in protected enum name to fix issue Add test case to libsample and samplebinding Change-Id: I2edea2dfa8adecfe5fa34f777da9f60cfe4c6ee4 Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* Find function modifications defined in the 2nd+ base class.John Ehresman2012-06-143-1/+25
| | | | | | | Fixes bug PYSIDE-54 Change-Id: Ic5c341741170cc77e8ebb59c46c746211582ddeb Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
* Use SpooledTemporaryFile in 2.6+ os.tmpfile() fails on win32 if process ↵John Ehresman2012-04-271-1/+1
| | | | | | | doesn't have admin permissions Change-Id: Ic231d5faac08360a793ce33c091eef251d7b35e4 Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* --generator-set command line switch is working again.Hugo Parente Lima2012-03-091-1/+1
| | | | | | QtDocGenerator also working again and the directory layout was changed a bit. Reviewer: Trust me
* Merge GeneratorRunner inside Shiboken.Hugo Parente Lima2012-03-091-3/+2
| | | | | | | | | | | | | | | | Conflicts: CMakeLists.txt data/CMakeLists.txt doc/CMakeLists.txt doc/_templates/index.html doc/_templates/layout.html doc/_themes/pysidedocs/static/pysidedocs.css doc/commandlineoptions.rst doc/conf.py.in doc/contents.rst doc/images/bindinggen-development.png doc/images/boostqtarch.png tests/CMakeLists.txt
* Fix BUG #1105 - "Spyder fails with HEAD"Paulo Alcantara2012-03-092-7/+13
| | | | | | | | | | | | When handling typedef'd primitive types we don't need to create indices for them, nor converters. Instead, we must use the underlying primitive type converters. See http://bugs.pyside.org/show_bug.cgi?id=1105. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org> Reviewed-by: Hugo Parente Lima <hugo.pl@gmail.com>
* Updated documentation for type converters.Marcelo Lira2012-03-082-0/+33
| | | | | | | Expanded the Complex type conversion unit test. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Paulo Alcantara <pcacjr@gmail.com>
* Declares Python types using the new "<custom-type>" tag.Marcelo Lira2012-03-081-0/+6
|
* Removed commented section of test file.Marcelo Lira2012-03-081-11/+1
|
* Removed the last pieces of code generation that uses the old template ↵Marcelo Lira2012-03-0810-221/+9
| | | | Converters.
* Fix conversion for HANDLE type.Hugo Parente Lima2012-03-082-59/+2
| | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
* Remove occurrences of Shiboken::makeTuple from test bindings.Marcelo Lira2012-03-081-6/+14
|
* Added adapter class SpecificConverter to provide type conversion based on a ↵Marcelo Lira2012-03-082-5/+126
| | | | | | | given string. Also added code to register a couple of type conversions by name, a bunch of related tests, and some fixes to the converter functions.
* Register enum converters by name.Marcelo Lira2012-03-081-0/+8
| | | | Also added unit tests.
* Added functions to the new converters API to check if a type is value or object.Marcelo Lira2012-03-082-0/+62
| | | | Comes with unit tests.
* Container types now register their converters by name.Marcelo Lira2012-03-081-0/+12
| | | | | Added unit tests that query for the container types using their C++ signatures.
* Fixes code generation for typedefs of C++ primitive types.Marcelo Lira2012-03-082-0/+78
| | | | Added unit tests that query for the Python types using their names.
* Fixed generation for enum arguments with default values when avoiding the ↵Marcelo Lira2012-03-082-1/+5
| | | | | | protected hack. Also added an unit test.
* Make converter branch work on a Python3.2 setup.Hugo Parente Lima2012-03-083-22/+78
|
* Fix crash in PySequence converters.Hugo Parente Lima2012-03-081-4/+6
|
* Fixes SBK_CONVERTER macro and SbkEnumType structure.Marcelo Lira2012-03-081-2/+7
| | | | | Fixes provided by Hugo Parente Lima. Unit test added.
* Updates std::list methods writer to use the new converters.Marcelo Lira2012-03-083-1/+21
| | | | Also added a couple of related unit tests.
* Updated custom code for ByteArray's read/write buffer protocol.Marcelo Lira2012-03-081-1/+1
|
* Added unit test for bug 969.Hugo Parente Lima2012-03-084-0/+19
|
* Added a test for a typedef of a pointer to a struct.Marcelo Lira2012-03-083-0/+46
| | | | This is only a compilation test, no Python test was provided.
* Shiboken exits with error for not handled pointers to primitive types.Marcelo Lira2012-03-081-0/+38
|
* Added test for implicit conversion with primitive type.Marcelo Lira2012-03-081-1/+4
|
* Added test for instantiated container type used as primitive-type.Marcelo Lira2012-03-082-0/+105
|
* New conversions for containers.Marcelo Lira2012-03-084-14/+131
|
* New converters for user added primitive types.Marcelo Lira2012-03-082-8/+74
| | | | Win32 fix for zero length type converter array.
* Implemented new type converters, but only for wrapper types.Marcelo Lira2012-03-082-6/+70
|
* Fix Windows build of shiboken module.Hugo Parente Lima2012-03-081-0/+2
|
* Implemented PSEP 0106.Hugo Parente Lima2012-03-081-0/+5
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Paulo Alcantra <pcacjr@gmail.com>
* Fix bug 1033 - "QDialog.DialogCode instances and return value from ↵Hugo Parente Lima2012-03-081-2/+2
| | | | QDialog.exec_ hash to different values"