aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-20 09:32:50 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-20 14:54:18 +0200
commit5b9b83f58bc990136697b8255a4f9230653b8d74 (patch)
treef5d3748314941ebf4f30f3b62215e9fe3aefe223 /sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp
parentca133d553524c02493d61f71be6367504cddde73 (diff)
shiboken6: Refactor argument ownership
In ArgumentModification, replace the QHash<TypeSystem::Language, TypeSystem::Ownership> by 2 getters and setters for native and target language. Rename InvalidOwnership to UnspecifiedOwnership. Pick-to: 6.1 Change-Id: I4f1a6bd67f50a7c2064b7543df197f580ffb73ca Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp b/sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp
index 906b8a4b4..0d95d5abb 100644
--- a/sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testmodifyfunction.cpp
@@ -98,7 +98,8 @@ void TestModifyFunction::testOwnershipTransfer()
const auto func = classB->findFunction(QLatin1String("method"));
QVERIFY(!func.isNull());
- QCOMPARE(func->ownership(func->ownerClass(), TypeSystem::TargetLangCode, 0), TypeSystem::CppOwnership);
+ QCOMPARE(func->argumentTargetOwnership(func->ownerClass(), 0),
+ TypeSystem::CppOwnership);
}
@@ -219,10 +220,12 @@ void TestModifyFunction::testWithApiVersion()
AbstractMetaClass* classB = AbstractMetaClass::findClass(classes, QLatin1String("B"));
auto func = classB->findFunction(QLatin1String("method"));
- QCOMPARE(func->ownership(func->ownerClass(), TypeSystem::TargetLangCode, 0), TypeSystem::CppOwnership);
+ auto returnOwnership = func->argumentTargetOwnership(func->ownerClass(), 0);
+ QCOMPARE(returnOwnership, TypeSystem::CppOwnership);
func = classB->findFunction(QLatin1String("methodB"));
- QVERIFY(func->ownership(func->ownerClass(), TypeSystem::TargetLangCode, 0) != TypeSystem::CppOwnership);
+ returnOwnership = func->argumentTargetOwnership(func->ownerClass(), 0);
+ QVERIFY(returnOwnership != TypeSystem::CppOwnership);
}
// Modifications on class/typesystem level are tested below