summaryrefslogtreecommitdiffstats
path: root/tests/auto/concurrent/qtconcurrentmedian
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/concurrent/qtconcurrentmedian')
-rw-r--r--tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt11
-rw-r--r--tests/auto/concurrent/qtconcurrentmedian/tst_qtconcurrentmedian.cpp7
2 files changed, 13 insertions, 5 deletions
diff --git a/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt
index cbae4d1fb1..63f0135467 100644
--- a/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt
+++ b/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt
@@ -1,12 +1,19 @@
-# Generated from qtconcurrentmedian.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qtconcurrentmedian Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qtconcurrentmedian LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qtconcurrentmedian
SOURCES
tst_qtconcurrentmedian.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Concurrent
)
diff --git a/tests/auto/concurrent/qtconcurrentmedian/tst_qtconcurrentmedian.cpp b/tests/auto/concurrent/qtconcurrentmedian/tst_qtconcurrentmedian.cpp
index d02856b93f..7eea013c8b 100644
--- a/tests/auto/concurrent/qtconcurrentmedian/tst_qtconcurrentmedian.cpp
+++ b/tests/auto/concurrent/qtconcurrentmedian/tst_qtconcurrentmedian.cpp
@@ -1,5 +1,6 @@
// 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 <qtconcurrentmedian.h>
#include <QTest>
@@ -48,11 +49,11 @@ void tst_QtConcurrentMedian::median_data()
void tst_QtConcurrentMedian::median()
{
- QFETCH(QList<double> , values);
+ QFETCH(const QList<double> , values);
QFETCH(double, expectedMedian);
QtConcurrent::Median m;
- foreach (double value, values)
+ for (double value : values)
m.addValue(value);
QCOMPARE(m.median(), expectedMedian);
}