summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/util
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/util')
-rw-r--r--tests/auto/gui/util/CMakeLists.txt3
-rw-r--r--tests/auto/gui/util/qdesktopservices/CMakeLists.txt13
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp50
-rw-r--r--tests/auto/gui/util/qdoublevalidator/CMakeLists.txt11
-rw-r--r--tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp120
-rw-r--r--tests/auto/gui/util/qintvalidator/CMakeLists.txt11
-rw-r--r--tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp75
-rw-r--r--tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt11
-rw-r--r--tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp37
-rw-r--r--tests/auto/gui/util/qtexturefilereader/CMakeLists.txt29
-rw-r--r--tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc11
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/invalid.ktxbin0 -> 69 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp42
-rw-r--r--tests/auto/gui/util/qundogroup/CMakeLists.txt11
-rw-r--r--tests/auto/gui/util/qundogroup/tst_qundogroup.cpp49
-rw-r--r--tests/auto/gui/util/qundostack/CMakeLists.txt11
-rw-r--r--tests/auto/gui/util/qundostack/tst_qundostack.cpp73
17 files changed, 234 insertions, 323 deletions
diff --git a/tests/auto/gui/util/CMakeLists.txt b/tests/auto/gui/util/CMakeLists.txt
index 048e18360c..830a9ff2f0 100644
--- a/tests/auto/gui/util/CMakeLists.txt
+++ b/tests/auto/gui/util/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from util.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qdesktopservices)
add_subdirectory(qdoublevalidator)
diff --git a/tests/auto/gui/util/qdesktopservices/CMakeLists.txt b/tests/auto/gui/util/qdesktopservices/CMakeLists.txt
index 475a3405c0..64a1aaa930 100644
--- a/tests/auto/gui/util/qdesktopservices/CMakeLists.txt
+++ b/tests/auto/gui/util/qdesktopservices/CMakeLists.txt
@@ -1,14 +1,19 @@
-# Generated from qdesktopservices.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qdesktopservices Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qdesktopservices LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qdesktopservices
SOURCES
tst_qdesktopservices.cpp
- DEFINES
- # QT_DISABLE_DEPRECATED_BEFORE=0 # special case
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
)
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
index 7446f8ed9f..e08b299209 100644
--- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
@@ -1,36 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
#include <qdesktopservices.h>
#include <qregularexpression.h>
+using namespace Qt::StringLiterals;
+
class tst_qdesktopservices : public QObject
{
Q_OBJECT
@@ -65,6 +42,10 @@ public slots:
}
};
+#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
+# define CAN_IMPLICITLY_UNSET
+#endif
+
void tst_qdesktopservices::handlers()
{
MyUrlHandler fooHandler;
@@ -72,6 +53,12 @@ void tst_qdesktopservices::handlers()
QDesktopServices::setUrlHandler(QString("foo"), &fooHandler, "handle");
QDesktopServices::setUrlHandler(QString("bar"), &barHandler, "handle");
+#ifndef CAN_IMPLICITLY_UNSET
+ const auto unsetHandlers = qScopeGuard([] {
+ QDesktopServices::unsetUrlHandler(u"bar"_s);
+ QDesktopServices::unsetUrlHandler(u"foo"_s);
+ });
+#endif
QUrl fooUrl("foo://blub/meh");
QUrl barUrl("bar://hmm/hmmmm");
@@ -81,6 +68,15 @@ void tst_qdesktopservices::handlers()
QCOMPARE(fooHandler.lastHandledUrl.toString(), fooUrl.toString());
QCOMPARE(barHandler.lastHandledUrl.toString(), barUrl.toString());
+
+#ifdef CAN_IMPLICITLY_UNSET
+ for (int i = 0; i < 2; ++i)
+ QTest::ignoreMessage(QtWarningMsg,
+ "Please call QDesktopServices::unsetUrlHandler() before destroying a "
+ "registered URL handler object.\n"
+ "Support for destroying a registered URL handler object is deprecated, "
+ "and will be removed in Qt 6.6.");
+#endif
}
QTEST_MAIN(tst_qdesktopservices)
diff --git a/tests/auto/gui/util/qdoublevalidator/CMakeLists.txt b/tests/auto/gui/util/qdoublevalidator/CMakeLists.txt
index 27996300d7..f79fe8b00c 100644
--- a/tests/auto/gui/util/qdoublevalidator/CMakeLists.txt
+++ b/tests/auto/gui/util/qdoublevalidator/CMakeLists.txt
@@ -1,12 +1,19 @@
-# Generated from qdoublevalidator.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qdoublevalidator Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qdoublevalidator LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qdoublevalidator
SOURCES
tst_qdoublevalidator.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
)
diff --git a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
index 77d52682f6..b44975ea0b 100644
--- a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
+++ b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -168,6 +143,7 @@ void tst_QDoubleValidator::validate_data()
QTest::newRow("data56") << "C" << 1229.0 << 1231.0 << -1 << QString("123E+") << ITM << INV;
QTest::newRow("data57") << "C" << 1229.0 << 1231.0 << -1 << QString("123E+1") << ACC << INV;
QTest::newRow("data58") << "C" << 0.0 << 100.0 << -1 << QString("0.0") << ACC << ACC;
+ QTest::newRow("overlong") << "C" << 0.0 << 99.9 << 2 << QString("1234.0") << ITM << INV;
QTest::newRow("data_de0") << "de" << 0.0 << 100.0 << 1 << QString("50,0") << ACC << ACC;
QTest::newRow("data_de1") << "de" << 00.0 << 100.0 << 1 << QString("500,0") << ITM << ITM;
@@ -335,74 +311,74 @@ void tst_QDoubleValidator::notifySignals()
QCOMPARE(dv.decimals(), 10);
dv.setTop(0.8);
- QCOMPARE(topSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 1);
+ QCOMPARE(topSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 1);
QCOMPARE(dv.top(), 0.8);
dv.setBottom(0.2);
- QCOMPARE(bottomSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 2);
+ QCOMPARE(bottomSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 2);
QCOMPARE(dv.bottom(), 0.2);
dv.setRange(0.2, 0.7);
- QCOMPARE(topSpy.count(), 2);
- QCOMPARE(bottomSpy.count(), 1);
- QCOMPARE(decSpy.count(), 0);
- QCOMPARE(changedSpy.count(), 3);
+ QCOMPARE(topSpy.size(), 2);
+ QCOMPARE(bottomSpy.size(), 1);
+ QCOMPARE(decSpy.size(), 0);
+ QCOMPARE(changedSpy.size(), 3);
QCOMPARE(dv.bottom(), 0.2);
QCOMPARE(dv.top(), 0.7);
QCOMPARE(dv.decimals(), 10);
dv.setRange(0.3, 0.7);
- QCOMPARE(topSpy.count(), 2);
- QCOMPARE(bottomSpy.count(), 2);
- QCOMPARE(changedSpy.count(), 4);
+ QCOMPARE(topSpy.size(), 2);
+ QCOMPARE(bottomSpy.size(), 2);
+ QCOMPARE(changedSpy.size(), 4);
QCOMPARE(dv.bottom(), 0.3);
QCOMPARE(dv.top(), 0.7);
QCOMPARE(dv.decimals(), 10);
dv.setRange(0.4, 0.6);
- QCOMPARE(topSpy.count(), 3);
- QCOMPARE(bottomSpy.count(), 3);
- QCOMPARE(changedSpy.count(), 5);
+ QCOMPARE(topSpy.size(), 3);
+ QCOMPARE(bottomSpy.size(), 3);
+ QCOMPARE(changedSpy.size(), 5);
QCOMPARE(dv.bottom(), 0.4);
QCOMPARE(dv.top(), 0.6);
QCOMPARE(dv.decimals(), 10);
dv.setDecimals(5);
- QCOMPARE(decSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 6);
+ QCOMPARE(decSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 6);
QCOMPARE(dv.decimals(), 5);
dv.setRange(0.4, 0.6, 100);
- QCOMPARE(topSpy.count(), 3);
- QCOMPARE(bottomSpy.count(), 3);
- QCOMPARE(decSpy.count(), 2);
- QCOMPARE(changedSpy.count(), 7);
+ QCOMPARE(topSpy.size(), 3);
+ QCOMPARE(bottomSpy.size(), 3);
+ QCOMPARE(decSpy.size(), 2);
+ QCOMPARE(changedSpy.size(), 7);
QCOMPARE(dv.bottom(), 0.4);
QCOMPARE(dv.top(), 0.6);
QCOMPARE(dv.decimals(), 100);
dv.setNotation(QDoubleValidator::StandardNotation);
- QCOMPARE(notSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 8);
+ QCOMPARE(notSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 8);
QCOMPARE(dv.notation(), QDoubleValidator::StandardNotation);
dv.setRange(dv.bottom(), dv.top(), dv.decimals());
- QCOMPARE(topSpy.count(), 3);
- QCOMPARE(bottomSpy.count(), 3);
- QCOMPARE(decSpy.count(), 2);
- QCOMPARE(changedSpy.count(), 8);
+ QCOMPARE(topSpy.size(), 3);
+ QCOMPARE(bottomSpy.size(), 3);
+ QCOMPARE(decSpy.size(), 2);
+ QCOMPARE(changedSpy.size(), 8);
dv.setNotation(dv.notation());
- QCOMPARE(notSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 8);
+ QCOMPARE(notSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 8);
dv.setLocale(QLocale("C"));
- QCOMPARE(changedSpy.count(), 8);
+ QCOMPARE(changedSpy.size(), 8);
dv.setLocale(QLocale("en"));
- QCOMPARE(changedSpy.count(), 9);
+ QCOMPARE(changedSpy.size(), 9);
}
void tst_QDoubleValidator::fixup()
@@ -441,7 +417,7 @@ void tst_QDoubleValidator::fixup_data()
QTest::newRow("C standard with invalid digit grouping")
<< "C" << QDoubleValidator::StandardNotation << -1 << "1,234,5.678"
<< "12345.678";
- QTest::newRow("C standard with invalid number of decimals")
+ QTest::newRow("C standard with invalid group size")
<< "C" << QDoubleValidator::StandardNotation << 2 << "-12,34.678"
<< "-1234.68";
QTest::newRow("C standard truncate decimals")
@@ -470,7 +446,7 @@ void tst_QDoubleValidator::fixup_data()
QTest::newRow("C scientific with invalid digit grouping")
<< "C" << QDoubleValidator::ScientificNotation << -1 << "12,34.98765e2"
<< "1.23498765e+05";
- QTest::newRow("C scientific with invalid number of decimals")
+ QTest::newRow("C scientific with invalid group size")
<< "C" << QDoubleValidator::ScientificNotation << 2 << "-12,34.98765e2"
<< "-1.23e+05";
QTest::newRow("C scientific truncate decimals")
@@ -510,7 +486,7 @@ void tst_QDoubleValidator::fixup_data()
QTest::newRow("en standard with invalid digit grouping")
<< "en" << QDoubleValidator::StandardNotation << -1 << "-1,234,5.678"
<< "-12,345.678";
- QTest::newRow("en standard with invalid number of decimals")
+ QTest::newRow("en standard with invalid group size")
<< "en" << QDoubleValidator::StandardNotation << 2 << "12,34.678"
<< "1,234.68";
QTest::newRow("en standard no fractional part")
@@ -526,7 +502,7 @@ void tst_QDoubleValidator::fixup_data()
QTest::newRow("en scientific with invalid digit grouping")
<< "en" << QDoubleValidator::ScientificNotation << -1 << "-12,34.98765e2"
<< "-1.23498765E+05";
- QTest::newRow("en scientific with invalid number of decimals")
+ QTest::newRow("en scientific with invalid group size")
<< "en" << QDoubleValidator::ScientificNotation << 2 << "12,34.98765e2"
<< "1.23E+05";
QTest::newRow("en scientific no fractional part")
@@ -553,7 +529,7 @@ void tst_QDoubleValidator::fixup_data()
QTest::newRow("de standard with invalid digit grouping")
<< "de" << QDoubleValidator::StandardNotation << -1 << "1.234.5,678"
<< "12.345,678";
- QTest::newRow("de standard with invalid number of decimals")
+ QTest::newRow("de standard with invalid group size")
<< "de" << QDoubleValidator::StandardNotation << 2 << "-12.34,678"
<< "-1.234,68";
QTest::newRow("de standard no fractional part")
@@ -568,7 +544,7 @@ void tst_QDoubleValidator::fixup_data()
QTest::newRow("de scientific with invalid digit grouping")
<< "de" << QDoubleValidator::ScientificNotation << -1 << "12.34,98765e2"
<< "1,23498765E+05";
- QTest::newRow("de scientific with invalid number of decimals")
+ QTest::newRow("de scientific with invalid group size")
<< "de" << QDoubleValidator::ScientificNotation << 2 << "-12.34,98765e2"
<< "-1,23E+05";
QTest::newRow("de scientific no fractional part")
@@ -584,6 +560,22 @@ void tst_QDoubleValidator::fixup_data()
<< "de" << QDoubleValidator::ScientificNotation << -1 << "-12.34"
<< "-1,234E+03";
+ // es locale uses ',' as decimal point and '.' as grouping separator.
+ // It doesn't apply grouping unless the the next-to-least significant group
+ // has more than one digit in it.
+ QTest::newRow("es standard no digit grouping")
+ << "es" << QDoubleValidator::StandardNotation << -1 << "1234,567" << "1234,567";
+ QTest::newRow("es standard with digit grouping")
+ << "es" << QDoubleValidator::StandardNotation << -1 << "-12.345,678" << "-12.345,678";
+ QTest::newRow("es standard with invalid group size")
+ << "es" << QDoubleValidator::StandardNotation << -1 << "1.234.5,678" << "12.345,678";
+ QTest::newRow("es standard with invalid digit grouping")
+ << "es" << QDoubleValidator::StandardNotation << 2 << "-1.234,678" << "-1234,68";
+ QTest::newRow("es standard big with invalid digit grouping")
+ << "es" << QDoubleValidator::StandardNotation << 2 << "-1234.678,9" << "-1.234.678,9";
+ QTest::newRow("es standard no fractional part")
+ << "es" << QDoubleValidator::StandardNotation << -1 << "12.34" << "1234";
+
// hi locale uses '.' as decimal point and ',' as grouping separator.
// The rightmost group is of three digits, all the others contain two
// digits.
@@ -666,7 +658,7 @@ void tst_QDoubleValidator::setRangeOverloads_data()
QTest::newRow("scientific, 1 digits after point")
<< QDoubleValidator::ScientificNotation << -1 << -100.0 << 100.0 << 0
<< QString("1.2e1") << ACC << INV;
- QTest::newRow("scientific, 3 digits after point, not in range")
+ QTest::newRow("scientific, 3 digits after point, demand fewer")
<< QDoubleValidator::ScientificNotation << 3 << -100.0 << 100.0 << 1
<< QString("10.234e-1") << ACC << INV;
QTest::newRow("scientific, 3 digits after point, not in range")
diff --git a/tests/auto/gui/util/qintvalidator/CMakeLists.txt b/tests/auto/gui/util/qintvalidator/CMakeLists.txt
index 83891a3541..841b83a8e0 100644
--- a/tests/auto/gui/util/qintvalidator/CMakeLists.txt
+++ b/tests/auto/gui/util/qintvalidator/CMakeLists.txt
@@ -1,12 +1,19 @@
-# Generated from qintvalidator.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qintvalidator Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qintvalidator LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qintvalidator
SOURCES
tst_qintvalidator.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
)
diff --git a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
index 48b04cef14..bfa69c90b8 100644
--- a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -190,8 +165,10 @@ void tst_QIntValidator::validateFrench()
QIntValidator validator(-2000, 2000, 0);
validator.setLocale(QLocale::French);
int i;
+ // Grouping separator is a narrow no-break space; QLocale accepts a space as it.
QString s = QLatin1String("1 ");
- QCOMPARE(validator.validate(s, i), QValidator::Acceptable);
+ // Shouldn't end with a group separator
+ QCOMPARE(validator.validate(s, i), QValidator::Intermediate);
validator.fixup(s);
QCOMPARE(s, s);
@@ -236,45 +213,45 @@ void tst_QIntValidator::notifySignals()
QSignalSpy changedSpy(&iv, SIGNAL(changed()));
iv.setTop(9);
- QCOMPARE(topSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 1);
+ QCOMPARE(topSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 1);
QCOMPARE(iv.top(), 9);
iv.setBottom(1);
- QCOMPARE(bottomSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 2);
+ QCOMPARE(bottomSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 2);
QCOMPARE(iv.bottom(), 1);
iv.setRange(1, 8);
- QCOMPARE(topSpy.count(), 2);
- QCOMPARE(bottomSpy.count(), 1);
- QCOMPARE(changedSpy.count(), 3);
+ QCOMPARE(topSpy.size(), 2);
+ QCOMPARE(bottomSpy.size(), 1);
+ QCOMPARE(changedSpy.size(), 3);
QCOMPARE(iv.top(), 8);
QCOMPARE(iv.bottom(), 1);
iv.setRange(2, 8);
- QCOMPARE(topSpy.count(), 2);
- QCOMPARE(bottomSpy.count(), 2);
- QCOMPARE(changedSpy.count(), 4);
+ QCOMPARE(topSpy.size(), 2);
+ QCOMPARE(bottomSpy.size(), 2);
+ QCOMPARE(changedSpy.size(), 4);
QCOMPARE(iv.top(), 8);
QCOMPARE(iv.bottom(), 2);
iv.setRange(3, 7);
- QCOMPARE(topSpy.count(), 3);
- QCOMPARE(bottomSpy.count(), 3);
- QCOMPARE(changedSpy.count(), 5);
+ QCOMPARE(topSpy.size(), 3);
+ QCOMPARE(bottomSpy.size(), 3);
+ QCOMPARE(changedSpy.size(), 5);
QCOMPARE(iv.top(), 7);
QCOMPARE(iv.bottom(), 3);
iv.setRange(3, 7);
- QCOMPARE(topSpy.count(), 3);
- QCOMPARE(bottomSpy.count(), 3);
- QCOMPARE(changedSpy.count(), 5);
+ QCOMPARE(topSpy.size(), 3);
+ QCOMPARE(bottomSpy.size(), 3);
+ QCOMPARE(changedSpy.size(), 5);
iv.setLocale(QLocale("C"));
- QCOMPARE(changedSpy.count(), 5);
+ QCOMPARE(changedSpy.size(), 5);
iv.setLocale(QLocale("en"));
- QCOMPARE(changedSpy.count(), 6);
+ QCOMPARE(changedSpy.size(), 6);
}
void tst_QIntValidator::fixup()
@@ -331,9 +308,9 @@ void tst_QIntValidator::fixup_data()
// Normally the groups contain three digits, but the leftmost group should
// have at least two digits.
QTest::newRow("es no digit grouping 1000") << "es" << "1000" << "1000";
- QTest::newRow("es no digit grouping 10000") << "es" << "10000" << "10.000";
- QTest::newRow("es with digit grouping") << "es" << "1000.000" << "1000.000";
- QTest::newRow("es invalid digit grouping") << "es" << "1.000.000" << "1000.000";
+ QTest::newRow("es with digit grouping 10000") << "es" << "10000" << "10.000";
+ QTest::newRow("es with digit grouping million") << "es" << "1.000.000" << "1.000.000";
+ QTest::newRow("es invalid digit grouping") << "es" << "1000.000" << "1.000.000";
}
QTEST_APPLESS_MAIN(tst_QIntValidator)
diff --git a/tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt b/tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt
index 9caf7a1596..1d48205537 100644
--- a/tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt
+++ b/tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt
@@ -1,12 +1,19 @@
-# Generated from qregularexpressionvalidator.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qregularexpressionvalidator Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qregularexpressionvalidator LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qregularexpressionvalidator
SOURCES
tst_qregularexpressionvalidator.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
)
diff --git a/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp b/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp
index 0d1d748e00..17f9e6a1bd 100644
--- a/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp
+++ b/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp
@@ -1,31 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtGui/QRegularExpressionValidator>
#include <QTest>
@@ -98,12 +73,12 @@ void tst_QRegularExpressionValidator::validate()
QTEST(result, "state");
if (result == QValidator::Invalid)
- QCOMPARE(pos, value.length());
+ QCOMPARE(pos, value.size());
else
QCOMPARE(pos, -1); // ensure pos is not modified if validate returned Acceptable or Intermediate
- QCOMPARE(spy.count(), signalCount);
- QCOMPARE(changedSpy.count(), signalCount);
+ QCOMPARE(spy.size(), signalCount);
+ QCOMPARE(changedSpy.size(), signalCount);
}
QTEST_GUILESS_MAIN(tst_QRegularExpressionValidator)
diff --git a/tests/auto/gui/util/qtexturefilereader/CMakeLists.txt b/tests/auto/gui/util/qtexturefilereader/CMakeLists.txt
index de809f577d..70e2c02417 100644
--- a/tests/auto/gui/util/qtexturefilereader/CMakeLists.txt
+++ b/tests/auto/gui/util/qtexturefilereader/CMakeLists.txt
@@ -1,16 +1,15 @@
-# Generated from qtexturefilereader.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qtexturefilereader Test:
#####################################################################
-qt_internal_add_test(tst_qtexturefilereader
- SOURCES
- tst_qtexturefilereader.cpp
- PUBLIC_LIBRARIES
- Qt::Gui
- Qt::GuiPrivate
-)
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qtexturefilereader LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
# Resources:
set(qtexturefilereader_resource_files
@@ -18,15 +17,19 @@ set(qtexturefilereader_resource_files
"texturefiles/car_mips.ktx"
"texturefiles/cubemap_float32_rgba.ktx"
"texturefiles/cubemap_metadata.ktx"
+ "texturefiles/invalid.ktx"
"texturefiles/newlogo.astc"
"texturefiles/newlogo_srgb.astc"
"texturefiles/pattern.pkm"
)
-qt_internal_add_resource(tst_qtexturefilereader "qtexturefilereader"
- PREFIX
- "/"
- FILES
- ${qtexturefilereader_resource_files}
+qt_internal_add_test(tst_qtexturefilereader
+ SOURCES
+ tst_qtexturefilereader.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::GuiPrivate
+ TESTDATA ${qtexturefilereader_resource_files}
+ BUILTIN_TESTDATA
)
diff --git a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc
deleted file mode 100644
index c4cef6cc44..0000000000
--- a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc
+++ /dev/null
@@ -1,11 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>texturefiles/car.ktx</file>
- <file>texturefiles/cubemap_float32_rgba.ktx</file>
- <file>texturefiles/cubemap_metadata.ktx</file>
- <file>texturefiles/pattern.pkm</file>
- <file>texturefiles/car_mips.ktx</file>
- <file>texturefiles/newlogo_srgb.astc</file>
- <file>texturefiles/newlogo.astc</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/invalid.ktx b/tests/auto/gui/util/qtexturefilereader/texturefiles/invalid.ktx
new file mode 100644
index 0000000000..68a92221db
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/invalid.ktx
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
index 89144eb245..62760e3844 100644
--- a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
+++ b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <private/qtexturefilereader_p.h>
#include <QTest>
@@ -36,6 +11,7 @@ class tst_qtexturefilereader : public QObject
private slots:
void checkHandlers_data();
void checkHandlers();
+ void checkInvalid();
void checkMetadata();
};
@@ -165,6 +141,18 @@ void tst_qtexturefilereader::checkMetadata()
QCOMPARE(kvs.value("test C"), QByteArrayLiteral("3\x0000"));
}
+void tst_qtexturefilereader::checkInvalid()
+{
+ QFile f(":/texturefiles/invalid.ktx");
+ QVERIFY(f.open(QIODevice::ReadOnly));
+ QTextureFileReader r(&f);
+ QTextureFileData d = r.read();
+ auto kvs = d.keyValueMetadata();
+
+ // Basically just checking that we don't crash on and invalid file
+ QVERIFY(kvs.empty());
+}
+
QTEST_MAIN(tst_qtexturefilereader)
#include "tst_qtexturefilereader.moc"
diff --git a/tests/auto/gui/util/qundogroup/CMakeLists.txt b/tests/auto/gui/util/qundogroup/CMakeLists.txt
index c1396326f7..98c2f64f88 100644
--- a/tests/auto/gui/util/qundogroup/CMakeLists.txt
+++ b/tests/auto/gui/util/qundogroup/CMakeLists.txt
@@ -1,12 +1,19 @@
-# Generated from qundogroup.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qundogroup Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qundogroup LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qundogroup
SOURCES
tst_qundogroup.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
)
diff --git a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
index c609ab4ffd..36f72b2ca0 100644
--- a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
#include <QUndoGroup>
#include <QUndoStack>
@@ -90,7 +65,7 @@ InsertCommand::InsertCommand(QString *str, int idx, const QString &text,
QUndoCommand *parent)
: QUndoCommand(parent)
{
- QVERIFY(str->length() >= idx);
+ QVERIFY(str->size() >= idx);
setText("insert");
@@ -101,22 +76,22 @@ InsertCommand::InsertCommand(QString *str, int idx, const QString &text,
void InsertCommand::redo()
{
- QVERIFY(m_str->length() >= m_idx);
+ QVERIFY(m_str->size() >= m_idx);
m_str->insert(m_idx, m_text);
}
void InsertCommand::undo()
{
- QCOMPARE(m_str->mid(m_idx, m_text.length()), m_text);
+ QCOMPARE(m_str->mid(m_idx, m_text.size()), m_text);
- m_str->remove(m_idx, m_text.length());
+ m_str->remove(m_idx, m_text.size());
}
RemoveCommand::RemoveCommand(QString *str, int idx, int len, QUndoCommand *parent)
: QUndoCommand(parent)
{
- QVERIFY(str->length() >= idx + len);
+ QVERIFY(str->size() >= idx + len);
setText("remove");
@@ -127,14 +102,14 @@ RemoveCommand::RemoveCommand(QString *str, int idx, int len, QUndoCommand *paren
void RemoveCommand::redo()
{
- QCOMPARE(m_str->mid(m_idx, m_text.length()), m_text);
+ QCOMPARE(m_str->mid(m_idx, m_text.size()), m_text);
- m_str->remove(m_idx, m_text.length());
+ m_str->remove(m_idx, m_text.size());
}
void RemoveCommand::undo()
{
- QVERIFY(m_str->length() >= m_idx);
+ QVERIFY(m_str->size() >= m_idx);
m_str->insert(m_idx, m_text);
}
@@ -156,9 +131,9 @@ void AppendCommand::redo()
void AppendCommand::undo()
{
- QCOMPARE(m_str->mid(m_str->length() - m_text.length()), m_text);
+ QCOMPARE(m_str->mid(m_str->size() - m_text.size()), m_text);
- m_str->truncate(m_str->length() - m_text.length());
+ m_str->truncate(m_str->size() - m_text.size());
}
int AppendCommand::id() const
diff --git a/tests/auto/gui/util/qundostack/CMakeLists.txt b/tests/auto/gui/util/qundostack/CMakeLists.txt
index 0e56171add..de36f4a1ad 100644
--- a/tests/auto/gui/util/qundostack/CMakeLists.txt
+++ b/tests/auto/gui/util/qundostack/CMakeLists.txt
@@ -1,12 +1,19 @@
-# Generated from qundostack.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qundostack Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qundostack LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qundostack
SOURCES
tst_qundostack.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
)
diff --git a/tests/auto/gui/util/qundostack/tst_qundostack.cpp b/tests/auto/gui/util/qundostack/tst_qundostack.cpp
index 6707c12d80..3567bc6097 100644
--- a/tests/auto/gui/util/qundostack/tst_qundostack.cpp
+++ b/tests/auto/gui/util/qundostack/tst_qundostack.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -122,7 +97,7 @@ InsertCommand::InsertCommand(QString *str, int idx, const QString &text,
QUndoCommand *parent)
: QUndoCommand(parent)
{
- QVERIFY(str->length() >= idx);
+ QVERIFY(str->size() >= idx);
setText("insert");
@@ -133,22 +108,22 @@ InsertCommand::InsertCommand(QString *str, int idx, const QString &text,
void InsertCommand::redo()
{
- QVERIFY(m_str->length() >= m_idx);
+ QVERIFY(m_str->size() >= m_idx);
m_str->insert(m_idx, m_text);
}
void InsertCommand::undo()
{
- QCOMPARE(m_str->mid(m_idx, m_text.length()), m_text);
+ QCOMPARE(m_str->mid(m_idx, m_text.size()), m_text);
- m_str->remove(m_idx, m_text.length());
+ m_str->remove(m_idx, m_text.size());
}
RemoveCommand::RemoveCommand(QString *str, int idx, int len, QUndoCommand *parent)
: QUndoCommand(parent)
{
- QVERIFY(str->length() >= idx + len);
+ QVERIFY(str->size() >= idx + len);
setText("remove");
@@ -159,14 +134,14 @@ RemoveCommand::RemoveCommand(QString *str, int idx, int len, QUndoCommand *paren
void RemoveCommand::redo()
{
- QCOMPARE(m_str->mid(m_idx, m_text.length()), m_text);
+ QCOMPARE(m_str->mid(m_idx, m_text.size()), m_text);
- m_str->remove(m_idx, m_text.length());
+ m_str->remove(m_idx, m_text.size());
}
void RemoveCommand::undo()
{
- QVERIFY(m_str->length() >= m_idx);
+ QVERIFY(m_str->size() >= m_idx);
m_str->insert(m_idx, m_text);
}
@@ -197,9 +172,9 @@ void AppendCommand::redo()
void AppendCommand::undo()
{
- QCOMPARE(m_str->mid(m_str->length() - m_text.length()), m_text);
+ QCOMPARE(m_str->mid(m_str->size() - m_text.size()), m_text);
- m_str->truncate(m_str->length() - m_text.length());
+ m_str->truncate(m_str->size() - m_text.size());
}
int AppendCommand::id() const
@@ -349,44 +324,44 @@ static void checkState(QSignalSpy &redoTextChangedSpy,
QCOMPARE(stack.canRedo(), _canRedo);
QCOMPARE(stack.redoText(), QString(_redoText));
if (_indexChanged) {
- QCOMPARE(indexChangedSpy.count(), 1);
+ QCOMPARE(indexChangedSpy.size(), 1);
QCOMPARE(indexChangedSpy.at(0).at(0).toInt(), _index);
indexChangedSpy.clear();
} else {
- QCOMPARE(indexChangedSpy.count(), 0);
+ QCOMPARE(indexChangedSpy.size(), 0);
}
if (_cleanChanged) {
- QCOMPARE(cleanChangedSpy.count(), 1);
+ QCOMPARE(cleanChangedSpy.size(), 1);
QCOMPARE(cleanChangedSpy.at(0).at(0).toBool(), _clean);
cleanChangedSpy.clear();
} else {
- QCOMPARE(cleanChangedSpy.count(), 0);
+ QCOMPARE(cleanChangedSpy.size(), 0);
}
if (_undoChanged) {
- QCOMPARE(canUndoChangedSpy.count(), 1);
+ QCOMPARE(canUndoChangedSpy.size(), 1);
QCOMPARE(canUndoChangedSpy.at(0).at(0).toBool(), _canUndo);
QCOMPARE(undoAction->isEnabled(), _canUndo);
- QCOMPARE(undoTextChangedSpy.count(), 1);
+ QCOMPARE(undoTextChangedSpy.size(), 1);
QCOMPARE(undoTextChangedSpy.at(0).at(0).toString(), QString(_undoText));
QCOMPARE(undoAction->text(), glue("foo", _undoText));
canUndoChangedSpy.clear();
undoTextChangedSpy.clear();
} else {
- QCOMPARE(canUndoChangedSpy.count(), 0);
- QCOMPARE(undoTextChangedSpy.count(), 0);
+ QCOMPARE(canUndoChangedSpy.size(), 0);
+ QCOMPARE(undoTextChangedSpy.size(), 0);
}
if (_redoChanged) {
- QCOMPARE(canRedoChangedSpy.count(), 1);
+ QCOMPARE(canRedoChangedSpy.size(), 1);
QCOMPARE(canRedoChangedSpy.at(0).at(0).toBool(), _canRedo);
QCOMPARE(redoAction->isEnabled(), _canRedo);
- QCOMPARE(redoTextChangedSpy.count(), 1);
+ QCOMPARE(redoTextChangedSpy.size(), 1);
QCOMPARE(redoTextChangedSpy.at(0).at(0).toString(), QString(_redoText));
QCOMPARE(redoAction->text(), glue("bar", _redoText));
canRedoChangedSpy.clear();
redoTextChangedSpy.clear();
} else {
- QCOMPARE(canRedoChangedSpy.count(), 0);
- QCOMPARE(redoTextChangedSpy.count(), 0);
+ QCOMPARE(canRedoChangedSpy.size(), 0);
+ QCOMPARE(redoTextChangedSpy.size(), 0);
}
}