aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsvalueiterator
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qjsvalueiterator')
-rw-r--r--tests/auto/qml/qjsvalueiterator/CMakeLists.txt6
-rw-r--r--tests/auto/qml/qjsvalueiterator/tst_qjsvalueiterator.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/qml/qjsvalueiterator/CMakeLists.txt b/tests/auto/qml/qjsvalueiterator/CMakeLists.txt
index 85ac6c7a58..961674e50d 100644
--- a/tests/auto/qml/qjsvalueiterator/CMakeLists.txt
+++ b/tests/auto/qml/qjsvalueiterator/CMakeLists.txt
@@ -7,6 +7,12 @@
## tst_qjsvalueiterator Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qjsvalueiterator LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qjsvalueiterator
SOURCES
tst_qjsvalueiterator.cpp
diff --git a/tests/auto/qml/qjsvalueiterator/tst_qjsvalueiterator.cpp b/tests/auto/qml/qjsvalueiterator/tst_qjsvalueiterator.cpp
index e329cf948f..a671bf42e2 100644
--- a/tests/auto/qml/qjsvalueiterator/tst_qjsvalueiterator.cpp
+++ b/tests/auto/qml/qjsvalueiterator/tst_qjsvalueiterator.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtTest/QtTest>
@@ -447,7 +447,7 @@ void tst_QJSValueIterator::iterateNonObject()
void tst_QJSValueIterator::iterateOverObjectFromDeletedEngine()
{
- QJSEngine *engine = new QJSEngine;
+ std::unique_ptr<QJSEngine> engine = std::make_unique<QJSEngine>();
QJSValue objet = engine->newObject();
// populate object with properties
@@ -465,7 +465,7 @@ void tst_QJSValueIterator::iterateOverObjectFromDeletedEngine()
it.next();
QVERIFY(properties.contains(it.name()));
- delete engine;
+ engine.reset();
QVERIFY(objet.isUndefined());
QVERIFY(it.name().isEmpty());