aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/quicktest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 470b3c0f7a..443496c9bc 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -332,8 +332,9 @@ private:
}
};
- TestCaseEnumerationResult enumerateTestCases(QV4::ExecutableCompilationUnit *compilationUnit,
- const Object *object = nullptr)
+ TestCaseEnumerationResult enumerateTestCases(
+ const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit,
+ const Object *object = nullptr)
{
QQmlType testCaseType;
for (quint32 i = 0, count = compilationUnit->importCount(); i < count; ++i) {
@@ -356,9 +357,8 @@ private:
if (!object) // Start at root of compilation unit if not enumerating a specific child
object = compilationUnit->objectAt(0);
- if (QV4::ExecutableCompilationUnit *superTypeUnit
- = compilationUnit->resolvedTypes.value(object->inheritedTypeNameIndex)
- ->compilationUnit.data()) {
+ if (const auto superTypeUnit = compilationUnit->resolvedTypes.value(
+ object->inheritedTypeNameIndex)->compilationUnit()) {
// We have a non-C++ super type, which could indicate we're a subtype of a TestCase
if (testCaseType.isValid() && superTypeUnit->url() == testCaseType.sourceUrl())
result.isTestCase = true;