diff options
author | Shaheed Haque <srhaque@theiet.org> | 2017-02-03 20:22:52 +0000 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2017-02-04 11:45:00 +0000 |
commit | 2e20aeab6e86670a66ff99a7b79120c4004b4d22 (patch) | |
tree | 9fc24f0411f90f623aa9842bd0aef9fdcccc52e6 /tests | |
parent | 98d065773413aba437c0bc537c701ed39d38a9b9 (diff) | |
download | extra-cmake-modules-2e20aeab6e86670a66ff99a7b79120c4004b4d22.tar.gz extra-cmake-modules-2e20aeab6e86670a66ff99a7b79120c4004b4d22.tar.bz2 |
Automatically mark classes with pure virtual functions as /Abstract/.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GenerateSipBindings/cpplib.cpp | 20 | ||||
-rw-r--r-- | tests/GenerateSipBindings/cpplib.h | 20 | ||||
-rw-r--r-- | tests/GenerateSipBindings/testscript.py | 5 |
3 files changed, 45 insertions, 0 deletions
diff --git a/tests/GenerateSipBindings/cpplib.cpp b/tests/GenerateSipBindings/cpplib.cpp index 47370ca0..8ecedcbc 100644 --- a/tests/GenerateSipBindings/cpplib.cpp +++ b/tests/GenerateSipBindings/cpplib.cpp @@ -239,3 +239,23 @@ Shared::Shared(const Shared& other) { } + +int Abstract::callableMultiply(int i, int j) +{ + return i * j; +} + +Abstract::~Abstract() +{ + +} + +int Concrete::callableAdd(int i, int j) +{ + return i + j; +} + +void Concrete::virtualInterface() +{ + +} diff --git a/tests/GenerateSipBindings/cpplib.h b/tests/GenerateSipBindings/cpplib.h index 958b8750..82e795a1 100644 --- a/tests/GenerateSipBindings/cpplib.h +++ b/tests/GenerateSipBindings/cpplib.h @@ -219,3 +219,23 @@ class NO_EXPORT Invisible public: int someApi() { return 1; } }; + +class Abstract +{ +public: + virtual ~Abstract(); + + int callableMultiply(int i, int j); + +protected: + virtual void virtualInterface() = 0; +}; + +class Concrete : public Abstract +{ +public: + int callableAdd(int i, int j); + +protected: + void virtualInterface() override; +}; diff --git a/tests/GenerateSipBindings/testscript.py b/tests/GenerateSipBindings/testscript.py index b388841f..f1bef91e 100644 --- a/tests/GenerateSipBindings/testscript.py +++ b/tests/GenerateSipBindings/testscript.py @@ -135,3 +135,8 @@ try: assert False except AttributeError as e: assert str(e) == "module 'PyTest.CppLib' has no attribute 'Invisible'" + +concrete = PyTest.CppLib.Concrete() + +assert(concrete.callableMultiply(2, 3) == 6) +assert(concrete.callableAdd(2, 3) == 5) |