aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample
Commit message (Collapse)AuthorAgeFilesLines
* 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-162-0/+16
| | | | | | | | | | | | | | | | | | | | | 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-071-0/+47
| | | | | | | | | 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>
* Write inititializations in topological orderMatthew Woehlke2013-09-241-5/+11
| | | | | | | | | | | | | | | | | | 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 '%#' substitution for # > 9Matthew Woehlke2013-07-303-0/+95
| | | | | | | | | | | | 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>
* Don't break -Werror=non-virtual-dtorMatthew Woehlke2013-06-282-0/+2
| | | | | | | | | | | | | | 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>
* Prevent infinite recursion in invalidateJohn Ehresman2013-06-131-0/+4
| | | | | Change-Id: I8946a8572b608bf8ede211d270f797f135f8083a Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Replaced Nokia copyrights in headerTeemu Kaukoranta2013-05-28107-107/+107
| | | | | | | | | | | | | | | | | | | | | | | | 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/+14
| | | | | | 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-111-0/+10
| | | | | | | | 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>
* 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-142-0/+28
| | | | | | | Fixes bug PYSIDE-54 Change-Id: Ic5c341741170cc77e8ebb59c46c746211582ddeb Reviewed-by: Marcelo Lira <marcelo.lira@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>
* 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-092-6/+23
| | | | | | | | | | | | 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>
* Added a generation/compilation test for container types.Marcelo Lira2012-03-081-1/+4
|
* Added a compilation test for containers of object types used as values.Marcelo Lira2012-03-081-0/+3
|
* Fixed generation for enum arguments with default values when avoiding the ↵Marcelo Lira2012-03-082-0/+8
| | | | | | protected hack. Also added an unit test.
* Added the API exporting macro to the protected test classes.Marcelo Lira2012-03-081-6/+6
|
* Fixes SBK_CONVERTER macro and SbkEnumType structure.Marcelo Lira2012-03-081-0/+3
| | | | | Fixes provided by Hugo Parente Lima. Unit test added.
* Updates std::list methods writer to use the new converters.Marcelo Lira2012-03-081-0/+45
| | | | Also added a couple of related unit tests.
* Modifies HANDLE test to fix win32 linking problem.Marcelo Lira2012-03-083-12/+39
|
* Fixed code generation for functions arguments that use object types as values.Marcelo Lira2012-03-081-0/+1
|
* Added unit test for bug 969.Hugo Parente Lima2012-03-081-0/+36
|
* Added a test for a typedef of a pointer to a struct.Marcelo Lira2012-03-081-2/+8
| | | | This is only a compilation test, no Python test was provided.
* Fixes win32 symbol exporting for instantiated template classes.Marcelo Lira2012-03-081-3/+8
|
* Shiboken exits with error for not handled pointers to primitive types.Marcelo Lira2012-03-082-0/+13
|
* Added test for implicit conversion with primitive type.Marcelo Lira2012-03-081-2/+4
|
* Added test for instantiated container type used as primitive-type.Marcelo Lira2012-03-082-1/+4
|
* New conversions for containers.Marcelo Lira2012-03-086-9/+54
|
* Implemented PSEP 0106.Hugo Parente Lima2012-03-082-0/+7
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Paulo Alcantra <pcacjr@gmail.com>
* Fixed tests to work with python3.x and python2.xRenato Filho2012-03-081-1/+1
|
* Revert "Implements PSEP-0106 and fixes bug 902 - "Expose Shiboken ↵Hugo Parente Lima2012-03-082-7/+0
| | | | | | | | functionality through a Python module"." This reverts commit bc8448d7fb91733ff08c2a6a3a878702c14a24e0. The PSEP didn't reach the final version yet, so this commit can't be released.
* Implements PSEP-0106 and fixes bug 902 - "Expose Shiboken functionality ↵Hugo Parente Lima2012-03-082-0/+7
| | | | through a Python module".
* Fixed generator to consider conversion rules for the return type of wrapper ↵Marcelo Lira2012-03-082-0/+18
| | | | | | | | | methods. Tests were added. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Added a test case for a bit-field structure member.Marcelo Lira2012-03-082-1/+4
| | | | Also moved a couple of tests from samplebindings to otherbindings.
* Added test for typedef of unsigned short.Marcelo Lira2012-03-081-0/+2
|
* Added test for user defined primitive type used as public class field.Marcelo Lira2012-03-081-0/+2
|
* Added test for implicit conversion with user's primitive type.Marcelo Lira2012-03-081-0/+6
|
* Added a method modification test dealing with code injection and user's ↵Marcelo Lira2012-03-081-0/+4
| | | | | | primitive type. The inject code has a %CONVERTTOPYTHON that receives an user's primitive type.
* Implemented unit test for deprecated functions.Renato Filho2012-03-081-0/+3
| | | | | Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Improved the generation of argument conversion in modified functions.Marcelo Lira2012-03-082-3/+31
| | | | | | | | Added the SBK_UNUSED macro to libshiboken to prevent compilation warnings. An unit test was added. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Added tests for a class that its only constructor is the copy one.Marcelo Lira2012-03-083-0/+105
| | | | | | | | This simulates a situation found in QtWebKit's QWebDatabase and QWebSecurityOrigin classes. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Added tests for classes that are typedefs that implement a template class.Marcelo Lira2012-03-083-0/+103
| | | | This simulates the situation found in Qt's phonon module.
* The type checking now pays attention to the <no-null-pointer/> tag.Marcelo Lira2012-03-082-0/+10
| | | | An unit test was also added for it.
* Added a test dealing with a reference to an Object Type passed to Python.Marcelo Lira2012-03-083-0/+92
| | | | | The test is for an Object Type that didn't existed in Python and is passed to it as C++ reference through a virtual method.
* Improved guessCPythonCheckFunction method to produce an AbstractMetaType for ↵Marcelo Lira2012-03-082-0/+10
| | | | | | | | | | known types. This is in opposition of simply returning a string with a custom type check. The details are in the docstring in ShibokenGenerator header. Also added a new modification test and refactored here and there in the sample binding type system.
* Included tests for added function signatures very similar to already ↵Marcelo Lira2012-03-082-3/+18
| | | | | | | | | | | | | | | existing ones. Specifically this causes the situation when there is in C++ a function with an argument that is a reference to a Value Type, and the user adds a very similar function with the same type, but passed as value. Example: C++ : function(const TYPE& a, int b) Added: function(TYPE) The return type of ShibokenGenerator::getArgumentReplacement() method was modified, because the argument object is more useful than its index.