diff options
Diffstat (limited to 'sources/shiboken2/tests')
-rw-r--r-- | sources/shiboken2/tests/libsample/samplenamespace.cpp | 7 | ||||
-rw-r--r-- | sources/shiboken2/tests/libsample/samplenamespace.h | 6 | ||||
-rw-r--r-- | sources/shiboken2/tests/samplebinding/typesystem_sample.xml | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sources/shiboken2/tests/libsample/samplenamespace.cpp b/sources/shiboken2/tests/libsample/samplenamespace.cpp index ec3da3dbf..e066869d2 100644 --- a/sources/shiboken2/tests/libsample/samplenamespace.cpp +++ b/sources/shiboken2/tests/libsample/samplenamespace.cpp @@ -36,6 +36,13 @@ using namespace std; namespace SampleNamespace { +// PYSIDE-817, scoped enums must not be converted to int in the wrappers generated +// for the protected hacks +SomeClass::PublicScopedEnum SomeClass::protectedMethodReturningPublicScopedEnum() const +{ + return PublicScopedEnum::v1; +} + OutValue enumInEnumOut(InValue in) { diff --git a/sources/shiboken2/tests/libsample/samplenamespace.h b/sources/shiboken2/tests/libsample/samplenamespace.h index 37a445e51..27fa11290 100644 --- a/sources/shiboken2/tests/libsample/samplenamespace.h +++ b/sources/shiboken2/tests/libsample/samplenamespace.h @@ -96,9 +96,11 @@ LIBSAMPLE_API void doSomethingWithArray(const unsigned char* data, unsigned int LIBSAMPLE_API int enumItemAsDefaultValueToIntArgument(int value = ZeroIn); -class SomeClass +class LIBSAMPLE_API SomeClass { public: + enum class PublicScopedEnum { v1, v2 }; + class SomeInnerClass { public: @@ -131,6 +133,8 @@ protected: ProtectedItem0, ProtectedItem1 }; + + PublicScopedEnum protectedMethodReturningPublicScopedEnum() const; }; class DerivedFromNamespace : public SomeClass::SomeInnerClass::OkThisIsRecursiveEnough diff --git a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml index 334f0162d..9b967fc53 100644 --- a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml @@ -549,6 +549,7 @@ <enum-type name="SampleNamespace"/> </object-type> <value-type name="SomeClass"> + <enum-type name="PublicScopedEnum"/> <value-type name="SomeInnerClass"> <object-type name="OkThisIsRecursiveEnough"> <enum-type name="NiceEnum" /> |