diff options
-rw-r--r-- | tests/GenerateSipBindings/cpplib.cpp | 5 | ||||
-rw-r--r-- | tests/GenerateSipBindings/cpplib.h | 8 | ||||
-rw-r--r-- | tests/GenerateSipBindings/testscript.py | 7 |
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/GenerateSipBindings/cpplib.cpp b/tests/GenerateSipBindings/cpplib.cpp index c5b7a5fb..76b97b0e 100644 --- a/tests/GenerateSipBindings/cpplib.cpp +++ b/tests/GenerateSipBindings/cpplib.cpp @@ -141,3 +141,8 @@ void MyObject::privateSlot2() { Q_EMIT privateSlotCalled(); } + +qreal SomeNS::useEnum(MyFlags flags) +{ + return flags; +} diff --git a/tests/GenerateSipBindings/cpplib.h b/tests/GenerateSipBindings/cpplib.h index 6ec3f575..ba8e9f27 100644 --- a/tests/GenerateSipBindings/cpplib.h +++ b/tests/GenerateSipBindings/cpplib.h @@ -116,6 +116,14 @@ private: int* const mNum; }; +enum MyFlagType { + EnumValueOne = 0x01, + EnumValueTwo = 0x02 +}; +Q_DECLARE_FLAGS(MyFlags, MyFlagType) + +qreal useEnum(MyFlags flags = EnumValueOne); + } enum __attribute__((visibility("default"))) EnumWithAttributes { diff --git a/tests/GenerateSipBindings/testscript.py b/tests/GenerateSipBindings/testscript.py index 973d428c..deefb960 100644 --- a/tests/GenerateSipBindings/testscript.py +++ b/tests/GenerateSipBindings/testscript.py @@ -91,3 +91,10 @@ assert(r.gotProtectedSlotCalledSignal) e.emitSignalForPublic() assert(r.gotPublicSlotCalledSignal) + +assert(PyTest.CppLib.SomeNS.EnumValueOne == 1) +assert(PyTest.CppLib.SomeNS.EnumValueTwo == 2) + +assert(PyTest.CppLib.SomeNS.useEnum() == 1.0) +assert(PyTest.CppLib.SomeNS.useEnum(PyTest.CppLib.SomeNS.EnumValueOne) == 1.0) +assert(PyTest.CppLib.SomeNS.useEnum(PyTest.CppLib.SomeNS.EnumValueTwo) == 2.0) |