diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-03-15 18:12:39 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-03-17 08:35:50 +0100 |
commit | dee55af0a5359bb3b57a89cf3065ffca9d8506da (patch) | |
tree | ae849c37c5b43e4c2818d506077bacce5f28629f /tests/auto/gui/util | |
parent | befd198c15b7a2b95f539372d2557063b6b397a6 (diff) |
Remove QRegExpValidator
As QRegExp will be moved to a compat library in Qt 6.
Change-Id: I181aec45bd798f49d2c50a0e7fb64782e004b854
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'tests/auto/gui/util')
-rw-r--r-- | tests/auto/gui/util/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/gui/util/qregexpvalidator/.gitignore | 1 | ||||
-rw-r--r-- | tests/auto/gui/util/qregexpvalidator/CMakeLists.txt | 12 | ||||
-rw-r--r-- | tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro | 4 | ||||
-rw-r--r-- | tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp | 93 | ||||
-rw-r--r-- | tests/auto/gui/util/util.pro | 1 |
6 files changed, 0 insertions, 112 deletions
diff --git a/tests/auto/gui/util/CMakeLists.txt b/tests/auto/gui/util/CMakeLists.txt index 4e0a6b7e25..1c4a53265d 100644 --- a/tests/auto/gui/util/CMakeLists.txt +++ b/tests/auto/gui/util/CMakeLists.txt @@ -3,7 +3,6 @@ add_subdirectory(qdesktopservices) add_subdirectory(qdoublevalidator) add_subdirectory(qintvalidator) -add_subdirectory(qregexpvalidator) add_subdirectory(qregularexpressionvalidator) add_subdirectory(qshadergenerator) add_subdirectory(qshadergraph) diff --git a/tests/auto/gui/util/qregexpvalidator/.gitignore b/tests/auto/gui/util/qregexpvalidator/.gitignore deleted file mode 100644 index cff9b076b2..0000000000 --- a/tests/auto/gui/util/qregexpvalidator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qregexpvalidator diff --git a/tests/auto/gui/util/qregexpvalidator/CMakeLists.txt b/tests/auto/gui/util/qregexpvalidator/CMakeLists.txt deleted file mode 100644 index 4f7d7da0c2..0000000000 --- a/tests/auto/gui/util/qregexpvalidator/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Generated from qregexpvalidator.pro. - -##################################################################### -## tst_qregexpvalidator Test: -##################################################################### - -add_qt_test(tst_qregexpvalidator - SOURCES - tst_qregexpvalidator.cpp - PUBLIC_LIBRARIES - Qt::Gui -) diff --git a/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro b/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro deleted file mode 100644 index 8f1de5b747..0000000000 --- a/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qregexpvalidator -SOURCES += tst_qregexpvalidator.cpp -QT += testlib diff --git a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp b/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp deleted file mode 100644 index fbb4f0b4ea..0000000000 --- a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - - -#include <QtTest/QtTest> -#include <qregexp.h> - - -#include <qvalidator.h> - -class tst_QRegExpValidator : public QObject -{ - Q_OBJECT - -private slots: - void validate_data(); - void validate(); -}; - -void tst_QRegExpValidator::validate_data() -{ - - QTest::addColumn<QString>("rx"); - QTest::addColumn<QString>("value"); - QTest::addColumn<int>("state"); - - QTest::newRow( "data0" ) << QString("[1-9]\\d{0,3}") << QString("0") << 0; - QTest::newRow( "data1" ) << QString("[1-9]\\d{0,3}") << QString("12345") << 0; - QTest::newRow( "data2" ) << QString("[1-9]\\d{0,3}") << QString("1") << 2; - - QTest::newRow( "data3" ) << QString("\\S+") << QString("myfile.txt") << 2; - QTest::newRow( "data4" ) << QString("\\S+") << QString("my file.txt") << 0; - - QTest::newRow( "data5" ) << QString("[A-C]\\d{5}[W-Z]") << QString("a12345Z") << 0; - QTest::newRow( "data6" ) << QString("[A-C]\\d{5}[W-Z]") << QString("A12345Z") << 2; - QTest::newRow( "data7" ) << QString("[A-C]\\d{5}[W-Z]") << QString("B12") << 1; - - QTest::newRow( "data8" ) << QString("read\\S?me(\\.(txt|asc|1st))?") << QString("readme") << 2; - QTest::newRow( "data9" ) << QString("read\\S?me(\\.(txt|asc|1st))?") << QString("read me.txt") << 0; - QTest::newRow( "data10" ) << QString("read\\S?me(\\.(txt|asc|1st))?") << QString("readm") << 1; -} - -void tst_QRegExpValidator::validate() -{ - QFETCH( QString, rx ); - QFETCH( QString, value ); - QFETCH( int, state ); - - QRegExpValidator rv( 0 ); - QSignalSpy spy(&rv, SIGNAL(regExpChanged(QRegExp))); - QSignalSpy changedSpy(&rv, SIGNAL(changed())); - - rv.setRegExp( QRegExp( rx ) ); - int pos = -1; - - QCOMPARE( (int)rv.validate( value, pos ), state ); - - if (state == QValidator::Invalid) - QCOMPARE(pos, value.length()); - else - QCOMPARE(pos, -1); // untouched on Acceptable or Intermediate - - QCOMPARE(spy.count(), 1); - QCOMPARE(changedSpy.count(), 1); -} - -QTEST_APPLESS_MAIN(tst_QRegExpValidator) -#include "tst_qregexpvalidator.moc" diff --git a/tests/auto/gui/util/util.pro b/tests/auto/gui/util/util.pro index 2789ffb55d..961424cc35 100644 --- a/tests/auto/gui/util/util.pro +++ b/tests/auto/gui/util/util.pro @@ -3,7 +3,6 @@ SUBDIRS= \ qdesktopservices \ qdoublevalidator \ qintvalidator \ - qregexpvalidator \ qregularexpressionvalidator \ qshadergenerator \ qshadergraph \ |