diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libsample/derived.cpp | 9 | ||||
-rw-r--r-- | tests/libsample/derived.h | 1 | ||||
-rwxr-xr-x | tests/samplebinding/typediscovery_test.py | 42 |
3 files changed, 52 insertions, 0 deletions
diff --git a/tests/libsample/derived.cpp b/tests/libsample/derived.cpp index 0acba8e88..0a3646258 100644 --- a/tests/libsample/derived.cpp +++ b/tests/libsample/derived.cpp @@ -98,3 +98,12 @@ Derived::otherOverloaded(int a, double b) return OtherOverloadedFunc_id; } +struct SecrectClass : public Abstract { + virtual void pureVirtual() {} + virtual PrintFormat returnAnEnum() { return Short; } +}; + +Abstract* Derived::triggerImpossibleTypeDiscovery() +{ + return new SecrectClass; +} diff --git a/tests/libsample/derived.h b/tests/libsample/derived.h index 162acbb7b..832148e35 100644 --- a/tests/libsample/derived.h +++ b/tests/libsample/derived.h @@ -84,6 +84,7 @@ public: SomeInnerClass returnMyParameter(const SomeInnerClass& s) { return s; } + static Abstract* triggerImpossibleTypeDiscovery(); protected: const char* getClassName() { return className(); } virtual const char* className() { return "Derived"; } diff --git a/tests/samplebinding/typediscovery_test.py b/tests/samplebinding/typediscovery_test.py new file mode 100755 index 000000000..14fd79e6b --- /dev/null +++ b/tests/samplebinding/typediscovery_test.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# This file is part of the Shiboken Python Bindings Generator project. +# +# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +# +# Contact: PySide team <contact@pyside.org> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License +# version 2.1 as published by the Free Software Foundation. Please +# review the following information to ensure the GNU Lesser General +# Public License version 2.1 requirements will be met: +# http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# # +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA + +'''Test cases for type discovery''' + +import unittest + +from sample import * + +class TypeDiscoveryTest(unittest.TestCase): + + def testPureVirtualsOfImpossibleTypeDiscovery(self): + a = Derived.triggerImpossibleTypeDiscovery() + # call some pure virtual method + a.pureVirtual() + +if __name__ == '__main__': + unittest.main() + |