aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-04-06 12:49:17 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-04-07 20:32:11 +0200
commit89180881559f89dc1c932794348b3e9f36986638 (patch)
treecdee2ff737b0ec2ff9500866a2e4211c3f9f1317 /sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp
parent9f9026e16295b58d5b6d00cf8624c598e1090a0f (diff)
shiboken6: Refactor the class function queries
Change the meaning of FunctionQueryOption::Constructors to "constructor except move/copy" since that is what is desired in most cases. Add FunctionQueryOption::AnyConstructor for the old purpose. Pick-to: 6.2 Change-Id: I600b02513b9b9e72d7cbd60e22cda7549133ab39 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp b/sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp
index 0a22f08af..4912f0505 100644
--- a/sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testabstractmetaclass.cpp
@@ -71,7 +71,7 @@ void TestAbstractMetaClass::testClassNameUnderNamespace()
QVERIFY(classes[0]->hasConstructors());
QCOMPARE(classes[0]->functions().size(), 2); // default ctor + copy ctor
- auto ctors = classes[0]->queryFunctions(FunctionQueryOption::Constructors);
+ auto ctors = classes[0]->queryFunctions(FunctionQueryOption::AnyConstructor);
QCOMPARE(ctors.size(), 2);
if (ctors.constFirst()->minimalSignature() != QLatin1String("ClassName()"))
qSwap(ctors[0], ctors[1]);
@@ -359,7 +359,7 @@ void TestAbstractMetaClass::testSpecialFunctions()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
- auto ctors = classA->queryFunctions(FunctionQueryOption::Constructors);
+ auto ctors = classA->queryFunctions(FunctionQueryOption::AnyConstructor);
QCOMPARE(ctors.size(), 2);
QCOMPARE(ctors.constFirst()->functionType(), AbstractMetaFunction::ConstructorFunction);
QCOMPARE(ctors.at(1)->functionType(), AbstractMetaFunction::CopyConstructorFunction);
@@ -370,7 +370,7 @@ void TestAbstractMetaClass::testSpecialFunctions()
const AbstractMetaClass *classB = AbstractMetaClass::findClass(classes, QLatin1String("B"));
QVERIFY(classB);
- ctors = classB->queryFunctions(FunctionQueryOption::Constructors);
+ ctors = classB->queryFunctions(FunctionQueryOption::AnyConstructor);
QCOMPARE(ctors.size(), 2);
QCOMPARE(ctors.constFirst()->functionType(), AbstractMetaFunction::ConstructorFunction);
QCOMPARE(ctors.at(1)->functionType(), AbstractMetaFunction::CopyConstructorFunction);
@@ -427,7 +427,7 @@ void TestAbstractMetaClass::testClassDefaultConstructors()
QVERIFY(classA);
QCOMPARE(classA->functions().size(), 2);
- auto ctors = classA->queryFunctions(FunctionQueryOption::Constructors);
+ auto ctors = classA->queryFunctions(FunctionQueryOption::AnyConstructor);
QCOMPARE(ctors.size(), 2);
if (ctors.constFirst()->minimalSignature() != QLatin1String("A()"))
qSwap(ctors[0], ctors[1]);
@@ -461,7 +461,7 @@ void TestAbstractMetaClass::testClassDefaultConstructors()
AbstractMetaClass* classF = AbstractMetaClass::findClass(classes, QLatin1String("F"));
QVERIFY(classF);
- ctors = classF->queryFunctions(FunctionQueryOption::Constructors);
+ ctors = classF->queryFunctions(FunctionQueryOption::AnyConstructor);
QCOMPARE(ctors.size(), 2);
if (ctors.constFirst()->minimalSignature() != QLatin1String("F(int,int)"))
qSwap(ctors[0], ctors[1]);
@@ -494,7 +494,7 @@ void TestAbstractMetaClass::testClassInheritedDefaultConstructors()
AbstractMetaClass* classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
- auto ctors = classA->queryFunctions(FunctionQueryOption::Constructors);
+ auto ctors = classA->queryFunctions(FunctionQueryOption::AnyConstructor);
QCOMPARE(ctors.size(), 2);
if (ctors.constFirst()->minimalSignature() != QLatin1String("A()"))
qSwap(ctors[0], ctors[1]);