aboutsummaryrefslogtreecommitdiffstats
path: root/tests
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>
* Remove protected from samblebinding testJohn Ehresman2014-04-161-2/+1
| | | | | | | | | The protected sections triggered a generation bug when avoiding the protected hack Change-Id: I6346cdb74a25f1ddf49263d9f74670a3b105b07a Reviewed-by: Matthew Woehlke <mw_triad@users.sourceforge.net> Reviewed-by: Roman Lacko <backup.rlacko@gmail.com>
* Add parsing of 'noexcept' keywordMatthew Woehlke2014-04-161-0/+32
| | | | | | | | | | | Teach Shiboken to parse the 'noexcept' keyword. This doesn't add any features (and we only support unconditional 'noexcept' for now), but addresses an internal error that causes shiboken to SEGV trying to parse modern versions of boost::intrusive_ptr. A test case to replicate the crash (without the other changes) is also added. Change-Id: I4713593dfd189c02ef4a2d7447d785b6d378019c Reviewed-by: John Ehresman <jpe@wingware.com>
* Fix function rejections (i.e. support overloads)Matthew Woehlke2014-04-163-0/+21
| | | | | | | | | | | | | | | | | | | | | 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-074-0/+53
| | | | | | | | | 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-243-5/+13
| | | | | | | | | | | | | | | | | | 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>
* Work around MSVC's deficient <cmath>Matthew Woehlke2013-08-141-0/+6
| | | | | | | | Change libsample/transform.cpp to use the MSVC-specific _finite on Windows, rather than std::isfinite, which MSVC does not implement. Change-Id: If7b33e17bcb7c2e4432d670d44b559205f88796d Reviewed-by: John Ehresman <jpe@wingware.com>
* 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-306-0/+170
| | | | | | | | | | | | 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-303-10/+7
| | | | | | | | | | | | | | | | | | | | | 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>
* Don't break -Werror=non-virtual-dtorMatthew Woehlke2013-06-283-0/+4
| | | | | | | | | | | | | | Classes with virtual methods but non-virtual destructors are dangerous, because users often hold pointers-to-base-class of derived classes, which cannot correctly destruct the derived class if deleted. As such, there is the aforementioned warning that developers may like to promote to an error. Add virtual (empty) destructors to some classes that were tripping this, so that we build successfully if said flag is used, and because they should probably be present. Change-Id: I930ad5f5d122cf94c57e52bf28479cf3ca7950d4 Reviewed-by: John Cummings <jcummings2@users.sf.net> Reviewed-by: John Ehresman <jpe@wingware.com>
* Fixing shiboken test for minimal binding testStefan Landvogt2013-06-281-2/+8
| | | | | | | Don't execute typedef_test.py, when NumPy is not installed Change-Id: I452944822177f616ea640ed0ee005d0436ab518b Reviewed-by: John Ehresman <jpe@wingware.com>
* 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-133-0/+17
| | | | | Change-Id: I8946a8572b608bf8ede211d270f797f135f8083a Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Replaced Nokia copyrights in headerTeemu Kaukoranta2013-05-28251-251/+251
| | | | | | | | | | | | | | | | | | | | | | | | 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-144-0/+36
| | | | | | 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-113-0/+16
| | | | | | | | 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>
* PYSIDE-83 Fix segfault calling shiboken.dumpNathan Smith2012-07-041-0/+6
| | | | | | | | | | shiboken.dump would segfault when called on an object whose C++ object had been deleted or whose parent C++ object had been deleted. This now checks to see if the data pointers beneath the PyObject are NULL before printing data. Change-Id: I89763a3ca3a5d25fad4142ff924692cd232c9c40 Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
* Fix and test case for bug PYSIDE-72.Nathan Smith2012-07-041-1/+9
| | | | | | | | | | | | | | | | The address of the PyObject is used directly as the hash rather than a member of that object. This avoids segfaults when the C++ object has been deleted, rendering the child pointers NULL. Removed a test case verifying that hash(QObject()) != hash(QObject()) because they in fact can be equal. The first QObject dies and is reaped before the second QObject is created, meaning that the second QObject may be allocated at the same address as the first QObject, giving them both the same address. If a reference is held to the first object, though, then they will get different hash values. Change-Id: I116463f88b837726a98720bae36770d53b13f4ee Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
* Update vector conversionJohn Cummings2012-06-141-8/+8
| | | | | | | Incorporate Hugo's comments from change Id2ea1a5f Change-Id: I5f0c93b7036f5d2908cd2ee2038eb570f9889b58 Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* Add typedef examples to minimalJohn Cummings2012-06-147-0/+222
| | | | | | | | | Add an example for a typedef of a template Add an example for a typedef of a typedef Add a python unit test for these examples Change-Id: Id2ea1a5f1e4b3d865c081625f2d5b7ed4c38bbdb Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
* Don't use it->second after erasing itJohn Ehresman2012-06-141-2/+4
| | | | | Change-Id: I77bda667d4119a7982ec93175ff0b3153277ad8e Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* Find function modifications defined in the 2nd+ base class.John Ehresman2012-06-145-1/+53
| | | | | | | Fixes bug PYSIDE-54 Change-Id: Ic5c341741170cc77e8ebb59c46c746211582ddeb Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
* Set a default hash function for all ObjectTypes.Hugo Parente Lima2012-05-031-0/+17
| | | | | | | | Fix bug PYSIDE-42 Change-Id: I1392374dcf0055309152082e674cc1e3e6472d4d Reviewed-by: Paulo Alcantara <paulo.alcantara@openbossa.org> Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* Don't use inline methods in dllexported classes to keep VC++ happyJohn Ehresman2012-04-305-13/+118
| | | | | Change-Id: I2e954bedfe4699a621047a757b3dbd202655e97b Reviewed-by: Hugo Parente Lima <hugo.lima@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-093-3/+3
| | | | | | QtDocGenerator also working again and the directory layout was changed a bit. Reviewer: Trust me
* Merge GeneratorRunner inside Shiboken.Hugo Parente Lima2012-03-0917-7/+850
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Use QDir::currentPath() to avoid problems with armel-Meego target.Luciano Wolf2011-04-041-1/+1
| | | | | | | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente <hugo.lima@openbossa.org>
| * Fix bug #532 - "QNetworkSession documentation formatting broken"Luciano Wolf2011-03-042-0/+59
| | | | | | | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
| * Added a CMake script that sets some environment variables before calling the ↵Marcelo Lira2011-02-043-8/+25
| | | | | | | | | | | | | | | | | | | | tests. This is used as a workaround to a CMake 2.6 limitation that prevents environment variables to be set for tests. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Neto <lauro.neto@openbossa.org>
| * Fixed the project file test to work with win32 paths.Marcelo Lira2011-01-312-2/+10
| | | | | | | | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
| * Modified GeneratorRunner to support a simpler format of project file.Marcelo Lira2011-01-258-52/+113
| | | | | | | | | | The project file are now just a text file containing key/value pairs. The documentation was updated accordingly, including the man page.
| * Added a dummy generator as a source of test cases.Marcelo Lira2011-01-258-0/+355
| | | | | | | | Unit tests were added as well.
| * Add option to install testsLauro Neto2011-01-111-0/+3
| | | | | | | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
| * Do not compiles doc generator when ApiExtractor doesn't have support forHugo Parente Lima2010-08-171-15/+17
| | | | | | | | | | | | | | doc strings. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
| * readded tests for qtdoc generator that were left behind when forkingMarcelo Lira2009-10-263-0/+337
| | | | | | | | from boostpythongenerator
| * forked boostpythongenerator project to separate the generatorrunnerMarcelo Lira2009-10-2615-576/+0
| | | | | | | | | | so that it could be used independently; the qtdoc generator module remained part of generatorrunner
| * Fixed typo in tests CMakesLists.Renato Araujo Oliveira Filho2009-08-251-1/+1
| |
| * Removed QtDocGenerator dependence from BoostPythonGenerator, so a lotHugo Lima2009-08-253-6/+6
| | | | | | | | | | | | of function were moved from BoostPythonGenerator to the Generator class. In other words, QtDocGenerator finally compiles and their unit test pass :-)
| * The genesis...Hugo Lima2009-08-1715-0/+576
|
* Remove ambiguous constructor from libsample's HandleHolder.Paulo Alcantara2012-03-091-1/+1
| | | | | | 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>
* Fix BUG #1105 - "Spyder fails with HEAD"Paulo Alcantara2012-03-094-13/+36
| | | | | | | | | | | | 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>
* Added a generation/compilation test for container types.Marcelo Lira2012-03-081-1/+4
|