aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/tests
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor/tests')
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp27
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp b/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp
index b85a022b3..f2e15fdb0 100644
--- a/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp
@@ -195,6 +195,33 @@ public:
QCOMPARE(funcC->implementingClass(), c);
}
+void TestAbstractMetaClass::testVirtualBase()
+{
+ const char cppCode[] =R"CPP(
+class Base {
+public:
+ virtual ~Base() = default;
+};
+class Derived : public Base {};
+)CPP";
+
+ const char xmlCode[] = R"XML(
+<typesystem package="Foo">
+ <object-type name='Base'/>
+ <object-type name='Derived'/>
+</typesystem>
+)XML";
+ QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode));
+ QVERIFY(!builder.isNull());
+ AbstractMetaClassList classes = builder->classes();
+ auto base = AbstractMetaClass::findClass(classes, QLatin1String("Base"));
+ QVERIFY(base);
+ QVERIFY(base->isPolymorphic());
+ auto derived = AbstractMetaClass::findClass(classes, QLatin1String("Derived"));
+ QVERIFY(derived);
+ QVERIFY(derived->isPolymorphic());
+}
+
void TestAbstractMetaClass::testDefaultValues()
{
const char* cppCode ="\
diff --git a/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.h b/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.h
index cb0b6693e..e19973625 100644
--- a/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.h
+++ b/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.h
@@ -40,6 +40,7 @@ private slots:
void testClassName();
void testClassNameUnderNamespace();
void testVirtualMethods();
+ void testVirtualBase();
void testDefaultValues();
void testModifiedDefaultValues();
void testInnerClassOfAPolymorphicOne();