diff options
Diffstat (limited to 'tests/auto')
592 files changed, 2331 insertions, 2132 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 9cab3c9e42..e905a416a6 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -22,7 +22,7 @@ installed_cmake.depends = cmake ios: SUBDIRS = corelib gui wince: SUBDIRS -= printsupport -cross_compile: SUBDIRS -= tools +cross_compile: SUBDIRS -= tools cmake installed_cmake !qtHaveModule(opengl): SUBDIRS -= opengl !qtHaveModule(gui): SUBDIRS -= gui cmake !qtHaveModule(widgets): SUBDIRS -= widgets diff --git a/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro index e82d101de0..f3684faa61 100644 --- a/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro +++ b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtconcurrentfilter QT = core testlib concurrent SOURCES = tst_qtconcurrentfilter.cpp diff --git a/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro b/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro index 4cfebc0e3d..f599372c6f 100644 --- a/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtconcurrentiteratekernel QT = core testlib concurrent SOURCES = tst_qtconcurrentiteratekernel.cpp diff --git a/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro index 199e5ad4d6..3af207ae5a 100644 --- a/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro +++ b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtconcurrentmap QT = core testlib concurrent SOURCES = tst_qtconcurrentmap.cpp diff --git a/tests/auto/concurrent/qtconcurrentmedian/qtconcurrentmedian.pro b/tests/auto/concurrent/qtconcurrentmedian/qtconcurrentmedian.pro index 1eb27d825a..0d07642028 100644 --- a/tests/auto/concurrent/qtconcurrentmedian/qtconcurrentmedian.pro +++ b/tests/auto/concurrent/qtconcurrentmedian/qtconcurrentmedian.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtconcurrentmedian QT = core testlib concurrent SOURCES = tst_qtconcurrentmedian.cpp diff --git a/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro b/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro index 03d77b33a2..f60462f9ed 100644 --- a/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro +++ b/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtconcurrentrun QT = core testlib concurrent SOURCES = tst_qtconcurrentrun.cpp diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro b/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro index f6ddd33504..b98b8f56e8 100644 --- a/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro +++ b/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtconcurrentthreadengine QT = core testlib concurrent SOURCES = tst_qtconcurrentthreadengine.cpp diff --git a/tests/auto/corelib/animation/qabstractanimation/qabstractanimation.pro b/tests/auto/corelib/animation/qabstractanimation/qabstractanimation.pro index 7ec9c5f574..32701c2c9c 100644 --- a/tests/auto/corelib/animation/qabstractanimation/qabstractanimation.pro +++ b/tests/auto/corelib/animation/qabstractanimation/qabstractanimation.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qabstractanimation QT = core testlib SOURCES = tst_qabstractanimation.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/animation/qanimationgroup/qanimationgroup.pro b/tests/auto/corelib/animation/qanimationgroup/qanimationgroup.pro index a5e898b395..f4b5747216 100644 --- a/tests/auto/corelib/animation/qanimationgroup/qanimationgroup.pro +++ b/tests/auto/corelib/animation/qanimationgroup/qanimationgroup.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qanimationgroup QT = core testlib SOURCES = tst_qanimationgroup.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/qparallelanimationgroup.pro b/tests/auto/corelib/animation/qparallelanimationgroup/qparallelanimationgroup.pro index 23343f27f5..5b4c6ab90a 100644 --- a/tests/auto/corelib/animation/qparallelanimationgroup/qparallelanimationgroup.pro +++ b/tests/auto/corelib/animation/qparallelanimationgroup/qparallelanimationgroup.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qparallelanimationgroup QT = core testlib SOURCES = tst_qparallelanimationgroup.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp index d963c5173e..640f58c532 100644 --- a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp +++ b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp @@ -491,7 +491,7 @@ void tst_QParallelAnimationGroup::deleteChildrenWithRunningGroup() QVERIFY(group.currentLoopTime() > 0); delete anim1; - QVERIFY(group.animationCount() == 0); + QCOMPARE(group.animationCount(), 0); QCOMPARE(group.duration(), 0); QCOMPARE(group.state(), QAnimationGroup::Stopped); QCOMPARE(group.currentLoopTime(), 0); //that's the invariant diff --git a/tests/auto/corelib/animation/qpauseanimation/qpauseanimation.pro b/tests/auto/corelib/animation/qpauseanimation/qpauseanimation.pro index 4c2dd02951..7f19bc7545 100644 --- a/tests/auto/corelib/animation/qpauseanimation/qpauseanimation.pro +++ b/tests/auto/corelib/animation/qpauseanimation/qpauseanimation.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpauseanimation QT = core-private testlib SOURCES = tst_qpauseanimation.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp index db58c797d3..06667df489 100644 --- a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp +++ b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp @@ -114,10 +114,10 @@ void tst_QPauseAnimation::changeDirectionWhileRunning() animation.setDuration(400); animation.start(); QTest::qWait(100); - QVERIFY(animation.state() == QAbstractAnimation::Running); + QCOMPARE(animation.state(), QAbstractAnimation::Running); animation.setDirection(QAbstractAnimation::Backward); QTest::qWait(animation.totalDuration() + 50); - QVERIFY(animation.state() == QAbstractAnimation::Stopped); + QCOMPARE(animation.state(), QAbstractAnimation::Stopped); } void tst_QPauseAnimation::noTimerUpdates_data() @@ -149,7 +149,7 @@ void tst_QPauseAnimation::noTimerUpdates() QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(animation.state() == QAbstractAnimation::Stopped); + QCOMPARE(animation.state(), QAbstractAnimation::Stopped); const int expectedLoopCount = 1 + loopCount; #ifdef BAD_TIMER_RESOLUTION @@ -177,13 +177,13 @@ void tst_QPauseAnimation::multiplePauseAnimations() if (animation.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(animation.state() == QAbstractAnimation::Stopped); + QCOMPARE(animation.state(), QAbstractAnimation::Stopped); #ifdef BAD_TIMER_RESOLUTION if (animation2.state() != QAbstractAnimation::Running) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(animation2.state() == QAbstractAnimation::Running); + QCOMPARE(animation2.state(), QAbstractAnimation::Running); #ifdef BAD_TIMER_RESOLUTION if (animation.m_updateCurrentTimeCount != 2) @@ -203,7 +203,7 @@ void tst_QPauseAnimation::multiplePauseAnimations() if (animation2.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(animation2.state() == QAbstractAnimation::Stopped); + QCOMPARE(animation2.state(), QAbstractAnimation::Stopped); #ifdef BAD_TIMER_RESOLUTION if (animation2.m_updateCurrentTimeCount != 3) @@ -230,8 +230,8 @@ void tst_QPauseAnimation::pauseAndPropertyAnimations() QTest::qWait(100); animation.start(); - QVERIFY(animation.state() == QAbstractAnimation::Running); - QVERIFY(pause.state() == QAbstractAnimation::Running); + QCOMPARE(animation.state(), QAbstractAnimation::Running); + QCOMPARE(pause.state(), QAbstractAnimation::Running); QCOMPARE(pause.m_updateCurrentTimeCount, 2); QTest::qWait(animation.totalDuration() + 100); @@ -240,8 +240,8 @@ void tst_QPauseAnimation::pauseAndPropertyAnimations() if (animation.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(animation.state() == QAbstractAnimation::Stopped); - QVERIFY(pause.state() == QAbstractAnimation::Stopped); + QCOMPARE(animation.state(), QAbstractAnimation::Stopped); + QCOMPARE(pause.state(), QAbstractAnimation::Stopped); QVERIFY(pause.m_updateCurrentTimeCount > 3); } @@ -250,10 +250,10 @@ void tst_QPauseAnimation::pauseResume() TestablePauseAnimation animation; animation.setDuration(400); animation.start(); - QVERIFY(animation.state() == QAbstractAnimation::Running); + QCOMPARE(animation.state(), QAbstractAnimation::Running); QTest::qWait(200); animation.pause(); - QVERIFY(animation.state() == QAbstractAnimation::Paused); + QCOMPARE(animation.state(), QAbstractAnimation::Paused); animation.start(); QTRY_COMPARE(animation.state(), QAbstractAnimation::Stopped); @@ -281,39 +281,39 @@ void tst_QPauseAnimation::sequentialPauseGroup() QCOMPARE(animation2.m_updateCurrentTimeCount, 0); QCOMPARE(animation3.m_updateCurrentTimeCount, 0); - QVERIFY(group.state() == QAbstractAnimation::Running); - QVERIFY(animation1.state() == QAbstractAnimation::Running); - QVERIFY(animation2.state() == QAbstractAnimation::Stopped); - QVERIFY(animation3.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Running); + QCOMPARE(animation1.state(), QAbstractAnimation::Running); + QCOMPARE(animation2.state(), QAbstractAnimation::Stopped); + QCOMPARE(animation3.state(), QAbstractAnimation::Stopped); group.setCurrentTime(250); QCOMPARE(animation1.m_updateCurrentTimeCount, 2); QCOMPARE(animation2.m_updateCurrentTimeCount, 1); QCOMPARE(animation3.m_updateCurrentTimeCount, 0); - QVERIFY(group.state() == QAbstractAnimation::Running); - QVERIFY(animation1.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Running); + QCOMPARE(animation1.state(), QAbstractAnimation::Stopped); QCOMPARE((QAbstractAnimation*)&animation2, group.currentAnimation()); - QVERIFY(animation2.state() == QAbstractAnimation::Running); - QVERIFY(animation3.state() == QAbstractAnimation::Stopped); + QCOMPARE(animation2.state(), QAbstractAnimation::Running); + QCOMPARE(animation3.state(), QAbstractAnimation::Stopped); group.setCurrentTime(500); QCOMPARE(animation1.m_updateCurrentTimeCount, 2); QCOMPARE(animation2.m_updateCurrentTimeCount, 2); QCOMPARE(animation3.m_updateCurrentTimeCount, 1); - QVERIFY(group.state() == QAbstractAnimation::Running); - QVERIFY(animation1.state() == QAbstractAnimation::Stopped); - QVERIFY(animation2.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Running); + QCOMPARE(animation1.state(), QAbstractAnimation::Stopped); + QCOMPARE(animation2.state(), QAbstractAnimation::Stopped); QCOMPARE((QAbstractAnimation*)&animation3, group.currentAnimation()); - QVERIFY(animation3.state() == QAbstractAnimation::Running); + QCOMPARE(animation3.state(), QAbstractAnimation::Running); group.setCurrentTime(750); - QVERIFY(group.state() == QAbstractAnimation::Stopped); - QVERIFY(animation1.state() == QAbstractAnimation::Stopped); - QVERIFY(animation2.state() == QAbstractAnimation::Stopped); - QVERIFY(animation3.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Stopped); + QCOMPARE(animation1.state(), QAbstractAnimation::Stopped); + QCOMPARE(animation2.state(), QAbstractAnimation::Stopped); + QCOMPARE(animation3.state(), QAbstractAnimation::Stopped); QCOMPARE(animation1.m_updateCurrentTimeCount, 2); QCOMPARE(animation2.m_updateCurrentTimeCount, 2); @@ -334,22 +334,22 @@ void tst_QPauseAnimation::sequentialGroupWithPause() group.start(); - QVERIFY(group.state() == QAbstractAnimation::Running); - QVERIFY(animation.state() == QAbstractAnimation::Running); - QVERIFY(pause.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Running); + QCOMPARE(animation.state(), QAbstractAnimation::Running); + QCOMPARE(pause.state(), QAbstractAnimation::Stopped); group.setCurrentTime(300); - QVERIFY(group.state() == QAbstractAnimation::Running); - QVERIFY(animation.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Running); + QCOMPARE(animation.state(), QAbstractAnimation::Stopped); QCOMPARE((QAbstractAnimation*)&pause, group.currentAnimation()); - QVERIFY(pause.state() == QAbstractAnimation::Running); + QCOMPARE(pause.state(), QAbstractAnimation::Running); group.setCurrentTime(600); - QVERIFY(group.state() == QAbstractAnimation::Stopped); - QVERIFY(animation.state() == QAbstractAnimation::Stopped); - QVERIFY(pause.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Stopped); + QCOMPARE(animation.state(), QAbstractAnimation::Stopped); + QCOMPARE(pause.state(), QAbstractAnimation::Stopped); QCOMPARE(pause.m_updateCurrentTimeCount, 2); } @@ -401,11 +401,11 @@ void tst_QPauseAnimation::multipleSequentialGroups() group.start(); - QVERIFY(group.state() == QAbstractAnimation::Running); - QVERIFY(subgroup1.state() == QAbstractAnimation::Running); - QVERIFY(subgroup2.state() == QAbstractAnimation::Running); - QVERIFY(subgroup3.state() == QAbstractAnimation::Running); - QVERIFY(subgroup4.state() == QAbstractAnimation::Running); + QCOMPARE(group.state(), QAbstractAnimation::Running); + QCOMPARE(subgroup1.state(), QAbstractAnimation::Running); + QCOMPARE(subgroup2.state(), QAbstractAnimation::Running); + QCOMPARE(subgroup3.state(), QAbstractAnimation::Running); + QCOMPARE(subgroup4.state(), QAbstractAnimation::Running); // This is a pretty long animation so it tends to get rather out of sync // when using the consistent timer, so run for an extra half second for good @@ -416,31 +416,31 @@ void tst_QPauseAnimation::multipleSequentialGroups() if (group.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(group.state() == QAbstractAnimation::Stopped); + QCOMPARE(group.state(), QAbstractAnimation::Stopped); #ifdef BAD_TIMER_RESOLUTION if (subgroup1.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(subgroup1.state() == QAbstractAnimation::Stopped); + QCOMPARE(subgroup1.state(), QAbstractAnimation::Stopped); #ifdef BAD_TIMER_RESOLUTION if (subgroup2.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(subgroup2.state() == QAbstractAnimation::Stopped); + QCOMPARE(subgroup2.state(), QAbstractAnimation::Stopped); #ifdef BAD_TIMER_RESOLUTION if (subgroup3.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(subgroup3.state() == QAbstractAnimation::Stopped); + QCOMPARE(subgroup3.state(), QAbstractAnimation::Stopped); #ifdef BAD_TIMER_RESOLUTION if (subgroup4.state() != QAbstractAnimation::Stopped) QEXPECT_FAIL("", timerError, Abort); #endif - QVERIFY(subgroup4.state() == QAbstractAnimation::Stopped); + QCOMPARE(subgroup4.state(), QAbstractAnimation::Stopped); #ifdef BAD_TIMER_RESOLUTION if (pause5.m_updateCurrentTimeCount != 4) @@ -455,7 +455,7 @@ void tst_QPauseAnimation::zeroDuration() animation.setDuration(0); animation.start(); QTest::qWait(animation.totalDuration() + 100); - QVERIFY(animation.state() == QAbstractAnimation::Stopped); + QCOMPARE(animation.state(), QAbstractAnimation::Stopped); QCOMPARE(animation.m_updateCurrentTimeCount, 1); } diff --git a/tests/auto/corelib/animation/qpropertyanimation/qpropertyanimation.pro b/tests/auto/corelib/animation/qpropertyanimation/qpropertyanimation.pro index 502e5aa428..bfeb183abf 100644 --- a/tests/auto/corelib/animation/qpropertyanimation/qpropertyanimation.pro +++ b/tests/auto/corelib/animation/qpropertyanimation/qpropertyanimation.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpropertyanimation QT = core gui widgets testlib SOURCES = tst_qpropertyanimation.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp index 530d7777d8..d4a1a6db11 100644 --- a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp @@ -34,6 +34,7 @@ #include <QtTest/QtTest> #include <QtCore/qpropertyanimation.h> #include <QtCore/qvariantanimation.h> +#include <QtGui/qtouchdevice.h> #include <QtWidgets/qwidget.h> Q_DECLARE_METATYPE(QAbstractAnimation::State) @@ -369,7 +370,7 @@ void tst_QPropertyAnimation::deletion2() QTimer::singleShot(0, object, SLOT(deleteLater())); QTest::qWait(50); - QVERIFY(anim->targetObject() == 0); + QVERIFY(!anim->targetObject()); } void tst_QPropertyAnimation::deletion3() diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/qsequentialanimationgroup.pro b/tests/auto/corelib/animation/qsequentialanimationgroup/qsequentialanimationgroup.pro index e53cde48f3..b0271e8ea2 100644 --- a/tests/auto/corelib/animation/qsequentialanimationgroup/qsequentialanimationgroup.pro +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/qsequentialanimationgroup.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qsequentialanimationgroup QT = core testlib SOURCES = tst_qsequentialanimationgroup.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp index c0fcb70ff3..067dcd705a 100644 --- a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp @@ -916,7 +916,7 @@ void tst_QSequentialAnimationGroup::startDelay() QTest::qWait(500); QTRY_COMPARE(group.state(), QAnimationGroup::Stopped); - QVERIFY(group.currentLoopTime() == 375); + QCOMPARE(group.currentLoopTime(), 375); } void tst_QSequentialAnimationGroup::clearGroup() @@ -1518,7 +1518,7 @@ void tst_QSequentialAnimationGroup::addRemoveAnimation() void tst_QSequentialAnimationGroup::currentAnimation() { QSequentialAnimationGroup group; - QVERIFY(group.currentAnimation() == 0); + QVERIFY(!group.currentAnimation()); QPropertyAnimation anim; anim.setDuration(0); @@ -1529,7 +1529,7 @@ void tst_QSequentialAnimationGroup::currentAnimation() void tst_QSequentialAnimationGroup::currentAnimationWithZeroDuration() { QSequentialAnimationGroup group; - QVERIFY(group.currentAnimation() == 0); + QVERIFY(!group.currentAnimation()); QPropertyAnimation zero1; zero1.setDuration(0); diff --git a/tests/auto/corelib/animation/qvariantanimation/qvariantanimation.pro b/tests/auto/corelib/animation/qvariantanimation/qvariantanimation.pro index 1c882833fc..b82d3bc6e0 100644 --- a/tests/auto/corelib/animation/qvariantanimation/qvariantanimation.pro +++ b/tests/auto/corelib/animation/qvariantanimation/qvariantanimation.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qvariantanimation QT = core testlib SOURCES = tst_qvariantanimation.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp index bd539296c2..5e223969e3 100644 --- a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp +++ b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp @@ -77,9 +77,9 @@ void tst_QVariantAnimation::currentValue() void tst_QVariantAnimation::easingCurve() { TestableQVariantAnimation anim; - QVERIFY(anim.easingCurve() == QEasingCurve::Linear); + QCOMPARE(anim.easingCurve().type(), QEasingCurve::Linear); anim.setEasingCurve(QEasingCurve::InQuad); - QVERIFY(anim.easingCurve() == QEasingCurve::InQuad); + QCOMPARE(anim.easingCurve().type(), QEasingCurve::InQuad); } void tst_QVariantAnimation::endValue() diff --git a/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro b/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro index 500f123f61..bf791ffc61 100644 --- a/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro +++ b/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro @@ -4,4 +4,3 @@ CONFIG -= app_bundle debug_and_release_target CONFIG += console -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/codecs/qtextcodec/test/test.pro b/tests/auto/corelib/codecs/qtextcodec/test/test.pro index 35b2b34690..e0a1bbd88e 100644 --- a/tests/auto/corelib/codecs/qtextcodec/test/test.pro +++ b/tests/auto/corelib/codecs/qtextcodec/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test QT = core testlib SOURCES = ../tst_qtextcodec.cpp @@ -12,4 +11,3 @@ win32 { } } TESTDATA += ../*.txt -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index 3aa06d237d..82ed655390 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -156,7 +156,7 @@ void tst_QTextCodec::codecForName() QTextCodec *codec = QTextCodec::codecForName(hint.toLatin1()); if (actualCodecName.isEmpty()) { - QVERIFY(codec == 0); + QVERIFY(!codec); } else { QVERIFY(codec != 0); QCOMPARE(QString(codec->name()), actualCodecName); @@ -265,7 +265,7 @@ void tst_QTextCodec::fromUnicode() array is correct (no off by one, no trailing '\0'). */ QByteArray result = codec->fromUnicode(QString("abc")); - if (result.startsWith("a")) { + if (result.startsWith('a')) { QCOMPARE(result.size(), 3); QCOMPARE(result, QByteArray("abc")); } else { @@ -573,7 +573,7 @@ void tst_QTextCodec::utf8Codec_data() str = "Prohl"; str += QChar::ReplacementCharacter; str += QChar::ReplacementCharacter; - str += "e"; + str += QLatin1Char('e'); str += QChar::ReplacementCharacter; str += " plugin"; str += QChar::ReplacementCharacter; @@ -2075,7 +2075,7 @@ void tst_QTextCodec::codecForUtfText() if (detected) QCOMPARE(codec->mibEnum(), mib); else - QVERIFY(codec == 0); + QVERIFY(!codec); } #if defined(Q_OS_UNIX) diff --git a/tests/auto/corelib/codecs/utf8/utf8.pro b/tests/auto/corelib/codecs/utf8/utf8.pro index 23f8b8894e..355d890824 100644 --- a/tests/auto/corelib/codecs/utf8/utf8.pro +++ b/tests/auto/corelib/codecs/utf8/utf8.pro @@ -2,5 +2,3 @@ CONFIG += testcase TARGET = tst_utf8 QT = core testlib SOURCES += tst_utf8.cpp utf8data.cpp -CONFIG += parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/global/q_func_info/q_func_info.pro b/tests/auto/corelib/global/q_func_info/q_func_info.pro index aad0edf4ed..7663a880eb 100644 --- a/tests/auto/corelib/global/q_func_info/q_func_info.pro +++ b/tests/auto/corelib/global/q_func_info/q_func_info.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_q_func_info QT = core testlib SOURCES = tst_q_func_info.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/global/qflags/qflags.pro b/tests/auto/corelib/global/qflags/qflags.pro index 3f78bc045b..c88a9da396 100644 --- a/tests/auto/corelib/global/qflags/qflags.pro +++ b/tests/auto/corelib/global/qflags/qflags.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qflags QT = core testlib SOURCES = tst_qflags.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 contains(QT_CONFIG, c++11): CONFIG += c++11 c++14 diff --git a/tests/auto/corelib/global/qgetputenv/qgetputenv.pro b/tests/auto/corelib/global/qgetputenv/qgetputenv.pro index 34fb1a702b..c6d1100335 100644 --- a/tests/auto/corelib/global/qgetputenv/qgetputenv.pro +++ b/tests/auto/corelib/global/qgetputenv/qgetputenv.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qgetputenv QT = core testlib SOURCES = tst_qgetputenv.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp index 71a3419963..adf8172a68 100644 --- a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp +++ b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp @@ -80,7 +80,7 @@ void tst_QGetPutEnv::getSetCheck() QCOMPARE(qEnvironmentVariableIntValue(varName, &ok), 0); QVERIFY(!ok); result = qgetenv(varName); - QVERIFY(result == "supervalue"); + QCOMPARE(result, QByteArrayLiteral("supervalue")); qputenv(varName,QByteArray()); diff --git a/tests/auto/corelib/global/qglobal/qglobal.pro b/tests/auto/corelib/global/qglobal/qglobal.pro index d1c02f80e9..b8ed7761f5 100644 --- a/tests/auto/corelib/global/qglobal/qglobal.pro +++ b/tests/auto/corelib/global/qglobal/qglobal.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qglobal QT = core testlib SOURCES = tst_qglobal.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/global/qglobalstatic/qglobalstatic.pro b/tests/auto/corelib/global/qglobalstatic/qglobalstatic.pro index 7b374505ce..056d940da7 100644 --- a/tests/auto/corelib/global/qglobalstatic/qglobalstatic.pro +++ b/tests/auto/corelib/global/qglobalstatic/qglobalstatic.pro @@ -10,4 +10,3 @@ CONFIG += exceptions SOURCES += tst_qglobalstatic.cpp DEFINES += SRCDIR=\\\"$$PWD/\\\" -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/global/qhooks/qhooks.pro b/tests/auto/corelib/global/qhooks/qhooks.pro index f886e7d49a..a5c0d63cb9 100644 --- a/tests/auto/corelib/global/qhooks/qhooks.pro +++ b/tests/auto/corelib/global/qhooks/qhooks.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qhooks QT = core-private testlib SOURCES = tst_qhooks.cpp diff --git a/tests/auto/corelib/global/qhooks/tst_qhooks.cpp b/tests/auto/corelib/global/qhooks/tst_qhooks.cpp index b5930790e4..a38a396a5d 100644 --- a/tests/auto/corelib/global/qhooks/tst_qhooks.cpp +++ b/tests/auto/corelib/global/qhooks/tst_qhooks.cpp @@ -46,7 +46,7 @@ private slots: void tst_QHooks::testVersion() { - QVERIFY(qtHookData[QHooks::HookDataVersion] >= 1); + QVERIFY(qtHookData[QHooks::HookDataVersion] >= 3); QCOMPARE(qtHookData[QHooks::HookDataSize], (quintptr)QHooks::LastHookIndex); QCOMPARE(qtHookData[QHooks::QtVersion], (quintptr)QT_VERSION); } diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro index 4789efc478..8ada04acdc 100644 --- a/tests/auto/corelib/global/qlogging/app/app.pro +++ b/tests/auto/corelib/global/qlogging/app/app.pro @@ -9,7 +9,6 @@ CONFIG -= app_bundle CONFIG += console SOURCES += main.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 DEFINES += QT_MESSAGELOGCONTEXT gcc:!mingw:!haiku: QMAKE_LFLAGS += -rdynamic diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro index d4dce4a0c3..d382001296 100644 --- a/tests/auto/corelib/global/qlogging/test/test.pro +++ b/tests/auto/corelib/global/qlogging/test/test.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase CONFIG -= app_bundle debug_and_release_target contains(QT_CONFIG, c++11): CONFIG += c++11 c++14 TARGET = ../tst_qlogging diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index a65a72313f..e2370665d8 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -821,7 +821,7 @@ void tst_qmessagehandler::qMessagePattern() // test QT_MESSAGE_PATTERN // QStringList environment = m_baseEnvironment; - environment.prepend("QT_MESSAGE_PATTERN=\"" + pattern + "\""); + environment.prepend("QT_MESSAGE_PATTERN=\"" + pattern + QLatin1Char('"')); process.setEnvironment(environment); process.start(appExe); diff --git a/tests/auto/corelib/global/qnumeric/qnumeric.pro b/tests/auto/corelib/global/qnumeric/qnumeric.pro index 0772ce6aab..188bb5b463 100644 --- a/tests/auto/corelib/global/qnumeric/qnumeric.pro +++ b/tests/auto/corelib/global/qnumeric/qnumeric.pro @@ -1,7 +1,6 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qnumeric QT = core-private testlib SOURCES = tst_qnumeric.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 intel_icc: QMAKE_CXXFLAGS += -fp-model strict intel_icl: QMAKE_CXXFLAGS += /fp:strict diff --git a/tests/auto/corelib/global/qrand/qrand.pro b/tests/auto/corelib/global/qrand/qrand.pro index 7761b6721a..ee1430aea5 100644 --- a/tests/auto/corelib/global/qrand/qrand.pro +++ b/tests/auto/corelib/global/qrand/qrand.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qrand QT = core testlib SOURCES = tst_qrand.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/global/qtendian/qtendian.pro b/tests/auto/corelib/global/qtendian/qtendian.pro index 363b86988d..2b0af4fa4c 100644 --- a/tests/auto/corelib/global/qtendian/qtendian.pro +++ b/tests/auto/corelib/global/qtendian/qtendian.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtendian QT = core testlib SOURCES = tst_qtendian.cpp @@ -6,4 +6,3 @@ wince* { # QTBUG-37194 , internal compiler errors with MSVC2008 for Windows CE QMAKE_CFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE -= -O2 } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/largefile/largefile.pro b/tests/auto/corelib/io/largefile/largefile.pro index d9938d07d5..caef116684 100644 --- a/tests/auto/corelib/io/largefile/largefile.pro +++ b/tests/auto/corelib/io/largefile/largefile.pro @@ -4,4 +4,3 @@ QT = core testlib SOURCES = tst_largefile.cpp wince: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro b/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro index b950f8c062..641bb7341b 100644 --- a/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro +++ b/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro @@ -3,4 +3,3 @@ TARGET = tst_qabstractfileengine QT = core-private core testlib SOURCES = tst_qabstractfileengine.cpp RESOURCES += qabstractfileengine.qrc -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qbuffer/qbuffer.pro b/tests/auto/corelib/io/qbuffer/qbuffer.pro index 55d91f3cde..76b1088595 100644 --- a/tests/auto/corelib/io/qbuffer/qbuffer.pro +++ b/tests/auto/corelib/io/qbuffer/qbuffer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qbuffer QT = core testlib SOURCES = tst_qbuffer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp index 3b730d97f9..c4800b4e10 100644 --- a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp @@ -378,7 +378,7 @@ void tst_QBuffer::read_rawdata() for (int i = 0; i < (int)sizeof(mydata); ++i) { QVERIFY(!buffer.atEnd()); in >> ch; - QVERIFY(ch == (quint8)mydata[i]); + QCOMPARE(ch, (quint8)mydata[i]); } QVERIFY(buffer.atEnd()); } diff --git a/tests/auto/corelib/io/qdatastream/qdatastream.pro b/tests/auto/corelib/io/qdatastream/qdatastream.pro index 9ab2b0948d..961e1933de 100644 --- a/tests/auto/corelib/io/qdatastream/qdatastream.pro +++ b/tests/auto/corelib/io/qdatastream/qdatastream.pro @@ -4,7 +4,6 @@ QT += testlib SOURCES = tst_qdatastream.cpp TESTDATA += datastream.q42 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index d9d3f55d4a..39c9455b39 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -301,7 +301,7 @@ void tst_QDataStream::cleanupTestCase() static int dataIndex(const QString &tag) { - int pos = tag.lastIndexOf("_"); + int pos = tag.lastIndexOf(QLatin1Char('_')); if (pos >= 0) { int ret = 0; QString count = tag.mid(pos + 1); @@ -338,7 +338,7 @@ void tst_QDataStream::stream_data(int noOfElements) for (int b=0; b<2; b++) { QString byte_order = b == 0 ? "BigEndian" : "LittleEndian"; - QString tag = device + "_" + byte_order; + QString tag = device + QLatin1Char('_') + byte_order; for (int e=0; e<noOfElements; e++) { QTest::newRow(qPrintable(tag + QString("_%1").arg(e))) << device << QString(byte_order); } @@ -529,7 +529,7 @@ void tst_QDataStream::readQRegExp(QDataStream *s) *s >> R; QCOMPARE(R, test); *s >> V; - QVERIFY(V.type() == QVariant::RegExp); + QCOMPARE(V.type(), QVariant::RegExp); QCOMPARE(V.toRegExp(), test); } @@ -797,7 +797,7 @@ void tst_QDataStream::readbool(QDataStream *s) bool d1; *s >> d1; - QVERIFY(d1 == expected); + QCOMPARE(d1, expected); } // ************************************ @@ -860,7 +860,7 @@ void tst_QDataStream::readQBitArray(QDataStream *s) QBitArray d1; *s >> d1; - QVERIFY(d1 == expected); + QCOMPARE(d1, expected); } // ************************************ @@ -919,7 +919,7 @@ void tst_QDataStream::readQBrush(QDataStream *s) *s >> d2; QBrush brush = qBrushData(dataIndex(QTest::currentDataTag())); - QVERIFY(d2 == brush); + QCOMPARE(d2, brush); } // ************************************ @@ -961,7 +961,7 @@ void tst_QDataStream::readQColor(QDataStream *s) QColor test(QColorData(dataIndex(QTest::currentDataTag()))); QColor d3; *s >> d3; - QVERIFY(d3 == test); + QCOMPARE(d3, test); } @@ -1057,7 +1057,7 @@ void tst_QDataStream::readQCursor(QDataStream *s) *s >> d5; QVERIFY(d5.shape() == test.shape()); //## lacks operator== - QVERIFY(d5.hotSpot() == test.hotSpot()); + QCOMPARE(d5.hotSpot(), test.hotSpot()); QVERIFY((d5.bitmap() != 0 && test.bitmap() != 0) || (d5.bitmap() == 0 && test.bitmap() == 0)); if (d5.bitmap() != 0) { QPixmap actual = *(d5.bitmap()); @@ -1120,7 +1120,7 @@ void tst_QDataStream::readQDate(QDataStream *s) QDate test(qDateData(dataIndex(QTest::currentDataTag()))); QDate d6; *s >> d6; - QVERIFY(d6 == test); + QCOMPARE(d6, test); } // ************************************ @@ -1214,7 +1214,7 @@ void tst_QDataStream::readQTime(QDataStream *s) QTime test = qTimeData(dataIndex(QTest::currentDataTag())); QTime d7; *s >> d7; - QVERIFY(d7 == test); + QCOMPARE(d7, test); } // ************************************ @@ -1264,7 +1264,7 @@ void tst_QDataStream::readQDateTime(QDataStream *s) QDateTime test(qDateTimeData(dataIndex(QTest::currentDataTag()))); QDateTime d8; *s >> d8; - QVERIFY(d8 == test); + QCOMPARE(d8, test); } // ************************************ @@ -1415,16 +1415,16 @@ void tst_QDataStream::readQImage(QDataStream *s) QImage d12; *s >> d12; - QVERIFY(d12 == ref); + QCOMPARE(d12, ref); // do some extra neurotic tests - QVERIFY(d12.size() == ref.size()); - QVERIFY(d12.isNull() == ref.isNull()); - QVERIFY(d12.width() == ref.width()); - QVERIFY(d12.height() == ref.height()); - QVERIFY(d12.depth() == ref.depth()); - QVERIFY(d12.colorCount() == ref.colorCount()); - QVERIFY(d12.hasAlphaChannel() == ref.hasAlphaChannel()); + QCOMPARE(d12.size(), ref.size()); + QCOMPARE(d12.isNull(), ref.isNull()); + QCOMPARE(d12.width(), ref.width()); + QCOMPARE(d12.height(), ref.height()); + QCOMPARE(d12.depth(), ref.depth()); + QCOMPARE(d12.colorCount(), ref.colorCount()); + QCOMPARE(d12.hasAlphaChannel(), ref.hasAlphaChannel()); } // ************************************ @@ -1518,9 +1518,9 @@ void tst_QDataStream::readQPen(QDataStream *s) QCOMPARE(d15.style(), origPen.style()); QCOMPARE(d15.width(), origPen.width()); QCOMPARE(d15.color(), origPen.color()); - QVERIFY(d15.capStyle() == origPen.capStyle()); - QVERIFY(d15.joinStyle() == origPen.joinStyle()); - QVERIFY(d15 == origPen); + QCOMPARE(d15.capStyle(), origPen.capStyle()); + QCOMPARE(d15.joinStyle(), origPen.joinStyle()); + QCOMPARE(d15, origPen); } // ************************************ @@ -1568,11 +1568,11 @@ void tst_QDataStream::readQPixmap(QDataStream *s) QPixmap d16; *s >> d16; QVERIFY(!d16.isNull() && !pm.isNull()); - QVERIFY(d16.width() == pm.width()); - QVERIFY(d16.height() == pm.height()); - QVERIFY(d16.size() == pm.size()); - QVERIFY(d16.rect() == pm.rect()); - QVERIFY(d16.depth() == pm.depth()); + QCOMPARE(d16.width(), pm.width()); + QCOMPARE(d16.height(), pm.height()); + QCOMPARE(d16.size(), pm.size()); + QCOMPARE(d16.rect(), pm.rect()); + QCOMPARE(d16.depth(), pm.depth()); } void tst_QDataStream::writeQIcon(QDataStream *s) @@ -1639,11 +1639,11 @@ void tst_QDataStream::readQPoint(QDataStream *s) QPoint ref(qPointData(dataIndex(QTest::currentDataTag()))); QPoint d17; *s >> d17; - QVERIFY(d17 == ref); + QCOMPARE(d17, ref); QPointF d17f; *s >> d17f; - QVERIFY(d17f == QPointF(ref)); + QCOMPARE(d17f, QPointF(ref)); } // ************************************ @@ -1691,11 +1691,11 @@ void tst_QDataStream::readQRect(QDataStream *s) QRect ref(qRectData(dataIndex(QTest::currentDataTag()))); QRect d18; *s >> d18; - QVERIFY(d18 == ref); + QCOMPARE(d18, ref); QRectF d18f; *s >> d18f; - QVERIFY(d18f == QRectF(ref)); + QCOMPARE(d18f, QRectF(ref)); } // ************************************ @@ -1804,11 +1804,11 @@ void tst_QDataStream::readQPolygon(QDataStream *s) QPolygon ref(qPolygonData(dataIndex(QTest::currentDataTag()))); QPolygon d19; *s >> d19; - QVERIFY(d19 == ref); + QCOMPARE(d19, ref); QPolygonF d19f; *s >> d19f; - QVERIFY(d19f == QPolygonF(ref)); + QCOMPARE(d19f, QPolygonF(ref)); } // ************************************ @@ -1868,7 +1868,7 @@ void tst_QDataStream::readQRegion(QDataStream *s) QRegion ref(qRegionData(dataIndex(QTest::currentDataTag()))); QRegion r; *s >> r; - QVERIFY(r == ref); + QCOMPARE(r, ref); } // ************************************ @@ -1916,11 +1916,11 @@ void tst_QDataStream::readQSize(QDataStream *s) QSize ref(qSizeData(dataIndex(QTest::currentDataTag()))); QSize d21; *s >> d21; - QVERIFY(d21 == ref); + QCOMPARE(d21, ref); QSizeF d21f; *s >> d21f; - QVERIFY(d21f == QSizeF(ref)); + QCOMPARE(d21f, QSizeF(ref)); } // *********************** atEnd ****************************** @@ -2096,13 +2096,13 @@ void tst_QDataStream::setVersion() QDataStream in(&ba1, QIODevice::ReadOnly); in.setVersion(vers); in >> keyseq1 >> keyseq2 >> deadbeef; - QVERIFY(keyseq1 == QKeySequence(Qt::Key_A)); + QCOMPARE(keyseq1, QKeySequence(Qt::Key_A)); if (vers >= 5) { QVERIFY(keyseq2 == QKeySequence(Qt::Key_B, Qt::Key_C)); } else { - QVERIFY(keyseq2 == QKeySequence(Qt::Key_B)); + QCOMPARE(keyseq2, QKeySequence(Qt::Key_B)); } - QVERIFY(deadbeef == 0xDEADBEEF); + QCOMPARE(deadbeef, 0xDEADBEEF); } /* @@ -2111,7 +2111,7 @@ void tst_QDataStream::setVersion() // revise the test if new color roles or color groups are added QVERIFY(QPalette::NColorRoles == QPalette::ToolTipText + 1); - QVERIFY(QPalette::NColorGroups == 3); + QCOMPARE(int(QPalette::NColorGroups), 3); QByteArray ba2; QPalette pal1, pal2; @@ -2176,8 +2176,8 @@ void tst_QDataStream::setVersion() } } } - QVERIFY(pal1 == inPal1); - QVERIFY(pal2 == inPal2); + QCOMPARE(pal1, inPal1); + QCOMPARE(pal2, inPal2); } } } @@ -3062,9 +3062,9 @@ void tst_QDataStream::compatibility_Qt3() in >> in_palette; in >> in_brush; } - QVERIFY(in_brush.style() == Qt::NoBrush); - QVERIFY(in_palette.brush(QPalette::Button).style() == Qt::NoBrush); - QVERIFY(in_palette.color(QPalette::Light) == Qt::green); + QCOMPARE(in_brush.style(), Qt::NoBrush); + QCOMPARE(in_palette.brush(QPalette::Button).style(), Qt::NoBrush); + QCOMPARE(in_palette.color(QPalette::Light), QColor(Qt::green)); } } @@ -3094,9 +3094,9 @@ void tst_QDataStream::compatibility_Qt2() in >> in_palette; in >> in_brush; } - QVERIFY(in_brush.style() == Qt::NoBrush); - QVERIFY(in_palette.brush(QPalette::Button).style() == Qt::NoBrush); - QVERIFY(in_palette.color(QPalette::Light) == Qt::green); + QCOMPARE(in_brush.style(), Qt::NoBrush); + QCOMPARE(in_palette.brush(QPalette::Button).style(), Qt::NoBrush); + QCOMPARE(in_palette.color(QPalette::Light), QColor(Qt::green)); } void tst_QDataStream::floatingPointNaN() diff --git a/tests/auto/corelib/io/qdataurl/qdataurl.pro b/tests/auto/corelib/io/qdataurl/qdataurl.pro index d21fc4ed15..7085c9d881 100644 --- a/tests/auto/corelib/io/qdataurl/qdataurl.pro +++ b/tests/auto/corelib/io/qdataurl/qdataurl.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qdataurl QT = core core-private testlib SOURCES = tst_qdataurl.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qdebug/qdebug.pro b/tests/auto/corelib/io/qdebug/qdebug.pro index 5e902bb105..45c0aa4061 100644 --- a/tests/auto/corelib/io/qdebug/qdebug.pro +++ b/tests/auto/corelib/io/qdebug/qdebug.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qdebug QT = core testlib concurrent SOURCES = tst_qdebug.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qdir/qdir.pro b/tests/auto/corelib/io/qdir/qdir.pro index 0adc7e0450..26bc60a731 100644 --- a/tests/auto/corelib/io/qdir/qdir.pro +++ b/tests/auto/corelib/io/qdir/qdir.pro @@ -5,7 +5,6 @@ SOURCES = tst_qdir.cpp RESOURCES += qdir.qrc TESTDATA += testdir testData searchdir resources entrylist types tst_qdir.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android:!android-no-sdk { RESOURCES += android_testdata.qrc diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index ae6fe7eaef..2106a1cea8 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -621,7 +621,7 @@ void tst_QDir::compare() dir.makeAbsolute(); QVERIFY(dir == QDir::currentPath()); - QVERIFY(QDir() == QDir(QDir::currentPath())); + QCOMPARE(QDir(), QDir(QDir::currentPath())); QVERIFY(QDir("../") == QDir(QDir::currentPath() + "/..")); } @@ -1058,7 +1058,7 @@ void tst_QDir::current() if (!path.isEmpty()) { bool b = QDir::setCurrent(path); // If path is non existent, then setCurrent should be false (currentDir is empty in testData) - QVERIFY(b == !currentDir.isEmpty()); + QCOMPARE(b, !currentDir.isEmpty()); } if (!currentDir.isEmpty()) { QDir newCurrent = QDir::current(); @@ -1080,7 +1080,7 @@ void tst_QDir::cd_data() QTest::addColumn<bool>("successExpected"); QTest::addColumn<QString>("newDir"); - int index = m_dataPath.lastIndexOf("/"); + int index = m_dataPath.lastIndexOf(QLatin1Char('/')); QTest::newRow("cdUp") << m_dataPath << ".." << true << m_dataPath.left(index==0?1:index); QTest::newRow("cdUp non existent (relative dir)") << "anonexistingDir" << ".." << true << m_dataPath; @@ -1124,11 +1124,11 @@ void tst_QDir::setNameFilters_data() QTest::newRow("spaces2") << m_dataPath + "/testdir/spaces" << QStringList("*.bar") << QStringList("foo.bar"); QTest::newRow("spaces3") << m_dataPath + "/testdir/spaces" << QStringList("foo.*") - << QString("foo. bar,foo.bar").split(","); - QTest::newRow("files1") << m_dataPath + "/testdir/dir" << QString("*r.cpp *.pro").split(" ") - << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(","); + << QString("foo. bar,foo.bar").split(QLatin1Char(',')); + QTest::newRow("files1") << m_dataPath + "/testdir/dir" << QString("*r.cpp *.pro").split(QLatin1Char(' ')) + << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(QLatin1Char(',')); QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") - << QString("file1.data,file2.data,file3.data").split(','); + << QString("file1.data,file2.data,file3.data").split(QLatin1Char(',')); } void tst_QDir::setNameFilters() @@ -1695,7 +1695,7 @@ void tst_QDir::searchPaths() QDir::setSearchPaths(searchPathPrefixList.at(i), searchPathsList.at(i).split(",")); } for (int i = 0; i < searchPathPrefixList.count(); ++i) { - QVERIFY(QDir::searchPaths(searchPathPrefixList.at(i)) == searchPathsList.at(i).split(",")); + QCOMPARE(QDir::searchPaths(searchPathPrefixList.at(i)), searchPathsList.at(i).split(",")); } QCOMPARE(QFile(filename).exists(), exists); @@ -1718,7 +1718,7 @@ void tst_QDir::searchPaths() } } for (int i = 0; i < searchPathPrefixList.count(); ++i) { - QVERIFY(QDir::searchPaths(searchPathPrefixList.at(i)) == searchPathsList.at(i).split(",")); + QCOMPARE(QDir::searchPaths(searchPathPrefixList.at(i)), searchPathsList.at(i).split(",")); } QCOMPARE(QFile(filename).exists(), exists); diff --git a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro index a2429bf2f0..2b50f97ac5 100644 --- a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro @@ -7,6 +7,5 @@ RESOURCES += qdiriterator.qrc TESTDATA += entrylist wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 win32: CONFIG += insignificant_test # Crashes on Windows in release builds diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index 6b1719ad53..9e368515e4 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -538,7 +538,7 @@ void tst_QDirIterator::recurseWithFilters() const QVERIFY(it.hasNext()); it.next(); actualEntries.insert(it.fileInfo().filePath()); - QVERIFY(actualEntries == expectedEntries); + QCOMPARE(actualEntries, expectedEntries); QVERIFY(!it.hasNext()); } diff --git a/tests/auto/corelib/io/qfile/qfile.pro b/tests/auto/corelib/io/qfile/qfile.pro index e2c714c67f..10c8d918f7 100644 --- a/tests/auto/corelib/io/qfile/qfile.pro +++ b/tests/auto/corelib/io/qfile/qfile.pro @@ -5,4 +5,3 @@ wince* { SUBDIRS = test stdinprocess } -CONFIG += parallel_test diff --git a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro index 51badce898..8e463e4cef 100644 --- a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro +++ b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro @@ -6,4 +6,3 @@ CONFIG += console # This app is testdata for tst_qfile target.path = $$[QT_INSTALL_TESTS]/tst_qfile/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index 9aa4119795..c9ba96cc1b 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle debug_and_release_target QT = core-private core testlib qtHaveModule(network): QT += network @@ -17,4 +16,3 @@ TESTDATA += ../dosfile.txt ../noendofline.txt ../testfile.txt \ ../resources/file1.ext1 win32:!winrt: LIBS+=-lole32 -luuid -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 1c695a1113..b4140e1115 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -849,7 +849,7 @@ void tst_QFile::readAll() QByteArray a = file.readAll(); file.reset(); - QVERIFY(file.pos() == 0); + QCOMPARE(file.pos(), 0); QVERIFY(file.bytesAvailable() > 7); QByteArray b = file.read(1); @@ -1195,7 +1195,7 @@ void tst_QFile::append() f.close(); QVERIFY2(f.open(QIODevice::Append), msgOpenFailed(f).constData()); - QVERIFY(f.pos() == 1); + QCOMPARE(f.pos(), 1); f.putChar('a'); f.close(); QCOMPARE(int(f.size()), 2); @@ -2047,7 +2047,7 @@ void tst_QFile::longFileName() QString line = ts.readLine(); QCOMPARE(line, fileName); } - QString newName = fileName + QLatin1String("1"); + QString newName = fileName + QLatin1Char('1'); { QVERIFY(QFile::copy(fileName, newName)); QFile file(newName); @@ -2224,7 +2224,7 @@ void tst_QFile::removeOpenFile() QVERIFY(removed); QVERIFY(!f.isOpen()); QVERIFY(!f.exists()); - QVERIFY(f.error() == QFile::NoError); + QCOMPARE(f.error(), QFile::NoError); } { @@ -2251,7 +2251,7 @@ void tst_QFile::removeOpenFile() QVERIFY(removed); QVERIFY(!f.isOpen()); QVERIFY(!f.exists()); - QVERIFY(f.error() == QFile::NoError); + QCOMPARE(f.error(), QFile::NoError); } } @@ -2819,13 +2819,13 @@ void tst_QFile::readEof() char buf[10]; int ret = file.read(buf, sizeof buf); QCOMPARE(ret, 0); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.read(buf, sizeof buf); QCOMPARE(ret, 0); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2840,13 +2840,13 @@ void tst_QFile::readEof() QByteArray ret = file.read(10); QVERIFY(ret.isEmpty()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.read(10); QVERIFY(ret.isEmpty()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2862,13 +2862,13 @@ void tst_QFile::readEof() char buf[10]; int ret = file.readLine(buf, sizeof buf); QCOMPARE(ret, -1); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.readLine(buf, sizeof buf); QCOMPARE(ret, -1); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2883,13 +2883,13 @@ void tst_QFile::readEof() QByteArray ret = file.readLine(); QVERIFY(ret.isNull()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.readLine(); QVERIFY(ret.isNull()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2904,12 +2904,12 @@ void tst_QFile::readEof() char c; QVERIFY(!file.getChar(&c)); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result QVERIFY(!file.getChar(&c)); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } } @@ -2997,7 +2997,7 @@ void tst_QFile::map() memory = file.map(offset, size); QCOMPARE(file.error(), QFile::NoError); QVERIFY(memory); - QVERIFY(memory[0] == 'Q'); + QCOMPARE(memory[0], uchar('Q')); QVERIFY(file.unmap(memory)); QCOMPARE(file.error(), QFile::NoError); diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro index 571637be37..8aa81896cc 100644 --- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro +++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro @@ -6,6 +6,5 @@ RESOURCES += qfileinfo.qrc \ testdata.qrc win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 win32: CONFIG += insignificant_test # Crashes on Windows in release builds diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 210fdb5a12..1d49c8e3b9 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1097,7 +1097,7 @@ void tst_QFileInfo::consistent() QFileInfo fi(file); QCOMPARE(fi.filePath(), expected); - QCOMPARE(fi.dir().path() + "/" + fi.fileName(), expected); + QCOMPARE(fi.dir().path() + QLatin1Char('/') + fi.fileName(), expected); } @@ -1429,7 +1429,7 @@ void tst_QFileInfo::refresh() QCOMPARE(file.write("JOJOJO"), qint64(6)); file.flush(); - QVERIFY(info.lastModified() == lastModified); + QCOMPARE(info.lastModified(), lastModified); QCOMPARE(info.size(), qint64(7)); #if defined(Q_OS_WIN) || defined(Q_OS_WINCE) diff --git a/tests/auto/corelib/io/qfileselector/qfileselector.pro b/tests/auto/corelib/io/qfileselector/qfileselector.pro index ded3d6502e..edcc91e8ed 100644 --- a/tests/auto/corelib/io/qfileselector/qfileselector.pro +++ b/tests/auto/corelib/io/qfileselector/qfileselector.pro @@ -1,4 +1,3 @@ -CONFIG += parallel_test CONFIG += testcase TARGET = tst_qfileselectors QT = core-private testlib diff --git a/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro b/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro index 99d3af1848..474836fba2 100644 --- a/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro +++ b/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro @@ -1,7 +1,6 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qfilesystementry QT = core-private testlib SOURCES = tst_qfilesystementry.cpp \ $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry.cpp HEADERS = $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry_p.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro index 1faa089c6e..46dd70289b 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro +++ b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qfilesystemwatcher QT = core testlib SOURCES = tst_qfilesystemwatcher.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qiodevice/qiodevice.pro b/tests/auto/corelib/io/qiodevice/qiodevice.pro index 9fd70fb177..78f5b5e75d 100644 --- a/tests/auto/corelib/io/qiodevice/qiodevice.pro +++ b/tests/auto/corelib/io/qiodevice/qiodevice.pro @@ -5,7 +5,6 @@ SOURCES = tst_qiodevice.cpp TESTDATA += tst_qiodevice.cpp MOC_DIR=tmp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android:!android-no-sdk: { RESOURCES += \ diff --git a/tests/auto/corelib/io/qipaddress/qipaddress.pro b/tests/auto/corelib/io/qipaddress/qipaddress.pro index ff569aa3d5..9c769052ed 100644 --- a/tests/auto/corelib/io/qipaddress/qipaddress.pro +++ b/tests/auto/corelib/io/qipaddress/qipaddress.pro @@ -1,5 +1,4 @@ SOURCES += tst_qipaddress.cpp TARGET = tst_qipaddress QT = core core-private testlib -CONFIG += testcase parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +CONFIG += testcase diff --git a/tests/auto/corelib/io/qnodebug/qnodebug.pro b/tests/auto/corelib/io/qnodebug/qnodebug.pro index ff8e09b84b..7e35f92474 100644 --- a/tests/auto/corelib/io/qnodebug/qnodebug.pro +++ b/tests/auto/corelib/io/qnodebug/qnodebug.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qnodebug QT = core testlib SOURCES = tst_qnodebug.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro b/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro index 2f409ebdbc..e46e7e1100 100644 --- a/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro +++ b/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle debug_and_release_target QT = core testlib SOURCES = tst_qprocessnoapplication.cpp diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro index 55e9b05d1a..947dc916f2 100644 --- a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro +++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro @@ -3,4 +3,3 @@ CONFIG += console CONFIG -= app_bundle QT = core DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/test/test.pro b/tests/auto/corelib/io/qprocess/test/test.pro index f77dacc87b..96d105a4b4 100644 --- a/tests/auto/corelib/io/qprocess/test/test.pro +++ b/tests/auto/corelib/io/qprocess/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle debug_and_release_target QT = core-private testlib network SOURCES = ../tst_qprocess.cpp @@ -19,4 +18,3 @@ TEST_HELPER_INSTALLS += \ "../testProcessSpacesArgs/one space" \ "../testProcessSpacesArgs/two space s" \ "../test Space In Name/testSpaceInName" -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro index 961b28ec7d..8d1fcba624 100644 --- a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro +++ b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro @@ -4,4 +4,3 @@ CONFIG += console CONFIG -= app_bundle INSTALLS = DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro index 049454abe2..b08371804f 100644 --- a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro +++ b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro @@ -3,4 +3,3 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro index d3439072bb..8778da7ffe 100644 --- a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro +++ b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro @@ -3,4 +3,3 @@ QT += widgets CONFIG += console CONFIG -= app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro index f7c57abc37..7ccc976efc 100644 --- a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro +++ b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro @@ -3,4 +3,3 @@ CONFIG += console CONFIG -= qt app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro index 56b4642bed..fbb3411d47 100644 --- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro +++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro @@ -3,4 +3,3 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro index 8f77e46f74..98fe78c8b9 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro @@ -4,4 +4,3 @@ CONFIG += console win32:!mingw:!equals(TEMPLATE_PREFIX, "vc"):QMAKE_CXXFLAGS += /GS- DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro index 3940ddbf98..e236e05c7d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro @@ -2,4 +2,3 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro index 3940ddbf98..e236e05c7d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro @@ -2,4 +2,3 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro index 3940ddbf98..e236e05c7d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro @@ -2,4 +2,3 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro index 962c1122c1..a07ae00605 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro @@ -6,4 +6,3 @@ DESTDIR = ./ mac { CONFIG -= app_bundle } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro index f7bb0985a3..c6db9d1bac 100644 --- a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro +++ b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro @@ -3,5 +3,4 @@ CONFIG += console CONFIG -= qt app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro index 2de4534896..95191098bd 100644 --- a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro +++ b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro @@ -2,5 +2,4 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro index d425d5569e..21a115b536 100644 --- a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro +++ b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro @@ -2,5 +2,4 @@ SOURCES = main.cpp CONFIG += console CONFIG -= app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro index b59241851f..d19a631cae 100644 --- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro +++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro @@ -9,5 +9,4 @@ unix { CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro index b7213ae507..afa4f32a85 100644 --- a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro +++ b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro @@ -6,5 +6,4 @@ DESTDIR = "../test Space In Name" mac { CONFIG -= app_bundle } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 45d6cf3dcd..83da28767f 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -845,11 +845,11 @@ void tst_QProcess::openModes() { QProcess proc; QVERIFY(!proc.isOpen()); - QVERIFY(proc.openMode() == QProcess::NotOpen); + QCOMPARE(proc.openMode(), QProcess::NotOpen); proc.start("testProcessEcho3/testProcessEcho3"); QVERIFY(proc.waitForStarted(5000)); QVERIFY(proc.isOpen()); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); QVERIFY(proc.isReadable()); QVERIFY(proc.isWritable()); @@ -858,7 +858,7 @@ void tst_QProcess::openModes() proc.closeWriteChannel(); QVERIFY(proc.isWritable()); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); while (proc.bytesAvailable() < 4 && proc.waitForReadyRead(5000)) { } @@ -867,12 +867,12 @@ void tst_QProcess::openModes() proc.closeReadChannel(QProcess::StandardOutput); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); QVERIFY(proc.isReadable()); proc.closeReadChannel(QProcess::StandardError); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); QVERIFY(proc.isReadable()); proc.close(); @@ -1444,11 +1444,11 @@ void tst_QProcess::spaceArgsTest() QCOMPARE(actual, args); #endif - if (program.contains(" ")) - program = "\"" + program + "\""; + if (program.contains(QLatin1Char(' '))) + program = QLatin1Char('"') + program + QLatin1Char('"'); if (!stringArgs.isEmpty()) - program += QString::fromLatin1(" ") + stringArgs; + program += QLatin1Char(' ') + stringArgs; errorMessage.clear(); process.start(program); @@ -1501,9 +1501,9 @@ void tst_QProcess::nativeArguments() char buf[256]; fgets(buf, 256, file); fclose(file); - QStringList actual = QString::fromLatin1(buf).split("|"); + QStringList actual = QString::fromLatin1(buf).split(QLatin1Char('|')); #else - QStringList actual = QString::fromLatin1(proc.readAll()).split("|"); + QStringList actual = QString::fromLatin1(proc.readAll()).split(QLatin1Char('|')); #endif QVERIFY(!actual.isEmpty()); // not interested in the program name, it might be different. @@ -2302,6 +2302,13 @@ void tst_QProcess::setNonExistentWorkingDirectory() QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue); #endif QCOMPARE(int(process.error()), int(QProcess::FailedToStart)); + +#ifdef Q_OS_UNIX +# ifdef QPROCESS_USE_SPAWN + QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue); +# endif + QVERIFY2(process.errorString().startsWith("chdir:"), process.errorString().toLocal8Bit()); +#endif } #endif diff --git a/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro b/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro index 760fa11b9e..04cef29a64 100644 --- a/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro +++ b/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qprocessenvironment QT = core testlib SOURCES = tst_qprocessenvironment.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp index 2099101a91..2bf2696639 100644 --- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp +++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp @@ -57,25 +57,25 @@ private slots: void tst_QProcessEnvironment::operator_eq() { QProcessEnvironment e1; - QVERIFY(e1 == e1); + QCOMPARE(e1, e1); e1.clear(); - QVERIFY(e1 == e1); + QCOMPARE(e1, e1); e1 = QProcessEnvironment(); QProcessEnvironment e2; - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e1.clear(); - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e2.clear(); - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e1.insert("FOO", "bar"); QVERIFY(e1 != e2); e2.insert("FOO", "bar"); - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e2.insert("FOO", "baz"); QVERIFY(e1 != e2); @@ -212,7 +212,7 @@ void tst_QProcessEnvironment::insertEnv() e3.insert(e3); // mustn't deadlock - QVERIFY(e3 == e2); + QCOMPARE(e3, e2); } void tst_QProcessEnvironment::caseSensitivity() diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro index 64f5cb46e0..e8b82b4df7 100644 --- a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro +++ b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qresourceengine load(resources) QT = core testlib @@ -16,7 +16,6 @@ TESTDATA += \ parentdir.txt \ testqrc/* GENERATED_TESTDATA = $${runtime_resource.target} -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android:!android-no-sdk { RESOURCES += android_testdata.qrc diff --git a/tests/auto/corelib/io/qsavefile/qsavefile.pro b/tests/auto/corelib/io/qsavefile/qsavefile.pro index 36db000fa7..dd22d69ce6 100644 --- a/tests/auto/corelib/io/qsavefile/qsavefile.pro +++ b/tests/auto/corelib/io/qsavefile/qsavefile.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qsavefile QT = core testlib SOURCES = tst_qsavefile.cpp diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 935eb7df89..a520010b47 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -122,6 +122,7 @@ private slots: void testEmptyKey(); void testResourceFiles(); void testRegistryShortRootNames(); + void testRegistry32And64Bit(); void trailingWhitespace(); #ifdef Q_OS_MAC void fileName(); @@ -210,7 +211,7 @@ static QString settingsPath(const char *path = "") #else QString tempPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); #endif - if (tempPath.endsWith("/")) + if (tempPath.endsWith(QLatin1Char('/'))) tempPath.truncate(tempPath.size() - 1); return QDir::toNativeSeparators(tempPath + "/tst_QSettings/" + QLatin1String(path)); } @@ -292,8 +293,8 @@ void tst_QSettings::initTestCase() , Qt::CaseInsensitive #endif ); - QVERIFY(custom1 == QSettings::CustomFormat1); - QVERIFY(custom2 == QSettings::CustomFormat2); + QCOMPARE(custom1, QSettings::CustomFormat1); + QCOMPARE(custom2, QSettings::CustomFormat2); } void tst_QSettings::init() @@ -392,27 +393,27 @@ void tst_QSettings::ctor() QSettings settings8(format, QSettings::SystemScope, "software.org"); // test QSettings::format() while we're at it - QVERIFY(settings1.format() == format); - QVERIFY(settings2.format() == format); - QVERIFY(settings3.format() == format); - QVERIFY(settings4.format() == format); + QCOMPARE(settings1.format(), format); + QCOMPARE(settings2.format(), format); + QCOMPARE(settings3.format(), format); + QCOMPARE(settings4.format(), format); // test QSettings::scope() while we're at it - QVERIFY(settings1.scope() == QSettings::UserScope); - QVERIFY(settings2.scope() == QSettings::UserScope); - QVERIFY(settings3.scope() == QSettings::SystemScope); - QVERIFY(settings4.scope() == QSettings::SystemScope); + QCOMPARE(settings1.scope(), QSettings::UserScope); + QCOMPARE(settings2.scope(), QSettings::UserScope); + QCOMPARE(settings3.scope(), QSettings::SystemScope); + QCOMPARE(settings4.scope(), QSettings::SystemScope); // test QSettings::organizationName() while we're at it - QVERIFY(settings1.organizationName() == "software.org"); - QVERIFY(settings2.organizationName() == "software.org"); - QVERIFY(settings3.organizationName() == "software.org"); - QVERIFY(settings4.organizationName() == "software.org"); + QCOMPARE(settings1.organizationName(), QLatin1String("software.org")); + QCOMPARE(settings2.organizationName(), QLatin1String("software.org")); + QCOMPARE(settings3.organizationName(), QLatin1String("software.org")); + QCOMPARE(settings4.organizationName(), QLatin1String("software.org")); // test QSettings::applicationName() while we're at it QCOMPARE(settings1.applicationName(), QString("KillerAPP")); QVERIFY(settings2.applicationName().isEmpty()); - QVERIFY(settings3.applicationName() == "KillerAPP"); + QCOMPARE(settings3.applicationName(), QLatin1String("KillerAPP")); QVERIFY(settings4.applicationName().isEmpty()); #if !defined(Q_OS_BLACKBERRY) @@ -588,7 +589,7 @@ void tst_QSettings::ctor() settings1.endGroup(); // test QSettings::scope() while we're at it - QVERIFY(settings1.scope() == QSettings::UserScope); + QCOMPARE(settings1.scope(), QSettings::UserScope); // test QSettings::organizationName() while we're at it QVERIFY(settings1.organizationName().isEmpty()); @@ -663,20 +664,20 @@ void tst_QSettings::ctor() QCOMPARE(settings2.status(), QSettings::NoError); // test QSettings::format() while we're at it - QVERIFY(settings.format() == format); - QVERIFY(settings2.format() == format); + QCOMPARE(settings.format(), format); + QCOMPARE(settings2.format(), format); // test QSettings::scope() while we're at it - QVERIFY(settings.scope() == QSettings::UserScope); - QVERIFY(settings2.scope() == QSettings::UserScope); + QCOMPARE(settings.scope(), QSettings::UserScope); + QCOMPARE(settings2.scope(), QSettings::UserScope); // test QSettings::organizationName() while we're at it QVERIFY(settings.organizationName().isEmpty()); - QVERIFY(settings2.organizationName() == "software.org"); + QCOMPARE(settings2.organizationName(), QLatin1String("software.org")); // test QSettings::applicationName() while we're at it QVERIFY(settings.applicationName().isEmpty()); - QVERIFY(settings2.applicationName() == "KillerAPP"); + QCOMPARE(settings2.applicationName(), QLatin1String("KillerAPP")); } } @@ -1222,16 +1223,16 @@ void tst_QSettings::remove() { QSettings settings0(QSettings::UserScope, "software.org", "KillerAPP"); int initialNumKeys = settings0.allKeys().size(); - QCOMPARE(settings0.value("key 1", "123").toString(), QString("123")); + QCOMPARE(settings0.value("key 1", "123").toString(), QLatin1String("123")); settings0.remove("key 1"); - QCOMPARE(settings0.value("key 1", "456").toString(), QString("456")); + QCOMPARE(settings0.value("key 1", "456").toString(), QLatin1String("456")); settings0.setValue("key 1", "bubloo"); - QCOMPARE(settings0.value("key 1").toString(), QString("bubloo")); + QCOMPARE(settings0.value("key 1").toString(), QLatin1String("bubloo")); settings0.remove("key 2"); - QCOMPARE(settings0.value("key 1").toString(), QString("bubloo")); + QCOMPARE(settings0.value("key 1").toString(), QLatin1String("bubloo")); settings0.remove("key 1"); - QCOMPARE(settings0.value("key 1", "789").toString(), QString("789")); + QCOMPARE(settings0.value("key 1", "789").toString(), QLatin1String("789")); /* Make sure that removing a key removes all the subkeys. @@ -1537,7 +1538,7 @@ void tst_QSettings::contains() } settings1.endGroup(); - QVERIFY(settings1.group() == "alpha"); + QCOMPARE(settings1.group(), QLatin1String("alpha")); keys = settings1.allKeys(); QCOMPARE(keys.size(), expectedResult.size() + 3); for (i = 0; i < keys.size(); ++i) { @@ -1829,26 +1830,26 @@ void tst_QSettings::testUpdateRequestEvent() QSettings settings1("foo", QSettings::IniFormat); QVERIFY(!QFile::exists("foo")); - QVERIFY(QFileInfo("foo").size() == 0); + QCOMPARE(QFileInfo("foo").size(), qint64(0)); settings1.setValue("key1", 1); - QVERIFY(QFileInfo("foo").size() == 0); + QCOMPARE(QFileInfo("foo").size(), qint64(0)); QTRY_VERIFY(QFileInfo("foo").size() > 0); settings1.remove("key1"); QVERIFY(QFileInfo("foo").size() > 0); - QTRY_VERIFY(QFileInfo("foo").size() == 0); + QTRY_COMPARE(QFileInfo("foo").size(), qint64(0)); settings1.setValue("key2", 2); - QVERIFY(QFileInfo("foo").size() == 0); + QCOMPARE(QFileInfo("foo").size(), qint64(0)); QTRY_VERIFY(QFileInfo("foo").size() > 0); settings1.clear(); QVERIFY(QFileInfo("foo").size() > 0); - QTRY_VERIFY(QFileInfo("foo").size() == 0); + QTRY_COMPARE(QFileInfo("foo").size(), qint64(0)); #ifdef Q_OS_WINRT QDir::setCurrent(oldCur); @@ -1995,7 +1996,7 @@ void tst_QSettings::testEmptyData() settings.setValue("vList", vList); settings.setValue("vList2", vList2); settings.setValue("vList3", vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } { QSettings settings(filename, QSettings::IniFormat); @@ -2008,7 +2009,7 @@ void tst_QSettings::testEmptyData() QCOMPARE(settings.value("vList").toList(), vList); QCOMPARE(settings.value("vList2").toList(), vList2); QCOMPARE(settings.value("vList3").toList(), vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } { @@ -2022,7 +2023,7 @@ void tst_QSettings::testEmptyData() settings.setValue("vList", vList); settings.setValue("vList2", vList2); settings.setValue("vList3", vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } { QSettings settings("QtProject", "tst_qsettings"); @@ -2035,7 +2036,7 @@ void tst_QSettings::testEmptyData() QCOMPARE(settings.value("vList").toList(), vList); QCOMPARE(settings.value("vList2").toList(), vList2); QCOMPARE(settings.value("vList3").toList(), vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } QFile::remove(filename); } @@ -2053,17 +2054,17 @@ void tst_QSettings::testEmptyKey() void tst_QSettings::testResourceFiles() { QSettings settings(":/resourcefile.ini", QSettings::IniFormat); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); QVERIFY(!settings.isWritable()); QCOMPARE(settings.value("Field 1/Bottom").toInt(), 89); settings.setValue("Field 1/Bottom", 90); // the next two lines check the statu quo; another behavior would be possible - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); QCOMPARE(settings.value("Field 1/Bottom").toInt(), 90); settings.sync(); - QVERIFY(settings.status() == QSettings::AccessError); + QCOMPARE(settings.status(), QSettings::AccessError); QCOMPARE(settings.value("Field 1/Bottom").toInt(), 90); } @@ -2079,6 +2080,52 @@ void tst_QSettings::testRegistryShortRootNames() #endif } +void tst_QSettings::testRegistry32And64Bit() +{ +#if !defined (Q_OS_WIN) || defined(Q_OS_WINRT) + QSKIP("This test is specific to the Windows registry.", SkipAll); +#else + + const QString key("HKEY_LOCAL_MACHINE\\Software"); + const QString keyWow("HKEY_LOCAL_MACHINE\\Software\\Wow6432Node"); + +#ifndef Q_OS_WIN64 + // This branch is taken at compile time if targeting 32-bit; it does not + // necessarily mean that the OS running the test is 32-bit (it could be + // e.g. 64-bit). + QCOMPARE(QSettings(key, QSettings::NativeFormat).childGroups(), + QSettings(key, QSettings::Registry32Format).childGroups()); + + // Detect whether we are running under 64-bit Windows. + typedef BOOL (WINAPI *IsWow64ProcessPtr)(HANDLE hProcess, PBOOL Wow64Process); + IsWow64ProcessPtr IsWow64Process = (IsWow64ProcessPtr)QLibrary::resolve( + "kernel32.dll", "IsWow64Process"); + + if (IsWow64Process) { + BOOL IsWow64 = FALSE; + if (IsWow64Process(GetCurrentProcess(), &IsWow64) && IsWow64) { + // The 64-bit registry's "Wow6432Node" key should match the 32-bit registry. + // If we are not on 32-bit Windows, these should never be the same, + // because the 64-bit registry has a "Wow6432Node" key. + QCOMPARE(QSettings(keyWow, QSettings::Registry64Format).childGroups(), + QSettings(key, QSettings::Registry32Format).childGroups()); + } + } +#else + // This branch is taken at compile time if targeting 64-bit; it does not + // necessarily mean that the OS running the test is 64-bit (it could be + // e.g. 128-bit). + QCOMPARE(QSettings(key, QSettings::NativeFormat).childGroups(), + QSettings(key, QSettings::Registry64Format).childGroups()); + + // The 64-bit registry's "Wow6432Node" key should match the 32-bit registry. + QCOMPARE(QSettings(keyWow, QSettings::Registry64Format).childGroups(), + QSettings(key, QSettings::Registry32Format).childGroups()); +#endif + +#endif +} + void tst_QSettings::trailingWhitespace() { { @@ -3168,7 +3215,7 @@ void tst_QSettings::registerFormat() // so we can test error handling QSettings::Format custom3 = QSettings::registerFormat("custom3", readCustom3File, writeCustom3File); - QVERIFY(custom3 == QSettings::CustomFormat3); + QCOMPARE(custom3, QSettings::CustomFormat3); QDir dir(settingsPath()); QVERIFY(dir.mkpath("someDir")); @@ -3260,23 +3307,23 @@ void tst_QSettings::setPath() void tst_QSettings::setDefaultFormat() { - QVERIFY(QSettings::defaultFormat() == QSettings::NativeFormat); + QCOMPARE(QSettings::defaultFormat(), QSettings::NativeFormat); QSettings::setDefaultFormat(QSettings::CustomFormat1); QSettings settings1("org", "app"); QSettings settings2(QSettings::SystemScope, "org", "app"); QSettings settings3; - QVERIFY(settings1.format() == QSettings::NativeFormat); - QVERIFY(settings2.format() == QSettings::NativeFormat); - QVERIFY(settings3.format() == QSettings::CustomFormat1); + QCOMPARE(settings1.format(), QSettings::NativeFormat); + QCOMPARE(settings2.format(), QSettings::NativeFormat); + QCOMPARE(settings3.format(), QSettings::CustomFormat1); QSettings::setDefaultFormat(QSettings::NativeFormat); - QVERIFY(QSettings::defaultFormat() == QSettings::NativeFormat); + QCOMPARE(QSettings::defaultFormat(), QSettings::NativeFormat); - QVERIFY(settings1.format() == QSettings::NativeFormat); - QVERIFY(settings2.format() == QSettings::NativeFormat); - QVERIFY(settings3.format() == QSettings::CustomFormat1); + QCOMPARE(settings1.format(), QSettings::NativeFormat); + QCOMPARE(settings2.format(), QSettings::NativeFormat); + QCOMPARE(settings3.format(), QSettings::CustomFormat1); } void tst_QSettings::dontCreateNeedlessPaths() @@ -3337,7 +3384,7 @@ void tst_QSettings::dontReorderIniKeysNeedlessly() outFile.close(); QSettings settings(outFileName, QSettings::IniFormat); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); QVERIFY(settings.isWritable()); settings.setValue("Field 1/Bottom", 90); diff --git a/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro b/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro index 9fb6f9b31f..c72d9e4fad 100644 --- a/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro +++ b/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro @@ -3,4 +3,3 @@ TARGET = tst_qstandardpaths QT = core testlib SOURCES = tst_qstandardpaths.cpp TESTDATA += tst_qstandardpaths.cpp qstandardpaths.pro -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp index efbcdc78e0..aaaa0d4949 100644 --- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp +++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp @@ -61,9 +61,9 @@ void tst_QStorageInfo::defaultValues() QVERIFY(!storage.isRoot()); QVERIFY(storage.device().isEmpty()); QVERIFY(storage.fileSystemType().isEmpty()); - QVERIFY(storage.bytesTotal() == -1); - QVERIFY(storage.bytesFree() == -1); - QVERIFY(storage.bytesAvailable() == -1); + QCOMPARE(storage.bytesTotal(), -1); + QCOMPARE(storage.bytesFree(), -1); + QCOMPARE(storage.bytesAvailable(), -1); } void tst_QStorageInfo::operatorEqual() @@ -71,19 +71,19 @@ void tst_QStorageInfo::operatorEqual() { QStorageInfo storage1 = QStorageInfo::root(); QStorageInfo storage2(QDir::rootPath()); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } { QStorageInfo storage1(QCoreApplication::applicationDirPath()); QStorageInfo storage2(QCoreApplication::applicationFilePath()); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } { QStorageInfo storage1; QStorageInfo storage2; - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } } @@ -184,15 +184,15 @@ void tst_QStorageInfo::caching() qint64 free = storage1.bytesFree(); QStorageInfo storage2(storage1); - QVERIFY(free == storage2.bytesFree()); + QCOMPARE(free, storage2.bytesFree()); file.write(QByteArray(1024*1024, '\0')); file.flush(); - QVERIFY(free == storage1.bytesFree()); - QVERIFY(free == storage2.bytesFree()); + QCOMPARE(free, storage1.bytesFree()); + QCOMPARE(free, storage2.bytesFree()); storage2.refresh(); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); QVERIFY(free != storage2.bytesFree()); } #endif diff --git a/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro b/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro index 0908878514..4a69971f78 100644 --- a/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro +++ b/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro @@ -3,4 +3,3 @@ TARGET = tst_qtemporarydir SOURCES += tst_qtemporarydir.cpp QT = core testlib -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro b/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro index c16a729ad0..8f250e4568 100644 --- a/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro @@ -1,10 +1,8 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtemporaryfile QT = core testlib SOURCES = tst_qtemporaryfile.cpp TESTDATA += tst_qtemporaryfile.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 RESOURCES += qtemporaryfile.qrc android:!android-no-sdk { diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp index 94e6bbaade..1a586af569 100644 --- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp @@ -697,7 +697,7 @@ void tst_QTemporaryFile::createNativeFile() f.seek(currentPos); } QTemporaryFile *tempFile = QTemporaryFile::createNativeFile(f); - QVERIFY(valid == (bool)tempFile); + QCOMPARE(valid, (bool)tempFile); if (currentPos != -1) QCOMPARE(currentPos, f.pos()); if (valid) { diff --git a/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro b/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro index 578fa86f5c..4a4c091dcb 100644 --- a/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro +++ b/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro @@ -7,4 +7,3 @@ DESTDIR = ./ # This app is testdata for tst_qtextstream target.path = $$[QT_INSTALL_TESTS]/tst_qtextstream/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro b/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro index 578fa86f5c..4a4c091dcb 100644 --- a/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro +++ b/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro @@ -7,4 +7,3 @@ DESTDIR = ./ # This app is testdata for tst_qtextstream target.path = $$[QT_INSTALL_TESTS]/tst_qtextstream/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro b/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro index 578fa86f5c..4a4c091dcb 100644 --- a/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro +++ b/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro @@ -7,4 +7,3 @@ DESTDIR = ./ # This app is testdata for tst_qtextstream target.path = $$[QT_INSTALL_TESTS]/tst_qtextstream/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/test/test.pro b/tests/auto/corelib/io/qtextstream/test/test.pro index 39d181344f..93fb6d232f 100644 --- a/tests/auto/corelib/io/qtextstream/test/test.pro +++ b/tests/auto/corelib/io/qtextstream/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = ../tst_qtextstream QT = core network testlib SOURCES = ../tst_qtextstream.cpp @@ -20,4 +19,3 @@ TESTDATA += \ ../qtextstream.qrc \ ../tst_qtextstream.cpp \ ../resources -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index ecec97f009..532a53e5d3 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -1616,18 +1616,18 @@ void tst_QTextStream::forcePoint() { QString str; QTextStream stream(&str); - stream << fixed << forcepoint << 1.0 << " " << 1 << " " << 0 << " " << -1.0 << " " << -1; + stream << fixed << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1; QCOMPARE(str, QString("1.000000 1 0 -1.000000 -1")); str.clear(); stream.seek(0); - stream << scientific << forcepoint << 1.0 << " " << 1 << " " << 0 << " " << -1.0 << " " << -1; + stream << scientific << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1; QCOMPARE(str, QString("1.000000e+00 1 0 -1.000000e+00 -1")); str.clear(); stream.seek(0); stream.setRealNumberNotation(QTextStream::SmartNotation); - stream << forcepoint << 1.0 << " " << 1 << " " << 0 << " " << -1.0 << " " << -1; + stream << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1; QCOMPARE(str, QString("1.00000 1 0 -1.00000 -1")); } @@ -1637,7 +1637,7 @@ void tst_QTextStream::forceSign() { QString str; QTextStream stream(&str); - stream << forcesign << 1.2 << " " << -1.2 << " " << 0; + stream << forcesign << 1.2 << ' ' << -1.2 << ' ' << 0; QCOMPARE(str, QString("+1.2 -1.2 +0")); } @@ -1774,9 +1774,9 @@ void tst_QTextStream::nanInf() QString s; QTextStream out(&s); - out << qInf() << " " << -qInf() << " " << qQNaN() - << uppercasedigits << " " - << qInf() << " " << -qInf() << " " << qQNaN() + out << qInf() << ' ' << -qInf() << ' ' << qQNaN() + << uppercasedigits << ' ' + << qInf() << ' ' << -qInf() << ' ' << qQNaN() << flush; QCOMPARE(s, QString("inf -inf nan INF -INF NAN")); @@ -2566,7 +2566,7 @@ void tst_QTextStream::useCase1() stream.setCodec(QTextCodec::codecForName("ISO-8859-1")); stream.setAutoDetectUnicode(true); - stream << 4.15 << " " << QByteArray("abc") << " " << QString("ole"); + stream << 4.15 << ' ' << QByteArray("abc") << ' ' << QString("ole"); } file.seek(0); @@ -2602,7 +2602,7 @@ void tst_QTextStream::useCase2() stream.setCodec(QTextCodec::codecForName("ISO-8859-1")); stream.setAutoDetectUnicode(true); - stream << 4.15 << " " << QByteArray("abc") << " " << QString("ole"); + stream << 4.15 << ' ' << QByteArray("abc") << ' ' << QString("ole"); file.close(); QVERIFY(file.open(QFile::ReadWrite)); diff --git a/tests/auto/corelib/io/qurl/qurl.pro b/tests/auto/corelib/io/qurl/qurl.pro index f65a9c688c..c046c75522 100644 --- a/tests/auto/corelib/io/qurl/qurl.pro +++ b/tests/auto/corelib/io/qurl/qurl.pro @@ -1,7 +1,6 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qurl QT = core testlib concurrent SOURCES = tst_qurl.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 mac: OBJECTIVE_SOURCES += tst_qurl_mac.mm diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 7579c6713d..b64753e798 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -226,7 +226,7 @@ void tst_QUrl::constructing() QVERIFY(url.isEmpty()); QCOMPARE(url.port(), -1); QCOMPARE(url.toString(), QString()); - QVERIFY(url == url); + QCOMPARE(url, url); QVERIFY(!(url < url)); QUrl fromLocal = QUrl::fromLocalFile(QString()); @@ -254,7 +254,7 @@ void tst_QUrl::hashInPath() QCOMPARE(withHashInPath.toDisplayString(QUrl::PreferLocalFile), QString("hi%23mum.txt")); QUrl fromHashInPath = QUrl::fromEncoded(withHashInPath.toEncoded()); - QVERIFY(withHashInPath == fromHashInPath); + QCOMPARE(withHashInPath, fromHashInPath); const QUrl localWithHash = QUrl::fromLocalFile("/hi#mum.txt"); QCOMPARE(localWithHash.path(), QString::fromLatin1("/hi#mum.txt")); @@ -284,7 +284,7 @@ void tst_QUrl::assignment() QUrl copy; copy = url; - QVERIFY(url == copy); + QCOMPARE(url, copy); } void tst_QUrl::comparison() @@ -295,7 +295,7 @@ void tst_QUrl::comparison() QUrl url2("http://qt-project.org/"); QVERIFY(url2.isValid()); - QVERIFY(url1 == url2); + QCOMPARE(url1, url2); QVERIFY(!(url1 < url2)); QVERIFY(!(url2 < url1)); QVERIFY(url1.matches(url2, QUrl::None)); @@ -329,7 +329,7 @@ void tst_QUrl::comparison() url5.setEncodedQuery("a=%2a"); QUrl url6; url6.setEncodedQuery("a=%2A"); - QVERIFY(url5 == url6); + QCOMPARE(url5, url6); QUrl url7; url7.setEncodedQuery("a=C"); @@ -366,7 +366,7 @@ void tst_QUrl::comparison() QUrl hostUrl1("file:/foo"); QUrl hostUrl2("file:///foo"); - QVERIFY(hostUrl1 == hostUrl2); + QCOMPARE(hostUrl1, hostUrl2); QVERIFY(hostUrl1.matches(hostUrl2, QUrl::None)); QVERIFY(hostUrl1.matches(hostUrl2, QUrl::RemoveAuthority)); @@ -460,7 +460,7 @@ void tst_QUrl::copying() QUrl copy(url); - QVERIFY(url == copy); + QCOMPARE(url, copy); } void tst_QUrl::setUrl() @@ -1635,9 +1635,9 @@ void tst_QUrl::percentEncoding() QFETCH(QByteArray, encoded); QCOMPARE(QUrl(original).toEncoded().constData(), encoded.constData()); - QVERIFY(QUrl::fromEncoded(QUrl(original).toEncoded()) == QUrl(original)); + QCOMPARE(QUrl::fromEncoded(QUrl(original).toEncoded()), QUrl(original)); QCOMPARE(QUrl::fromEncoded(QUrl(original).toEncoded()).toString(), original); - QVERIFY(QUrl::fromEncoded(encoded) == QUrl(original)); + QCOMPARE(QUrl::fromEncoded(encoded), QUrl(original)); QCOMPARE(QUrl(QUrl(original).toString()).toString(), original); } @@ -3167,7 +3167,7 @@ void tst_QUrl::acceptEmptyAuthoritySegments() // However, file:/bar is the same as file:///bar QString file_triple_bar("file:///bar"), file_uni_bar("file:/bar"); - QVERIFY(QUrl(file_triple_bar) == QUrl(file_uni_bar)); + QCOMPARE(QUrl(file_triple_bar), QUrl(file_uni_bar)); QCOMPARE(QUrl(file_uni_bar).toString(), file_triple_bar); QCOMPARE(QUrl(file_uni_bar, QUrl::StrictMode).toString(), file_triple_bar); diff --git a/tests/auto/corelib/io/qurlinternal/qurlinternal.pro b/tests/auto/corelib/io/qurlinternal/qurlinternal.pro index c62cd045f3..ae5e023446 100644 --- a/tests/auto/corelib/io/qurlinternal/qurlinternal.pro +++ b/tests/auto/corelib/io/qurlinternal/qurlinternal.pro @@ -3,5 +3,3 @@ requires(contains(QT_CONFIG,private_tests)) TARGET = tst_qurlinternal SOURCES += tst_qurlinternal.cpp ../../codecs/utf8/utf8data.cpp QT = core core-private testlib -CONFIG += parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qurlquery/qurlquery.pro b/tests/auto/corelib/io/qurlquery/qurlquery.pro index 3284903d5b..68129f356f 100644 --- a/tests/auto/corelib/io/qurlquery/qurlquery.pro +++ b/tests/auto/corelib/io/qurlquery/qurlquery.pro @@ -1,6 +1,5 @@ QT = core core-private testlib TARGET = tst_qurlquery -CONFIG += parallel_test testcase +CONFIG += testcase SOURCES += tst_qurlquery.cpp DEFINES += SRCDIR=\\\"$$PWD/\\\" -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp index 769a96ac64..7df085df7c 100644 --- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp +++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp @@ -103,7 +103,7 @@ static QByteArray prettyList(const T &items) first = false; result += prettyPair(it); } - result += ")"; + result += QLatin1Char(')'); return result.toLocal8Bit(); } @@ -176,20 +176,20 @@ void tst_QUrlQuery::constructing() QUrlQuery copy(empty); QVERIFY(copy.isEmpty()); QVERIFY(!copy.isDetached()); - QVERIFY(copy == empty); + QCOMPARE(copy, empty); QCOMPARE(qHash(copy), qHash(empty)); QVERIFY(!(copy != empty)); copy = empty; - QVERIFY(copy == empty); + QCOMPARE(copy, empty); copy = QUrlQuery(); - QVERIFY(copy == empty); + QCOMPARE(copy, empty); QCOMPARE(qHash(copy), qHash(empty)); } { QUrlQuery copy(emptyQuery()); - QVERIFY(copy == empty); + QCOMPARE(copy, empty); } QVERIFY(!empty.hasQueryItem("a")); @@ -214,7 +214,7 @@ void tst_QUrlQuery::constructing() QVERIFY(!(other == empty)); QUrlQuery copy(other); - QVERIFY(copy == other); + QCOMPARE(copy, other); copy.clear(); QVERIFY(copy.isEmpty()); @@ -222,7 +222,7 @@ void tst_QUrlQuery::constructing() copy = other; QVERIFY(!copy.isEmpty()); - QVERIFY(copy == other); + QCOMPARE(copy, other); copy = QUrlQuery(); QVERIFY(copy.isEmpty()); @@ -298,7 +298,7 @@ void tst_QUrlQuery::addRemove() QCOMPARE(allItems.at(0).first, QString("a")); QCOMPARE(allItems.at(0).second, QString("b")); - QVERIFY(query == original); + QCOMPARE(query, original); QVERIFY(!(query != original)); QCOMPARE(qHash(query), qHash(original)); } @@ -346,7 +346,7 @@ void tst_QUrlQuery::multiAddRemove() QVERIFY(query.hasQueryItem("a")); // returns the first one - QVERIFY(query.queryItemValue("a") == "b"); + QCOMPARE(query.queryItemValue("a"), QLatin1String("b")); // order is the order we set them in QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c"); @@ -359,9 +359,9 @@ void tst_QUrlQuery::multiAddRemove() QVERIFY(query.hasQueryItem("A")); QVERIFY(query.hasQueryItem("a")); - QVERIFY(query.queryItemValue("a") == "b"); + QCOMPARE(query.queryItemValue("a"), QLatin1String("b")); QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c"); - QVERIFY(query.queryItemValue("A") == "B"); + QCOMPARE(query.queryItemValue("A"), QLatin1String("B")); QVERIFY(query.allQueryItemValues("A") == QStringList() << "B" << "C"); } @@ -371,7 +371,7 @@ void tst_QUrlQuery::multiAddRemove() QVERIFY(query.hasQueryItem("a")); // it must have removed the first one - QVERIFY(query.queryItemValue("a") == "c"); + QCOMPARE(query.queryItemValue("a"), QLatin1String("c")); } { @@ -720,7 +720,7 @@ void tst_QUrlQuery::old_queryItems() QVERIFY(!url.isEmpty()); QList<QPair<QString, QString> > setItems = url.queryItems(); - QVERIFY(newItems == setItems); + QCOMPARE(newItems, setItems); url.addQueryItem("1", "z"); @@ -746,18 +746,18 @@ void tst_QUrlQuery::old_queryItems() url.removeAllQueryItems("1"); QVERIFY(!url.hasQueryItem("1")); - QCOMPARE(url.queryItemValue("4").toLatin1().constData(), "a b"); - QCOMPARE(url.queryItemValue("5").toLatin1().constData(), "&"); - QCOMPARE(url.queryItemValue("tex").toLatin1().constData(), "a + b = c"); - QCOMPARE(url.queryItemValue("foo bar").toLatin1().constData(), "hello world"); + QCOMPARE(url.queryItemValue("4"), QLatin1String("a b")); + QCOMPARE(url.queryItemValue("5"), QLatin1String("&")); + QCOMPARE(url.queryItemValue("tex"), QLatin1String("a + b = c")); + QCOMPARE(url.queryItemValue("foo bar"), QLatin1String("hello world")); //url.setUrl("http://www.google.com/search?q=a+b"); url.setQuery("q=a+b"); - QCOMPARE(url.queryItemValue("q"), QString("a+b")); + QCOMPARE(url.queryItemValue("q"), QLatin1String("a+b")); //url.setUrl("http://www.google.com/search?q=a=b"); // invalid, but should be tolerated url.setQuery("q=a=b"); - QCOMPARE(url.queryItemValue("q"), QString("a=b")); + QCOMPARE(url.queryItemValue("q"), QLatin1String("a=b")); } void tst_QUrlQuery::old_hasQueryItem_data() diff --git a/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro b/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro index b7a36459f8..4f0e9da3c2 100644 --- a/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro +++ b/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qwinoverlappedionotifier QT = core-private testlib SOURCES = tst_qwinoverlappedionotifier.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp index 57a01e0a79..ad2aa0dfd3 100644 --- a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp +++ b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp @@ -199,7 +199,7 @@ void tst_QWinOverlappedIoNotifier::waitForAnyNotified() NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); notifier.setHandle(hFile); notifier.setEnabled(true); - QVERIFY(notifier.waitForAnyNotified(100) == 0); + QVERIFY(!notifier.waitForAnyNotified(100)); OVERLAPPED overlapped1; ZeroMemory(&overlapped1, sizeof(OVERLAPPED)); @@ -224,7 +224,7 @@ void tst_QWinOverlappedIoNotifier::waitForAnyNotified() CloseHandle(hFile); QVERIFY(overlappedObjects.isEmpty()); - QVERIFY(notifier.waitForAnyNotified(100) == 0); + QVERIFY(!notifier.waitForAnyNotified(100)); } void tst_QWinOverlappedIoNotifier::brokenPipe() diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/qabstractitemmodel.pro b/tests/auto/corelib/itemmodels/qabstractitemmodel/qabstractitemmodel.pro index ef571de192..7480bd45f6 100644 --- a/tests/auto/corelib/itemmodels/qabstractitemmodel/qabstractitemmodel.pro +++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/qabstractitemmodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstractitemmodel QT = core testlib diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp index c4d2df7c3e..450a1f84c6 100644 --- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -1699,8 +1699,8 @@ void tst_QAbstractItemModel::testMoveToDescendants() moveCommand->setDestRow(row); moveCommand->doCommand(); - QVERIFY(beforeSpy.size() == 0); - QVERIFY(afterSpy.size() == 0); + QCOMPARE(beforeSpy.size(), 0); + QCOMPARE(afterSpy.size(), 0); } } } @@ -1757,8 +1757,8 @@ void tst_QAbstractItemModel::testMoveWithinOwnRange() moveCommand->setDestRow(destRow); moveCommand->doCommand(); - QVERIFY(beforeSpy.size() == 0); - QVERIFY(afterSpy.size() == 0); + QCOMPARE(beforeSpy.size(), 0); + QCOMPARE(afterSpy.size(), 0); } class ListenerObject : public QObject @@ -1823,7 +1823,7 @@ void ListenerObject::slotAboutToBeReset() // Nothing has been changed yet. All indexes should be the same. for (int i = 0; i < m_persistentIndexes.size(); ++i) { QModelIndex idx = m_persistentIndexes.at(i); - QVERIFY(idx == m_nonPersistentIndexes.at(i)); + QCOMPARE(idx, m_nonPersistentIndexes.at(i)); QVERIFY(m_model->mapToSource(idx).isValid()); } } @@ -1859,13 +1859,13 @@ void tst_QAbstractItemModel::testReset() resetCommand->doCommand(); // Verify that the correct signals were emitted - QVERIFY(beforeResetSpy.size() == 1); - QVERIFY(afterResetSpy.size() == 1); + QCOMPARE(beforeResetSpy.size(), 1); + QCOMPARE(afterResetSpy.size(), 1); // Verify that the move actually happened. - QVERIFY(m_model->rowCount() == 9); + QCOMPARE(m_model->rowCount(), 9); QModelIndex destIndex = m_model->index(4, 0); - QVERIFY(m_model->rowCount(destIndex) == 11); + QCOMPARE(m_model->rowCount(destIndex), 11); // Delete it because its slots test things which are not true after this point. delete listener; @@ -1877,14 +1877,14 @@ void tst_QAbstractItemModel::testReset() QCOMPARE(nullProxy->roleNames().value(Qt::UserRole + 1), QByteArray()); nullProxy->setSourceModel(new ModelWithCustomRole(this)); - QVERIFY(proxyBeforeResetSpy.size() == 1); - QVERIFY(proxyAfterResetSpy.size() == 1); + QCOMPARE(proxyBeforeResetSpy.size(), 1); + QCOMPARE(proxyAfterResetSpy.size(), 1); QCOMPARE(nullProxy->roleNames().value(Qt::UserRole + 1), QByteArray("custom")); nullProxy->setSourceModel(m_model); - QVERIFY(proxyBeforeResetSpy.size() == 2); - QVERIFY(proxyAfterResetSpy.size() == 2); + QCOMPARE(proxyBeforeResetSpy.size(), 2); + QCOMPARE(proxyAfterResetSpy.size(), 2); // After being reset the proxy must be queried again. QCOMPARE(nullProxy->roleNames().value(Qt::UserRole + 1), QByteArray()); @@ -2055,10 +2055,10 @@ void tst_QAbstractItemModel::testChildrenLayoutsChanged() QVERIFY(afterParents.contains(p2)); // The first will be the last, and the lest will be the first. - QVERIFY(p1FirstPersistent.row() == 1); - QVERIFY(p1LastPersistent.row() == 0); - QVERIFY(p2FirstPersistent.row() == 9); - QVERIFY(p2LastPersistent.row() == 8); + QCOMPARE(p1FirstPersistent.row(), 1); + QCOMPARE(p1LastPersistent.row(), 0); + QCOMPARE(p2FirstPersistent.row(), 9); + QCOMPARE(p2LastPersistent.row(), 8); } insertCommand = new ModelInsertCommand(&model, this); @@ -2115,8 +2115,8 @@ void tst_QAbstractItemModel::testChildrenLayoutsChanged() QCOMPARE(beforeSignal.size(), 2); QCOMPARE(afterSignal.size(), 2); - QVERIFY(p1FirstPersistent.row() == 1); - QVERIFY(p1LastPersistent.row() == 0); + QCOMPARE(p1FirstPersistent.row(), 1); + QCOMPARE(p1LastPersistent.row(), 0); QCOMPARE(p2FirstPersistent.row(), 9); QCOMPARE(p2LastPersistent.row(), 8); } diff --git a/tests/auto/corelib/itemmodels/qabstractproxymodel/qabstractproxymodel.pro b/tests/auto/corelib/itemmodels/qabstractproxymodel/qabstractproxymodel.pro index 7209620b91..19aec43072 100644 --- a/tests/auto/corelib/itemmodels/qabstractproxymodel/qabstractproxymodel.pro +++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/qabstractproxymodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstractproxymodel QT += testlib SOURCES += tst_qabstractproxymodel.cpp diff --git a/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp b/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp index fb9d118d60..fbe123bca0 100644 --- a/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp @@ -351,7 +351,7 @@ static void verifySubSetOf(const QHash<int, QByteArray> &superSet, const QHash<i const QHash<int, QByteArray>::const_iterator end = subSet.constEnd(); for ( ; it != end; ++it ) { QVERIFY(superSet.contains(it.key())); - QVERIFY(it.value() == superSet.value(it.key())); + QCOMPARE(it.value(), superSet.value(it.key())); } } diff --git a/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro b/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro index f57b419ae5..ba32f02962 100644 --- a/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro +++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qidentityproxymodel mtdir = ../../../other/modeltest @@ -7,4 +6,3 @@ INCLUDEPATH += $$PWD/$${mtdir} QT += testlib SOURCES += tst_qidentityproxymodel.cpp $${mtdir}/dynamictreemodel.cpp $${mtdir}/modeltest.cpp HEADERS += $${mtdir}/dynamictreemodel.h $${mtdir}/modeltest.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp index 9eb3bc5113..208214fbc5 100644 --- a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp @@ -111,25 +111,25 @@ void tst_QIdentityProxyModel::verifyIdentity(QAbstractItemModel *model, const QM const int columns = model->columnCount(parent); const QModelIndex proxyParent = m_proxy->mapFromSource(parent); - QVERIFY(m_proxy->mapToSource(proxyParent) == parent); - QVERIFY(rows == m_proxy->rowCount(proxyParent)); - QVERIFY(columns == m_proxy->columnCount(proxyParent)); + QCOMPARE(m_proxy->mapToSource(proxyParent), parent); + QCOMPARE(rows, m_proxy->rowCount(proxyParent)); + QCOMPARE(columns, m_proxy->columnCount(proxyParent)); for (int row = 0; row < rows; ++row) { for (int column = 0; column < columns; ++column) { const QModelIndex idx = model->index(row, column, parent); const QModelIndex proxyIdx = m_proxy->mapFromSource(idx); - QVERIFY(proxyIdx.model() == m_proxy); - QVERIFY(m_proxy->mapToSource(proxyIdx) == idx); + QCOMPARE(proxyIdx.model(), m_proxy); + QCOMPARE(m_proxy->mapToSource(proxyIdx), idx); QVERIFY(proxyIdx.isValid()); - QVERIFY(proxyIdx.row() == row); - QVERIFY(proxyIdx.column() == column); - QVERIFY(proxyIdx.parent() == proxyParent); - QVERIFY(proxyIdx.data() == idx.data()); - QVERIFY(proxyIdx.flags() == idx.flags()); + QCOMPARE(proxyIdx.row(), row); + QCOMPARE(proxyIdx.column(), column); + QCOMPARE(proxyIdx.parent(), proxyParent); + QCOMPARE(proxyIdx.data(), idx.data()); + QCOMPARE(proxyIdx.flags(), idx.flags()); const int childCount = m_proxy->rowCount(proxyIdx); const bool hasChildren = m_proxy->hasChildren(proxyIdx); - QVERIFY(model->hasChildren(idx) == hasChildren); + QCOMPARE(model->hasChildren(idx), hasChildren); QVERIFY((childCount > 0) == hasChildren); if (hasChildren) @@ -171,13 +171,13 @@ void tst_QIdentityProxyModel::insertRows() QVERIFY(modelBeforeSpy.size() == 1 && 1 == proxyBeforeSpy.size()); QVERIFY(modelAfterSpy.size() == 1 && 1 == proxyAfterSpy.size()); - QVERIFY(modelBeforeSpy.first().first().value<QModelIndex>() == m_proxy->mapToSource(proxyBeforeSpy.first().first().value<QModelIndex>())); - QVERIFY(modelBeforeSpy.first().at(1) == proxyBeforeSpy.first().at(1)); - QVERIFY(modelBeforeSpy.first().at(2) == proxyBeforeSpy.first().at(2)); + QCOMPARE(modelBeforeSpy.first().first().value<QModelIndex>(), m_proxy->mapToSource(proxyBeforeSpy.first().first().value<QModelIndex>())); + QCOMPARE(modelBeforeSpy.first().at(1), proxyBeforeSpy.first().at(1)); + QCOMPARE(modelBeforeSpy.first().at(2), proxyBeforeSpy.first().at(2)); - QVERIFY(modelAfterSpy.first().first().value<QModelIndex>() == m_proxy->mapToSource(proxyAfterSpy.first().first().value<QModelIndex>())); - QVERIFY(modelAfterSpy.first().at(1) == proxyAfterSpy.first().at(1)); - QVERIFY(modelAfterSpy.first().at(2) == proxyAfterSpy.first().at(2)); + QCOMPARE(modelAfterSpy.first().first().value<QModelIndex>(), m_proxy->mapToSource(proxyAfterSpy.first().first().value<QModelIndex>())); + QCOMPARE(modelAfterSpy.first().at(1), proxyAfterSpy.first().at(1)); + QCOMPARE(modelAfterSpy.first().at(2), proxyAfterSpy.first().at(2)); verifyIdentity(m_model); } @@ -216,13 +216,13 @@ void tst_QIdentityProxyModel::removeRows() QVERIFY(modelBeforeSpy.size() == 1 && 1 == proxyBeforeSpy.size()); QVERIFY(modelAfterSpy.size() == 1 && 1 == proxyAfterSpy.size()); - QVERIFY(modelBeforeSpy.first().first().value<QModelIndex>() == m_proxy->mapToSource(proxyBeforeSpy.first().first().value<QModelIndex>())); - QVERIFY(modelBeforeSpy.first().at(1) == proxyBeforeSpy.first().at(1)); - QVERIFY(modelBeforeSpy.first().at(2) == proxyBeforeSpy.first().at(2)); + QCOMPARE(modelBeforeSpy.first().first().value<QModelIndex>(), m_proxy->mapToSource(proxyBeforeSpy.first().first().value<QModelIndex>())); + QCOMPARE(modelBeforeSpy.first().at(1), proxyBeforeSpy.first().at(1)); + QCOMPARE(modelBeforeSpy.first().at(2), proxyBeforeSpy.first().at(2)); - QVERIFY(modelAfterSpy.first().first().value<QModelIndex>() == m_proxy->mapToSource(proxyAfterSpy.first().first().value<QModelIndex>())); - QVERIFY(modelAfterSpy.first().at(1) == proxyAfterSpy.first().at(1)); - QVERIFY(modelAfterSpy.first().at(2) == proxyAfterSpy.first().at(2)); + QCOMPARE(modelAfterSpy.first().first().value<QModelIndex>(), m_proxy->mapToSource(proxyAfterSpy.first().first().value<QModelIndex>())); + QCOMPARE(modelAfterSpy.first().at(1), proxyAfterSpy.first().at(1)); + QCOMPARE(modelAfterSpy.first().at(2), proxyAfterSpy.first().at(2)); verifyIdentity(m_model); } @@ -271,17 +271,17 @@ void tst_QIdentityProxyModel::moveRows() QVERIFY(modelBeforeSpy.size() == 1 && 1 == proxyBeforeSpy.size()); QVERIFY(modelAfterSpy.size() == 1 && 1 == proxyAfterSpy.size()); - QVERIFY(modelBeforeSpy.first().first().value<QModelIndex>() == m_proxy->mapToSource(proxyBeforeSpy.first().first().value<QModelIndex>())); - QVERIFY(modelBeforeSpy.first().at(1) == proxyBeforeSpy.first().at(1)); - QVERIFY(modelBeforeSpy.first().at(2) == proxyBeforeSpy.first().at(2)); - QVERIFY(modelBeforeSpy.first().at(3).value<QModelIndex>() == m_proxy->mapToSource(proxyBeforeSpy.first().at(3).value<QModelIndex>())); - QVERIFY(modelBeforeSpy.first().at(4) == proxyBeforeSpy.first().at(4)); + QCOMPARE(modelBeforeSpy.first().first().value<QModelIndex>(), m_proxy->mapToSource(proxyBeforeSpy.first().first().value<QModelIndex>())); + QCOMPARE(modelBeforeSpy.first().at(1), proxyBeforeSpy.first().at(1)); + QCOMPARE(modelBeforeSpy.first().at(2), proxyBeforeSpy.first().at(2)); + QCOMPARE(modelBeforeSpy.first().at(3).value<QModelIndex>(), m_proxy->mapToSource(proxyBeforeSpy.first().at(3).value<QModelIndex>())); + QCOMPARE(modelBeforeSpy.first().at(4), proxyBeforeSpy.first().at(4)); - QVERIFY(modelAfterSpy.first().first().value<QModelIndex>() == m_proxy->mapToSource(proxyAfterSpy.first().first().value<QModelIndex>())); - QVERIFY(modelAfterSpy.first().at(1) == proxyAfterSpy.first().at(1)); - QVERIFY(modelAfterSpy.first().at(2) == proxyAfterSpy.first().at(2)); - QVERIFY(modelAfterSpy.first().at(3).value<QModelIndex>() == m_proxy->mapToSource(proxyAfterSpy.first().at(3).value<QModelIndex>())); - QVERIFY(modelAfterSpy.first().at(4) == proxyAfterSpy.first().at(4)); + QCOMPARE(modelAfterSpy.first().first().value<QModelIndex>(), m_proxy->mapToSource(proxyAfterSpy.first().first().value<QModelIndex>())); + QCOMPARE(modelAfterSpy.first().at(1), proxyAfterSpy.first().at(1)); + QCOMPARE(modelAfterSpy.first().at(2), proxyAfterSpy.first().at(2)); + QCOMPARE(modelAfterSpy.first().at(3).value<QModelIndex>(), m_proxy->mapToSource(proxyAfterSpy.first().at(3).value<QModelIndex>())); + QCOMPARE(modelAfterSpy.first().at(4), proxyAfterSpy.first().at(4)); verifyIdentity(&model); @@ -352,7 +352,7 @@ void tst_QIdentityProxyModel::dataChanged() model.changeData(); QCOMPARE(modelSpy.first().at(2).value<QVector<int> >(), QVector<int>() << 1); - QVERIFY(modelSpy.first().at(2) == proxySpy.first().at(2)); + QCOMPARE(modelSpy.first().at(2), proxySpy.first().at(2)); verifyIdentity(&model); m_proxy->setSourceModel(0); diff --git a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp index ba143a31f8..0c8e5690d0 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp +++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp @@ -233,7 +233,7 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) { if (QStringListModel *stringListModel = qobject_cast<QStringListModel *>(model)) { QString alphabet = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"; - stringListModel->setStringList( alphabet.split(",") ); + stringListModel->setStringList( alphabet.split(QLatin1Char(',')) ); return QModelIndex(); } diff --git a/tests/auto/corelib/itemmodels/qitemmodel/qitemmodel.pro b/tests/auto/corelib/itemmodels/qitemmodel/qitemmodel.pro index 42c9c8f9fb..ff21d6afa5 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/qitemmodel.pro +++ b/tests/auto/corelib/itemmodels/qitemmodel/qitemmodel.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qitemmodel QT += widgets sql testlib SOURCES = tst_qitemmodel.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp index 709b35b6e0..1531e0ac40 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp +++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp @@ -351,7 +351,7 @@ void tst_QItemModel::index() // Make sure that the same index is always returned QModelIndex a = currentModel->index(0,0); QModelIndex b = currentModel->index(0,0); - QVERIFY(a == b); + QCOMPARE(a, b); // index is tested more extensivly more later in checkChildren(), // but this catches the big mistakes @@ -415,7 +415,7 @@ void checkChildren(QAbstractItemModel *currentModel, const QModelIndex &parent, // Make sure we get the same index if we request it twice in a row QModelIndex a = currentModel->index(r, c, parent); QModelIndex b = currentModel->index(r, c, parent); - QVERIFY(a == b); + QCOMPARE(a, b); { const QModelIndex sibling = currentModel->sibling( r, c, topLeftChild ); @@ -427,7 +427,7 @@ void checkChildren(QAbstractItemModel *currentModel, const QModelIndex &parent, } // Some basic checking on the index that is returned - QVERIFY(index.model() == currentModel); + QCOMPARE(index.model(), currentModel); QCOMPARE(index.row(), r); QCOMPARE(index.column(), c); QCOMPARE(currentModel->data(index, Qt::DisplayRole).isValid(), true); diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro b/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro index 1b6279ba1b..4dcddc8feb 100644 --- a/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qitemselectionmodel QT += testlib SOURCES += tst_qitemselectionmodel.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp index 38e2900c25..629bbad5aa 100644 --- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -1515,7 +1515,7 @@ class MyStandardItemModel: public QStandardItemModel Q_OBJECT public: inline MyStandardItemModel(int i1, int i2): QStandardItemModel(i1, i2) {} - inline void reset() { QStandardItemModel::reset(); } + inline void reset() { beginResetModel(); endResetModel(); } }; void tst_QItemSelectionModel::resetModel() @@ -1760,7 +1760,7 @@ void tst_QItemSelectionModel::modelLayoutChanged() // verify that selection is as expected QItemSelection selection = selectionModel.selection(); QCOMPARE(selection.count(), expectedSelectedRanges.count()); - QVERIFY(selectionModel.hasSelection() == !expectedSelectedRanges.isEmpty()); + QCOMPARE(selectionModel.hasSelection(), !expectedSelectedRanges.isEmpty()); for (int i = 0; i < expectedSelectedRanges.count(); ++i) { IntPairPair expectedRange = expectedSelectedRanges.at(i); @@ -2217,7 +2217,7 @@ void tst_QItemSelectionModel::childrenDeselectionSignal() QSignalSpy deselectSpy(&selectionModel, &QItemSelectionModel::selectionChanged); QVERIFY(deselectSpy.isValid()); model.removeRows(0, 1, root); - QVERIFY(deselectSpy.count() == 1); + QCOMPARE(deselectSpy.count(), 1); // More testing stress for the patch. model.clear(); @@ -2245,7 +2245,7 @@ void tst_QItemSelectionModel::childrenDeselectionSignal() QVERIFY(selectionModel.selection().contains(sel2)); deselectSpy.clear(); model.removeRow(0, model.index(0, 0)); - QVERIFY(deselectSpy.count() == 1); + QCOMPARE(deselectSpy.count(), 1); QVERIFY(!selectionModel.selection().contains(sel)); QVERIFY(selectionModel.selection().contains(sel2)); } @@ -2375,7 +2375,7 @@ public slots: foreach(const QModelIndex &index, deselected.indexes()) { QVERIFY(!m_itemSelectionModel->selection().contains(index)); } - QVERIFY(m_itemSelectionModel->selection().size() == 2); + QCOMPARE(m_itemSelectionModel->selection().size(), 2); } }; @@ -2393,7 +2393,7 @@ void tst_QItemSelectionModel::deselectRemovedMiddleRange() selModel.select(QItemSelection(model.index(3, 0), model.index(6, 0)), QItemSelectionModel::Select); - QVERIFY(selModel.selection().size() == 1); + QCOMPARE(selModel.selection().size(), 1); RemovalObserver ro(&selModel); @@ -2402,7 +2402,7 @@ void tst_QItemSelectionModel::deselectRemovedMiddleRange() bool ok = model.removeRows(4, 2); QVERIFY(ok); - QVERIFY(spy.size() == 1); + QCOMPARE(spy.size(), 1); } static QStandardItemModel* getModel(QObject *parent) @@ -2713,8 +2713,8 @@ void tst_QItemSelectionModel::testChainedSelectionClear() QModelIndexList selectedIndexes = selectionModel.selection().indexes(); QModelIndexList duplicatedIndexes = duplicate.selection().indexes(); - QVERIFY(selectedIndexes.size() == duplicatedIndexes.size()); - QVERIFY(selectedIndexes.size() == 1); + QCOMPARE(selectedIndexes.size(), duplicatedIndexes.size()); + QCOMPARE(selectedIndexes.size(), 1); QVERIFY(selectedIndexes.first() == model.index(0, 0)); } @@ -2724,18 +2724,18 @@ void tst_QItemSelectionModel::testChainedSelectionClear() QModelIndexList selectedIndexes = selectionModel.selection().indexes(); QModelIndexList duplicatedIndexes = duplicate.selection().indexes(); - QVERIFY(selectedIndexes.size() == duplicatedIndexes.size()); - QVERIFY(selectedIndexes.size() == 0); + QCOMPARE(selectedIndexes.size(), duplicatedIndexes.size()); + QCOMPARE(selectedIndexes.size(), 0); } duplicate.setCurrentIndex(model.index(0, 0), QItemSelectionModel::NoUpdate); - QVERIFY(selectionModel.currentIndex() == duplicate.currentIndex()); + QCOMPARE(selectionModel.currentIndex(), duplicate.currentIndex()); duplicate.clearCurrentIndex(); QVERIFY(!duplicate.currentIndex().isValid()); - QVERIFY(selectionModel.currentIndex() == duplicate.currentIndex()); + QCOMPARE(selectionModel.currentIndex(), duplicate.currentIndex()); } void tst_QItemSelectionModel::testClearCurrentIndex() @@ -2750,13 +2750,13 @@ void tst_QItemSelectionModel::testClearCurrentIndex() QModelIndex firstIndex = model.index(0, 0); QVERIFY(firstIndex.isValid()); selectionModel.setCurrentIndex(firstIndex, QItemSelectionModel::NoUpdate); - QVERIFY(selectionModel.currentIndex() == firstIndex); - QVERIFY(currentIndexSpy.size() == 1); + QCOMPARE(selectionModel.currentIndex(), firstIndex); + QCOMPARE(currentIndexSpy.size(), 1); selectionModel.clearCurrentIndex(); - QVERIFY(selectionModel.currentIndex() == QModelIndex()); - QVERIFY(currentIndexSpy.size() == 2); + QCOMPARE(selectionModel.currentIndex(), QModelIndex()); + QCOMPARE(currentIndexSpy.size(), 2); } void tst_QItemSelectionModel::QTBUG48402_data() diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro index 25947990a7..099f666def 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsortfilterproxymodel QT += widgets testlib @@ -8,4 +7,3 @@ mtdir = ../../../other/modeltest INCLUDEPATH += $$PWD/$${mtdir} SOURCES += tst_qsortfilterproxymodel.cpp $${mtdir}/dynamictreemodel.cpp $${mtdir}/modeltest.cpp HEADERS += $${mtdir}/dynamictreemodel.h $${mtdir}/modeltest.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 0302ae5cbf..12b3d983c0 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -1346,14 +1346,14 @@ void tst_QSortFilterProxyModel::buildHierarchy(const QStringList &l, QAbstractIt QStack<QModelIndex> parent_stack; for (int i = 0; i < l.count(); ++i) { QString token = l.at(i); - if (token == "<") { // start table + if (token == QLatin1String("<")) { // start table ++ind; parent_stack.push(parent); row_stack.push(row); parent = m->index(row - 1, 0, parent); row = 0; QVERIFY(m->insertColumns(0, 1, parent)); // add column - } else if (token == ">") { // end table + } else if (token == QLatin1String(">")) { // end table --ind; parent = parent_stack.pop(); row = row_stack.pop(); @@ -1376,14 +1376,14 @@ void tst_QSortFilterProxyModel::checkHierarchy(const QStringList &l, const QAbst QStack<QModelIndex> parent_stack; for (int i = 0; i < l.count(); ++i) { QString token = l.at(i); - if (token == "<") { // start table + if (token == QLatin1String("<")) { // start table ++indent; parent_stack.push(parent); row_stack.push(row); parent = m->index(row - 1, 0, parent); QVERIFY(parent.isValid()); row = 0; - } else if (token == ">") { // end table + } else if (token == QLatin1String(">")) { // end table --indent; parent = parent_stack.pop(); row = row_stack.pop(); @@ -1418,7 +1418,7 @@ void tst_QSortFilterProxyModel::filterTable() filter.setFilterRegExp("9"); for (int i = 0; i < filter.rowCount(); ++i) - QVERIFY(filter.data(filter.index(i, 0)).toString().contains("9")); + QVERIFY(filter.data(filter.index(i, 0)).toString().contains(QLatin1Char('9'))); } void tst_QSortFilterProxyModel::insertAfterSelect() @@ -1663,16 +1663,16 @@ void tst_QSortFilterProxyModel::removeSourceRows() QCOMPARE(aboutToRemoveSpy.count(), expectedRemovedProxyIntervals.count()); for (int i = 0; i < aboutToRemoveSpy.count(); ++i) { QList<QVariant> args = aboutToRemoveSpy.at(i); - QVERIFY(args.at(1).type() == QVariant::Int); - QVERIFY(args.at(2).type() == QVariant::Int); + QCOMPARE(args.at(1).type(), QVariant::Int); + QCOMPARE(args.at(2).type(), QVariant::Int); QCOMPARE(args.at(1).toInt(), expectedRemovedProxyIntervals.at(i).first); QCOMPARE(args.at(2).toInt(), expectedRemovedProxyIntervals.at(i).second); } QCOMPARE(removeSpy.count(), expectedRemovedProxyIntervals.count()); for (int i = 0; i < removeSpy.count(); ++i) { QList<QVariant> args = removeSpy.at(i); - QVERIFY(args.at(1).type() == QVariant::Int); - QVERIFY(args.at(2).type() == QVariant::Int); + QCOMPARE(args.at(1).type(), QVariant::Int); + QCOMPARE(args.at(2).type(), QVariant::Int); QCOMPARE(args.at(1).toInt(), expectedRemovedProxyIntervals.at(i).first); QCOMPARE(args.at(2).toInt(), expectedRemovedProxyIntervals.at(i).second); } @@ -1841,8 +1841,8 @@ void tst_QSortFilterProxyModel::changeFilter() QCOMPARE(initialInsertSpy.count(), 0); for (int i = 0; i < initialRemoveSpy.count(); ++i) { QList<QVariant> args = initialRemoveSpy.at(i); - QVERIFY(args.at(1).type() == QVariant::Int); - QVERIFY(args.at(2).type() == QVariant::Int); + QCOMPARE(args.at(1).type(), QVariant::Int); + QCOMPARE(args.at(2).type(), QVariant::Int); QCOMPARE(args.at(1).toInt(), initialRemoveIntervals.at(i).first); QCOMPARE(args.at(2).toInt(), initialRemoveIntervals.at(i).second); } @@ -1864,8 +1864,8 @@ void tst_QSortFilterProxyModel::changeFilter() QCOMPARE(finalRemoveSpy.count(), finalRemoveIntervals.count()); for (int i = 0; i < finalRemoveSpy.count(); ++i) { QList<QVariant> args = finalRemoveSpy.at(i); - QVERIFY(args.at(1).type() == QVariant::Int); - QVERIFY(args.at(2).type() == QVariant::Int); + QCOMPARE(args.at(1).type(), QVariant::Int); + QCOMPARE(args.at(2).type(), QVariant::Int); QCOMPARE(args.at(1).toInt(), finalRemoveIntervals.at(i).first); QCOMPARE(args.at(2).toInt(), finalRemoveIntervals.at(i).second); } @@ -1876,8 +1876,8 @@ void tst_QSortFilterProxyModel::changeFilter() QCOMPARE(finalInsertSpy.count(), insertIntervals.count()); for (int i = 0; i < finalInsertSpy.count(); ++i) { QList<QVariant> args = finalInsertSpy.at(i); - QVERIFY(args.at(1).type() == QVariant::Int); - QVERIFY(args.at(2).type() == QVariant::Int); + QCOMPARE(args.at(1).type(), QVariant::Int); + QCOMPARE(args.at(2).type(), QVariant::Int); QCOMPARE(args.at(1).toInt(), insertIntervals.at(i).first); QCOMPARE(args.at(2).toInt(), insertIntervals.at(i).second); } @@ -2018,8 +2018,8 @@ void tst_QSortFilterProxyModel::changeSourceData() QCOMPARE(removeSpy.count(), removeIntervals.count()); for (int i = 0; i < removeSpy.count(); ++i) { QList<QVariant> args = removeSpy.at(i); - QVERIFY(args.at(1).type() == QVariant::Int); - QVERIFY(args.at(2).type() == QVariant::Int); + QCOMPARE(args.at(1).type(), QVariant::Int); + QCOMPARE(args.at(2).type(), QVariant::Int); QCOMPARE(args.at(1).toInt(), removeIntervals.at(i).first); QCOMPARE(args.at(2).toInt(), removeIntervals.at(i).second); } @@ -2027,8 +2027,8 @@ void tst_QSortFilterProxyModel::changeSourceData() QCOMPARE(insertSpy.count(), insertIntervals.count()); for (int i = 0; i < insertSpy.count(); ++i) { QList<QVariant> args = insertSpy.at(i); - QVERIFY(args.at(1).type() == QVariant::Int); - QVERIFY(args.at(2).type() == QVariant::Int); + QCOMPARE(args.at(1).type(), QVariant::Int); + QCOMPARE(args.at(2).type(), QVariant::Int); QCOMPARE(args.at(1).toInt(), insertIntervals.at(i).first); QCOMPARE(args.at(2).toInt(), insertIntervals.at(i).second); } @@ -2581,7 +2581,7 @@ void tst_QSortFilterProxyModel::hiddenColumns() public: MyStandardItemModel() : QStandardItemModel(0,5) {} void reset() - { QStandardItemModel::reset(); } + { beginResetModel(); endResetModel(); } friend class tst_QSortFilterProxyModel; } model; QSortFilterProxyModel proxy; @@ -2625,7 +2625,7 @@ void tst_QSortFilterProxyModel::staticSorting() QSortFilterProxyModel proxy; proxy.setSourceModel(&model); proxy.setDynamicSortFilter(false); - QStringList initial = QString("bateau avion dragon hirondelle flamme camion elephant").split(" "); + QStringList initial = QString("bateau avion dragon hirondelle flamme camion elephant").split(QLatin1Char(' ')); // prepare model QStandardItem *root = model.invisibleRootItem (); @@ -2680,7 +2680,7 @@ void tst_QSortFilterProxyModel::staticSorting() void tst_QSortFilterProxyModel::dynamicSorting() { QStringListModel model1; - const QStringList initial = QString("bateau avion dragon hirondelle flamme camion elephant").split(" "); + const QStringList initial = QString("bateau avion dragon hirondelle flamme camion elephant").split(QLatin1Char(' ')); model1.setStringList(initial); QSortFilterProxyModel proxy1; proxy1.setDynamicSortFilter(false); @@ -3078,7 +3078,7 @@ void tst_QSortFilterProxyModel::appearsAndSort() void tst_QSortFilterProxyModel::unnecessaryDynamicSorting() { QStringListModel model; - const QStringList initial = QString("bravo charlie delta echo").split(" "); + const QStringList initial = QString("bravo charlie delta echo").split(QLatin1Char(' ')); model.setStringList(initial); QSortFilterProxyModel proxy; proxy.setDynamicSortFilter(false); @@ -3162,7 +3162,7 @@ private: void tst_QSortFilterProxyModel::testMultipleProxiesWithSelection() { QStringListModel model; - const QStringList initial = QString("bravo charlie delta echo").split(" "); + const QStringList initial = QString("bravo charlie delta echo").split(QLatin1Char(' ')); model.setStringList(initial); QSortFilterProxyModel proxy; @@ -3196,7 +3196,7 @@ static bool isValid(const QItemSelection &selection) void tst_QSortFilterProxyModel::mapSelectionFromSource() { QStringListModel model; - const QStringList initial = QString("bravo charlie delta echo").split(" "); + const QStringList initial = QString("bravo charlie delta echo").split(QLatin1Char(' ')); model.setStringList(initial); QSortFilterProxyModel proxy; @@ -3205,7 +3205,7 @@ void tst_QSortFilterProxyModel::mapSelectionFromSource() proxy.setSourceModel(&model); // Only "delta" remains. - QVERIFY(proxy.rowCount() == 1); + QCOMPARE(proxy.rowCount(), 1); QItemSelection selection; QModelIndex charlie = model.index(1, 0); @@ -3220,7 +3220,7 @@ void tst_QSortFilterProxyModel::mapSelectionFromSource() QItemSelection proxiedSelection = proxy.mapSelectionFromSource(selection); // Only "delta" is in the mapped result. - QVERIFY(proxiedSelection.size() == 1); + QCOMPARE(proxiedSelection.size(), 1); QVERIFY(isValid(proxiedSelection)); } @@ -3377,7 +3377,10 @@ void tst_QSortFilterProxyModel::resetInvalidate() { switch (test) { case 0: break; - case 1: reset(); break; + case 1: + beginResetModel(); + endResetModel(); + break; case 2: invalidate(); break; case 3: invalidateFilter(); break; } diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/qstringlistmodel.pro b/tests/auto/corelib/itemmodels/qstringlistmodel/qstringlistmodel.pro index e11e16b203..91a4cf306c 100644 --- a/tests/auto/corelib/itemmodels/qstringlistmodel/qstringlistmodel.pro +++ b/tests/auto/corelib/itemmodels/qstringlistmodel/qstringlistmodel.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstringlistmodel QT = core testlib HEADERS += qmodellistener.h SOURCES += tst_qstringlistmodel.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/json/json.pro b/tests/auto/corelib/json/json.pro index 237e20685a..4644ae27e6 100644 --- a/tests/auto/corelib/json/json.pro +++ b/tests/auto/corelib/json/json.pro @@ -2,10 +2,8 @@ TARGET = tst_json QT = core testlib CONFIG -= app_bundle CONFIG += testcase -CONFIG += parallel_test !android:TESTDATA += test.json test.bjson test3.json test2.json else:RESOURCES += json.qrc SOURCES += tst_qtjson.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index 884c4b3850..e8d836683e 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -741,7 +741,7 @@ void tst_QtJson::testObjectIteration() { QJsonObject object2 = object; - QVERIFY(object == object2); + QCOMPARE(object, object2); QJsonValue val = *object2.begin(); object2.erase(object2.begin()); @@ -757,7 +757,7 @@ void tst_QtJson::testObjectIteration() { QJsonObject object2 = object; - QVERIFY(object == object2); + QCOMPARE(object, object2); QJsonObject::iterator it = object2.find(QString::number(5)); object2.erase(it); @@ -793,7 +793,7 @@ void tst_QtJson::testObjectIteration() while (!object.isEmpty()) it = object.erase(it); QCOMPARE(object.size() , 0); - QVERIFY(it == object.end()); + QCOMPARE(it, object.end()); } void tst_QtJson::testArrayIteration() @@ -814,7 +814,7 @@ void tst_QtJson::testArrayIteration() { QJsonArray array2 = array; - QVERIFY(array == array2); + QCOMPARE(array, array2); QJsonValue val = *array2.begin(); array2.erase(array2.begin()); @@ -856,7 +856,7 @@ void tst_QtJson::testArrayIteration() while (!array.isEmpty()) it = array.erase(it); QCOMPARE(array.size() , 0); - QVERIFY(it == array.end()); + QCOMPARE(it, array.end()); } void tst_QtJson::testObjectFind() @@ -870,14 +870,14 @@ void tst_QtJson::testObjectFind() QJsonObject::iterator it = object.find(QLatin1String("1")); QCOMPARE((*it).toDouble(), 1.); it = object.find(QLatin1String("11")); - QVERIFY((*it).type() == QJsonValue::Undefined); - QVERIFY(it == object.end()); + QCOMPARE((*it).type(), QJsonValue::Undefined); + QCOMPARE(it, object.end()); QJsonObject::const_iterator cit = object.constFind(QLatin1String("1")); QCOMPARE((*cit).toDouble(), 1.); cit = object.constFind(QLatin1String("11")); - QVERIFY((*it).type() == QJsonValue::Undefined); - QVERIFY(it == object.end()); + QCOMPARE((*it).type(), QJsonValue::Undefined); + QCOMPARE(it, object.end()); } void tst_QtJson::testDocument() @@ -898,8 +898,8 @@ void tst_QtJson::testDocument() QCOMPARE(doc.isEmpty(), false); QCOMPARE(doc.isArray(), false); QCOMPARE(doc.isObject(), true); - QVERIFY(doc.object() == object); - QVERIFY(doc.array() == QJsonArray()); + QCOMPARE(doc.object(), object); + QCOMPARE(doc.array(), QJsonArray()); doc = QJsonDocument(); QCOMPARE(doc.isEmpty(), true); @@ -917,8 +917,8 @@ void tst_QtJson::testDocument() QCOMPARE(doc.isEmpty(), false); QCOMPARE(doc.isArray(), true); QCOMPARE(doc.isObject(), false); - QVERIFY(doc.array() == array); - QVERIFY(doc.object() == QJsonObject()); + QCOMPARE(doc.array(), array); + QCOMPARE(doc.object(), QJsonObject()); QJsonObject outer; outer.insert(QLatin1String("outerKey"), 22); @@ -1740,7 +1740,7 @@ void tst_QtJson::fromBinary() QJsonDocument doc = QJsonDocument::fromJson(testJson); QJsonDocument outdoc = QJsonDocument::fromBinaryData(doc.toBinaryData()); QVERIFY(!outdoc.isNull()); - QVERIFY(doc == outdoc); + QCOMPARE(doc, outdoc); QFile bfile(testDataDir + "/test.bjson"); bfile.open(QFile::ReadOnly); @@ -1748,8 +1748,8 @@ void tst_QtJson::fromBinary() QJsonDocument bdoc = QJsonDocument::fromBinaryData(binary); QVERIFY(!bdoc.isNull()); - QVERIFY(doc.toVariant() == bdoc.toVariant()); - QVERIFY(doc == bdoc); + QCOMPARE(doc.toVariant(), bdoc.toVariant()); + QCOMPARE(doc, bdoc); } void tst_QtJson::toAndFromBinary_data() @@ -1770,7 +1770,7 @@ void tst_QtJson::toAndFromBinary() QVERIFY(!doc.isNull()); QJsonDocument outdoc = QJsonDocument::fromBinaryData(doc.toBinaryData()); QVERIFY(!outdoc.isNull()); - QVERIFY(doc == outdoc); + QCOMPARE(doc, outdoc); } void tst_QtJson::parseNumbers() @@ -2086,7 +2086,7 @@ void tst_QtJson::assignToDocument() QJsonDocument innerDoc(inner.toObject()); QVERIFY(innerDoc != doc); - QVERIFY(innerDoc.object() == inner.toObject()); + QCOMPARE(innerDoc.object(), inner.toObject()); } { const char *json = "[ [ true ] ]"; @@ -2098,7 +2098,7 @@ void tst_QtJson::assignToDocument() QJsonDocument innerDoc(inner.toArray()); QVERIFY(innerDoc != doc); - QVERIFY(innerDoc.array() == inner.toArray()); + QCOMPARE(innerDoc.array(), inner.toArray()); } } @@ -2129,7 +2129,7 @@ void tst_QtJson::testCompaction() QVERIFY(!doc.isEmpty()); QCOMPARE(doc.isArray(), false); QCOMPARE(doc.isObject(), true); - QVERIFY(doc.object() == obj); + QCOMPARE(doc.object(), obj); } void tst_QtJson::testDebugStream() @@ -2328,14 +2328,14 @@ void tst_QtJson::testDetachBug() void tst_QtJson::valueEquals() { - QVERIFY(QJsonValue() == QJsonValue()); + QCOMPARE(QJsonValue(), QJsonValue()); QVERIFY(QJsonValue() != QJsonValue(QJsonValue::Undefined)); QVERIFY(QJsonValue() != QJsonValue(true)); QVERIFY(QJsonValue() != QJsonValue(1.)); QVERIFY(QJsonValue() != QJsonValue(QJsonArray())); QVERIFY(QJsonValue() != QJsonValue(QJsonObject())); - QVERIFY(QJsonValue(true) == QJsonValue(true)); + QCOMPARE(QJsonValue(true), QJsonValue(true)); QVERIFY(QJsonValue(true) != QJsonValue(false)); QVERIFY(QJsonValue(true) != QJsonValue(QJsonValue::Undefined)); QVERIFY(QJsonValue(true) != QJsonValue()); @@ -2343,9 +2343,9 @@ void tst_QtJson::valueEquals() QVERIFY(QJsonValue(true) != QJsonValue(QJsonArray())); QVERIFY(QJsonValue(true) != QJsonValue(QJsonObject())); - QVERIFY(QJsonValue(1) == QJsonValue(1)); + QCOMPARE(QJsonValue(1), QJsonValue(1)); QVERIFY(QJsonValue(1) != QJsonValue(2)); - QVERIFY(QJsonValue(1) == QJsonValue(1.)); + QCOMPARE(QJsonValue(1), QJsonValue(1.)); QVERIFY(QJsonValue(1) != QJsonValue(1.1)); QVERIFY(QJsonValue(1) != QJsonValue(QJsonValue::Undefined)); QVERIFY(QJsonValue(1) != QJsonValue()); @@ -2353,7 +2353,7 @@ void tst_QtJson::valueEquals() QVERIFY(QJsonValue(1) != QJsonValue(QJsonArray())); QVERIFY(QJsonValue(1) != QJsonValue(QJsonObject())); - QVERIFY(QJsonValue(1.) == QJsonValue(1.)); + QCOMPARE(QJsonValue(1.), QJsonValue(1.)); QVERIFY(QJsonValue(1.) != QJsonValue(2.)); QVERIFY(QJsonValue(1.) != QJsonValue(QJsonValue::Undefined)); QVERIFY(QJsonValue(1.) != QJsonValue()); @@ -2361,7 +2361,7 @@ void tst_QtJson::valueEquals() QVERIFY(QJsonValue(1.) != QJsonValue(QJsonArray())); QVERIFY(QJsonValue(1.) != QJsonValue(QJsonObject())); - QVERIFY(QJsonValue(QJsonArray()) == QJsonValue(QJsonArray())); + QCOMPARE(QJsonValue(QJsonArray()), QJsonValue(QJsonArray())); QJsonArray nonEmptyArray; nonEmptyArray.append(true); QVERIFY(QJsonValue(QJsonArray()) != nonEmptyArray); @@ -2371,7 +2371,7 @@ void tst_QtJson::valueEquals() QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(1.)); QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(QJsonObject())); - QVERIFY(QJsonValue(QJsonObject()) == QJsonValue(QJsonObject())); + QCOMPARE(QJsonValue(QJsonObject()), QJsonValue(QJsonObject())); QJsonObject nonEmptyObject; nonEmptyObject.insert("Key", true); QVERIFY(QJsonValue(QJsonObject()) != nonEmptyObject); @@ -2381,13 +2381,13 @@ void tst_QtJson::valueEquals() QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(1.)); QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(QJsonArray())); - QVERIFY(QJsonValue("foo") == QJsonValue(QLatin1String("foo"))); - QVERIFY(QJsonValue("foo") == QJsonValue(QString("foo"))); - QVERIFY(QJsonValue("\x66\x6f\x6f") == QJsonValue(QString("foo"))); - QVERIFY(QJsonValue("\x62\x61\x72") == QJsonValue("bar")); - QVERIFY(QJsonValue(UNICODE_NON_CHARACTER) == QJsonValue(QString(UNICODE_NON_CHARACTER))); - QVERIFY(QJsonValue(UNICODE_DJE) == QJsonValue(QString(UNICODE_DJE))); - QVERIFY(QJsonValue("\xc3\xa9") == QJsonValue(QString("\xc3\xa9"))); + QCOMPARE(QJsonValue("foo"), QJsonValue(QLatin1String("foo"))); + QCOMPARE(QJsonValue("foo"), QJsonValue(QString("foo"))); + QCOMPARE(QJsonValue("\x66\x6f\x6f"), QJsonValue(QString("foo"))); + QCOMPARE(QJsonValue("\x62\x61\x72"), QJsonValue("bar")); + QCOMPARE(QJsonValue(UNICODE_NON_CHARACTER), QJsonValue(QString(UNICODE_NON_CHARACTER))); + QCOMPARE(QJsonValue(UNICODE_DJE), QJsonValue(QString(UNICODE_DJE))); + QCOMPARE(QJsonValue("\xc3\xa9"), QJsonValue(QString("\xc3\xa9"))); } void tst_QtJson::objectEquals_data() @@ -2521,7 +2521,7 @@ void tst_QtJson::bom() QJsonDocument doc = QJsonDocument::fromJson(json, &error); QVERIFY(!doc.isNull()); - QVERIFY(error.error == QJsonParseError::NoError); + QCOMPARE(error.error, QJsonParseError::NoError); } void tst_QtJson::nesting() @@ -2553,14 +2553,14 @@ void tst_QtJson::nesting() QJsonDocument doc = QJsonDocument::fromJson(json, &error); QVERIFY(!doc.isNull()); - QVERIFY(error.error == QJsonParseError::NoError); + QCOMPARE(error.error, QJsonParseError::NoError); - json.prepend("["); - json.append("]"); + json.prepend('['); + json.append(']'); doc = QJsonDocument::fromJson(json, &error); QVERIFY(doc.isNull()); - QVERIFY(error.error == QJsonParseError::DeepNesting); + QCOMPARE(error.error, QJsonParseError::DeepNesting); json = QByteArray("true "); @@ -2572,14 +2572,14 @@ void tst_QtJson::nesting() doc = QJsonDocument::fromJson(json, &error); QVERIFY(!doc.isNull()); - QVERIFY(error.error == QJsonParseError::NoError); + QCOMPARE(error.error, QJsonParseError::NoError); - json.prepend("["); - json.append("]"); + json.prepend('['); + json.append(']'); doc = QJsonDocument::fromJson(json, &error); QVERIFY(doc.isNull()); - QVERIFY(error.error == QJsonParseError::DeepNesting); + QCOMPARE(error.error, QJsonParseError::DeepNesting); } @@ -2589,7 +2589,7 @@ void tst_QtJson::longStrings() // in the data structures (for Latin1String in qjson_p.h) QString s(0x7ff0, 'a'); for (int i = 0x7ff0; i < 0x8010; i++) { - s.append("c"); + s.append(QLatin1Char('c')); QMap <QString, QVariant> map; map["key"] = s; @@ -2603,12 +2603,12 @@ void tst_QtJson::longStrings() QJsonDocument d2 = QJsonDocument::fromJson(a1); /* ... and a QByteArray from the QJsonDocument */ QByteArray a2 = d2.toJson(); - QVERIFY(a1 == a2); + QCOMPARE(a1, a2); } s = QString(0xfff0, 'a'); for (int i = 0xfff0; i < 0x10010; i++) { - s.append("c"); + s.append(QLatin1Char('c')); QMap <QString, QVariant> map; map["key"] = s; @@ -2622,7 +2622,7 @@ void tst_QtJson::longStrings() QJsonDocument d2 = QJsonDocument::fromJson(a1); /* ... and a QByteArray from the QJsonDocument */ QByteArray a2 = d2.toJson(); - QVERIFY(a1 == a2); + QCOMPARE(a1, a2); } } @@ -2755,7 +2755,7 @@ void tst_QtJson::unicodeKeys() QJsonParseError error; QJsonDocument doc = QJsonDocument::fromJson(json, &error); - QVERIFY(error.error == QJsonParseError::NoError); + QCOMPARE(error.error, QJsonParseError::NoError); QJsonObject o = doc.object(); QCOMPARE(o.keys().size(), 5); @@ -2769,12 +2769,12 @@ void tst_QtJson::garbageAtEnd() { QJsonParseError error; QJsonDocument doc = QJsonDocument::fromJson("{},", &error); - QVERIFY(error.error == QJsonParseError::GarbageAtEnd); - QVERIFY(error.offset == 2); + QCOMPARE(error.error, QJsonParseError::GarbageAtEnd); + QCOMPARE(error.offset, 2); QVERIFY(doc.isEmpty()); doc = QJsonDocument::fromJson("{} ", &error); - QVERIFY(error.error == QJsonParseError::NoError); + QCOMPARE(error.error, QJsonParseError::NoError); QVERIFY(!doc.isEmpty()); } diff --git a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro index 1039f2c08d..a49bb9ae1f 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro +++ b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qcoreapplication QT = core testlib core-private SOURCES = tst_qcoreapplication.cpp diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index 655719cffc..b889d61786 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -442,14 +442,14 @@ public slots: void threadProgress(int v) { ++count; - QVERIFY(v == count); + QCOMPARE(v, count); QCoreApplication::postEvent(this, new QEvent(QEvent::MaxUser), -1); } void threadFinished() { - QVERIFY(count == 7); + QCOMPARE(count, 7); count = 0; thread->deleteLater(); @@ -898,6 +898,7 @@ void tst_QCoreApplication::threadedEventDelivery() QCOMPARE(receiver.recordedEvents.contains(QEvent::User + 1), eventsReceived); } +#ifndef QT_NO_LIBRARY void tst_QCoreApplication::addRemoveLibPaths() { QStringList paths = QCoreApplication::libraryPaths(); @@ -922,8 +923,9 @@ void tst_QCoreApplication::addRemoveLibPaths() QStringList replace; replace << currentDir << paths[0]; QCoreApplication::setLibraryPaths(replace); - QVERIFY(QCoreApplication::libraryPaths() == replace); + QCOMPARE(QCoreApplication::libraryPaths(), replace); } +#endif static void createQObjectOnDestruction() { diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h index d9296b3846..6c24ab56f8 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h @@ -63,7 +63,9 @@ private slots: void applicationEventFilters_auxThread(); void threadedEventDelivery_data(); void threadedEventDelivery(); +#ifndef QT_NO_LIBRARY void addRemoveLibPaths(); +#endif }; #endif // TST_QCOREAPPLICATION_H diff --git a/tests/auto/corelib/kernel/qeventdispatcher/qeventdispatcher.pro b/tests/auto/corelib/kernel/qeventdispatcher/qeventdispatcher.pro index c3019467ce..ff048d0429 100644 --- a/tests/auto/corelib/kernel/qeventdispatcher/qeventdispatcher.pro +++ b/tests/auto/corelib/kernel/qeventdispatcher/qeventdispatcher.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qeventdispatcher QT = core testlib SOURCES += tst_qeventdispatcher.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro index ea4792fc1c..5cd043b584 100644 --- a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro +++ b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro @@ -1,10 +1,8 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qeventloop QT = core network testlib core-private SOURCES = $$PWD/tst_qeventloop.cpp win32:!wince:!winrt: LIBS += -luser32 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 contains(QT_CONFIG, glib): DEFINES += HAVE_GLIB diff --git a/tests/auto/corelib/kernel/qmath/qmath.pro b/tests/auto/corelib/kernel/qmath/qmath.pro index 5b8cba4104..703c530e35 100644 --- a/tests/auto/corelib/kernel/qmath/qmath.pro +++ b/tests/auto/corelib/kernel/qmath/qmath.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmath QT = core testlib SOURCES = tst_qmath.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmetaenum/qmetaenum.pro b/tests/auto/corelib/kernel/qmetaenum/qmetaenum.pro index f045fc5d88..718f2b51de 100644 --- a/tests/auto/corelib/kernel/qmetaenum/qmetaenum.pro +++ b/tests/auto/corelib/kernel/qmetaenum/qmetaenum.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmetaenum QT = core testlib SOURCES = tst_qmetaenum.cpp diff --git a/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro b/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro index 8340bc06e3..a42cd60236 100644 --- a/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro +++ b/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmetamethod QT = core testlib SOURCES = tst_qmetamethod.cpp mac:CONFIG -= app_bundle -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp index cf3ff04aa4..8d5d34d10d 100644 --- a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp +++ b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp @@ -599,8 +599,8 @@ void tst_QMetaMethod::method() QFETCH(QMetaMethod::MethodType, methodType); QFETCH(QMetaMethod::Access, access); - QVERIFY(parameterTypes.size() == parameterTypeNames.size()); - QVERIFY(parameterTypes.size() == parameterNames.size()); + QCOMPARE(parameterTypes.size(), parameterTypeNames.size()); + QCOMPARE(parameterTypes.size(), parameterNames.size()); const QMetaObject *mo = &MethodTestObject::staticMetaObject; int index = (methodType == QMetaMethod::Constructor) diff --git a/tests/auto/corelib/kernel/qmetaobject/qmetaobject.pro b/tests/auto/corelib/kernel/qmetaobject/qmetaobject.pro index 509ade6e2a..e7e5a03a86 100644 --- a/tests/auto/corelib/kernel/qmetaobject/qmetaobject.pro +++ b/tests/auto/corelib/kernel/qmetaobject/qmetaobject.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmetaobject QT = core-private testlib SOURCES = tst_qmetaobject.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp index 7c19bfb89c..0a84a019d0 100644 --- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp @@ -811,7 +811,7 @@ void tst_QMetaObject::invokeBlockingQueuedMetaMember() void tst_QMetaObject::qtMetaObjectInheritance() { - QVERIFY(QObject::staticMetaObject.superClass() == 0); + QVERIFY(!QObject::staticMetaObject.superClass()); QCOMPARE(QSortFilterProxyModel::staticMetaObject.indexOfEnumerator("Qt::CaseSensitivity"), -1); QCOMPARE(QSortFilterProxyModel::staticMetaObject.indexOfEnumerator("CaseSensitivity"), -1); int indexOfSortCaseSensitivity = QSortFilterProxyModel::staticMetaObject.indexOfProperty("sortCaseSensitivity"); @@ -878,7 +878,7 @@ void tst_QMetaObject::invokeMetaConstructor() const QMetaObject *mo = &QtTestObject::staticMetaObject; { QObject *obj = mo->newInstance(); - QVERIFY(obj == 0); + QVERIFY(!obj); } { QtTestObject obj; diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro b/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro index 68d3b48086..f3153b3fd4 100644 --- a/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmetaobjectbuilder QT = core-private testlib SOURCES = tst_qmetaobjectbuilder.cpp mac:CONFIG -= app_bundle -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index 74fcde2e71..6cf45bed1e 100644 --- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -138,14 +138,14 @@ void tst_QMetaObjectBuilder::create() { QMetaObjectBuilder builder; QVERIFY(builder.className().isEmpty()); - QVERIFY(builder.superClass() == &QObject::staticMetaObject); + QCOMPARE(builder.superClass(), &QObject::staticMetaObject); QCOMPARE(builder.methodCount(), 0); QCOMPARE(builder.constructorCount(), 0); QCOMPARE(builder.propertyCount(), 0); QCOMPARE(builder.enumeratorCount(), 0); QCOMPARE(builder.classInfoCount(), 0); QCOMPARE(builder.relatedMetaObjectCount(), 0); - QVERIFY(builder.staticMetacallFunction() == 0); + QVERIFY(!builder.staticMetacallFunction()); } void tst_QMetaObjectBuilder::className() @@ -174,17 +174,17 @@ void tst_QMetaObjectBuilder::superClass() // Change the super class. builder.setSuperClass(&QObject::staticMetaObject); - QVERIFY(builder.superClass() == &QObject::staticMetaObject); + QCOMPARE(builder.superClass(), &QObject::staticMetaObject); // Change it again. builder.setSuperClass(&staticMetaObject); - QVERIFY(builder.superClass() == &staticMetaObject); + QCOMPARE(builder.superClass(), &staticMetaObject); // Clone the super class off a static QMetaObject. builder.addMetaObject(&QObject::staticMetaObject, QMetaObjectBuilder::SuperClass); - QVERIFY(builder.superClass() == 0); + QVERIFY(!builder.superClass()); builder.addMetaObject(&staticMetaObject, QMetaObjectBuilder::SuperClass); - QVERIFY(builder.superClass() == staticMetaObject.superClass()); + QCOMPARE(builder.superClass(), staticMetaObject.superClass()); // Check that nothing else changed. QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::SuperClass)); @@ -195,11 +195,11 @@ void tst_QMetaObjectBuilder::flags() QMetaObjectBuilder builder; // Check default - QVERIFY(builder.flags() == 0); + QCOMPARE(builder.flags(), 0); // Set flags builder.setFlags(QMetaObjectBuilder::DynamicMetaObject); - QVERIFY(builder.flags() == QMetaObjectBuilder::DynamicMetaObject); + QCOMPARE(builder.flags(), QMetaObjectBuilder::DynamicMetaObject); } void tst_QMetaObjectBuilder::method() @@ -209,12 +209,12 @@ void tst_QMetaObjectBuilder::method() // Check null method QMetaMethodBuilder nullMethod; QCOMPARE(nullMethod.signature(), QByteArray()); - QVERIFY(nullMethod.methodType() == QMetaMethod::Method); + QCOMPARE(nullMethod.methodType(), QMetaMethod::Method); QVERIFY(nullMethod.returnType().isEmpty()); QVERIFY(nullMethod.parameterTypes().isEmpty()); QVERIFY(nullMethod.parameterNames().isEmpty()); QVERIFY(nullMethod.tag().isEmpty()); - QVERIFY(nullMethod.access() == QMetaMethod::Public); + QCOMPARE(nullMethod.access(), QMetaMethod::Public); QCOMPARE(nullMethod.attributes(), 0); QCOMPARE(nullMethod.revision(), 0); QCOMPARE(nullMethod.index(), 0); @@ -222,12 +222,12 @@ void tst_QMetaObjectBuilder::method() // Add a method and check its attributes. QMetaMethodBuilder method1 = builder.addMethod("foo(const QString&, int)"); QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(method1.methodType() == QMetaMethod::Method); + QCOMPARE(method1.methodType(), QMetaMethod::Method); QCOMPARE(method1.returnType(), QByteArray("void")); QCOMPARE(method1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QVERIFY(method1.parameterNames().isEmpty()); QVERIFY(method1.tag().isEmpty()); - QVERIFY(method1.access() == QMetaMethod::Public); + QCOMPARE(method1.access(), QMetaMethod::Public); QCOMPARE(method1.attributes(), 0); QCOMPARE(method1.revision(), 0); QCOMPARE(method1.index(), 0); @@ -236,12 +236,12 @@ void tst_QMetaObjectBuilder::method() // Add another method and check again. QMetaMethodBuilder method2 = builder.addMethod("bar(QString)", "int"); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); - QVERIFY(method2.methodType() == QMetaMethod::Method); + QCOMPARE(method2.methodType(), QMetaMethod::Method); QCOMPARE(method2.returnType(), QByteArray("int")); QCOMPARE(method2.parameterTypes(), QList<QByteArray>() << "QString"); QVERIFY(method2.parameterNames().isEmpty()); QVERIFY(method2.tag().isEmpty()); - QVERIFY(method2.access() == QMetaMethod::Public); + QCOMPARE(method2.access(), QMetaMethod::Public); QCOMPARE(method2.attributes(), 0); QCOMPARE(method2.revision(), 0); QCOMPARE(method2.index(), 1); @@ -262,22 +262,22 @@ void tst_QMetaObjectBuilder::method() // Check that method1 is changed, but method2 is not. QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(method1.methodType() == QMetaMethod::Method); + QCOMPARE(method1.methodType(), QMetaMethod::Method); QCOMPARE(method1.returnType(), QByteArray("int")); QCOMPARE(method1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QCOMPARE(method1.parameterNames(), QList<QByteArray>() << "a" << "b"); QCOMPARE(method1.tag(), QByteArray("tag")); - QVERIFY(method1.access() == QMetaMethod::Private); + QCOMPARE(method1.access(), QMetaMethod::Private); QCOMPARE(method1.attributes(), 42); QCOMPARE(method1.revision(), 123); QCOMPARE(method1.index(), 0); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); - QVERIFY(method2.methodType() == QMetaMethod::Method); + QCOMPARE(method2.methodType(), QMetaMethod::Method); QCOMPARE(method2.returnType(), QByteArray("int")); QCOMPARE(method2.parameterTypes(), QList<QByteArray>() << "QString"); QVERIFY(method2.parameterNames().isEmpty()); QVERIFY(method2.tag().isEmpty()); - QVERIFY(method2.access() == QMetaMethod::Public); + QCOMPARE(method2.access(), QMetaMethod::Public); QCOMPARE(method2.attributes(), 0); QCOMPARE(method2.revision(), 0); QCOMPARE(method2.index(), 1); @@ -293,22 +293,22 @@ void tst_QMetaObjectBuilder::method() // This time check that only method2 changed. QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(method1.methodType() == QMetaMethod::Method); + QCOMPARE(method1.methodType(), QMetaMethod::Method); QCOMPARE(method1.returnType(), QByteArray("int")); QCOMPARE(method1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QCOMPARE(method1.parameterNames(), QList<QByteArray>() << "a" << "b"); QCOMPARE(method1.tag(), QByteArray("tag")); - QVERIFY(method1.access() == QMetaMethod::Private); + QCOMPARE(method1.access(), QMetaMethod::Private); QCOMPARE(method1.attributes(), 42); QCOMPARE(method1.revision(), 123); QCOMPARE(method1.index(), 0); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); - QVERIFY(method2.methodType() == QMetaMethod::Method); + QCOMPARE(method2.methodType(), QMetaMethod::Method); QCOMPARE(method2.returnType(), QByteArray("QString")); QCOMPARE(method2.parameterTypes(), QList<QByteArray>() << "QString"); QCOMPARE(method2.parameterNames(), QList<QByteArray>() << "c"); QCOMPARE(method2.tag(), QByteArray("Q_FOO")); - QVERIFY(method2.access() == QMetaMethod::Protected); + QCOMPARE(method2.access(), QMetaMethod::Protected); QCOMPARE(method2.attributes(), 24); QCOMPARE(method2.revision(), 321); QCOMPARE(method2.index(), 1); @@ -319,12 +319,12 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(builder.methodCount(), 1); method2 = builder.method(0); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); - QVERIFY(method2.methodType() == QMetaMethod::Method); + QCOMPARE(method2.methodType(), QMetaMethod::Method); QCOMPARE(method2.returnType(), QByteArray("QString")); QCOMPARE(method2.parameterTypes(), QList<QByteArray>() << "QString"); QCOMPARE(method2.parameterNames(), QList<QByteArray>() << "c"); QCOMPARE(method2.tag(), QByteArray("Q_FOO")); - QVERIFY(method2.access() == QMetaMethod::Protected); + QCOMPARE(method2.access(), QMetaMethod::Protected); QCOMPARE(method2.attributes(), 24); QCOMPARE(method2.revision(), 321); QCOMPARE(method2.index(), 0); @@ -347,12 +347,12 @@ void tst_QMetaObjectBuilder::slot() // Add a slot and check its attributes. QMetaMethodBuilder method1 = builder.addSlot("foo(const QString&, int)"); QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(method1.methodType() == QMetaMethod::Slot); + QCOMPARE(method1.methodType(), QMetaMethod::Slot); QCOMPARE(method1.returnType(), QByteArray("void")); QCOMPARE(method1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QVERIFY(method1.parameterNames().isEmpty()); QVERIFY(method1.tag().isEmpty()); - QVERIFY(method1.access() == QMetaMethod::Public); + QCOMPARE(method1.access(), QMetaMethod::Public); QCOMPARE(method1.attributes(), 0); QCOMPARE(method1.index(), 0); QCOMPARE(builder.methodCount(), 1); @@ -360,12 +360,12 @@ void tst_QMetaObjectBuilder::slot() // Add another slot and check again. QMetaMethodBuilder method2 = builder.addSlot("bar(QString)"); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); - QVERIFY(method2.methodType() == QMetaMethod::Slot); + QCOMPARE(method2.methodType(), QMetaMethod::Slot); QCOMPARE(method2.returnType(), QByteArray("void")); QCOMPARE(method2.parameterTypes(), QList<QByteArray>() << "QString"); QVERIFY(method2.parameterNames().isEmpty()); QVERIFY(method2.tag().isEmpty()); - QVERIFY(method2.access() == QMetaMethod::Public); + QCOMPARE(method2.access(), QMetaMethod::Public); QCOMPARE(method2.attributes(), 0); QCOMPARE(method2.index(), 1); QCOMPARE(builder.methodCount(), 2); @@ -386,12 +386,12 @@ void tst_QMetaObjectBuilder::signal() // Add a signal and check its attributes. QMetaMethodBuilder method1 = builder.addSignal("foo(const QString&, int)"); QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(method1.methodType() == QMetaMethod::Signal); + QCOMPARE(method1.methodType(), QMetaMethod::Signal); QCOMPARE(method1.returnType(), QByteArray("void")); QCOMPARE(method1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QVERIFY(method1.parameterNames().isEmpty()); QVERIFY(method1.tag().isEmpty()); - QVERIFY(method1.access() == QMetaMethod::Public); + QCOMPARE(method1.access(), QMetaMethod::Public); QCOMPARE(method1.attributes(), 0); QCOMPARE(method1.index(), 0); QCOMPARE(builder.methodCount(), 1); @@ -399,12 +399,12 @@ void tst_QMetaObjectBuilder::signal() // Add another signal and check again. QMetaMethodBuilder method2 = builder.addSignal("bar(QString)"); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); - QVERIFY(method2.methodType() == QMetaMethod::Signal); + QCOMPARE(method2.methodType(), QMetaMethod::Signal); QCOMPARE(method2.returnType(), QByteArray("void")); QCOMPARE(method2.parameterTypes(), QList<QByteArray>() << "QString"); QVERIFY(method2.parameterNames().isEmpty()); QVERIFY(method2.tag().isEmpty()); - QVERIFY(method2.access() == QMetaMethod::Public); + QCOMPARE(method2.access(), QMetaMethod::Public); QCOMPARE(method2.attributes(), 0); QCOMPARE(method2.index(), 1); QCOMPARE(builder.methodCount(), 2); @@ -425,12 +425,12 @@ void tst_QMetaObjectBuilder::constructor() // Add a constructor and check its attributes. QMetaMethodBuilder ctor1 = builder.addConstructor("foo(const QString&, int)"); QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(ctor1.methodType() == QMetaMethod::Constructor); + QCOMPARE(ctor1.methodType(), QMetaMethod::Constructor); QVERIFY(ctor1.returnType().isEmpty()); QCOMPARE(ctor1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QVERIFY(ctor1.parameterNames().isEmpty()); QVERIFY(ctor1.tag().isEmpty()); - QVERIFY(ctor1.access() == QMetaMethod::Public); + QCOMPARE(ctor1.access(), QMetaMethod::Public); QCOMPARE(ctor1.attributes(), 0); QCOMPARE(ctor1.index(), 0); QCOMPARE(builder.constructorCount(), 1); @@ -438,12 +438,12 @@ void tst_QMetaObjectBuilder::constructor() // Add another constructor and check again. QMetaMethodBuilder ctor2 = builder.addConstructor("bar(QString)"); QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); - QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); + QCOMPARE(ctor2.methodType(), QMetaMethod::Constructor); QVERIFY(ctor2.returnType().isEmpty()); QCOMPARE(ctor2.parameterTypes(), QList<QByteArray>() << "QString"); QVERIFY(ctor2.parameterNames().isEmpty()); QVERIFY(ctor2.tag().isEmpty()); - QVERIFY(ctor2.access() == QMetaMethod::Public); + QCOMPARE(ctor2.access(), QMetaMethod::Public); QCOMPARE(ctor2.attributes(), 0); QCOMPARE(ctor2.index(), 1); QCOMPARE(builder.constructorCount(), 2); @@ -464,21 +464,21 @@ void tst_QMetaObjectBuilder::constructor() // Check that ctor1 is changed, but ctor2 is not. QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(ctor1.methodType() == QMetaMethod::Constructor); + QCOMPARE(ctor1.methodType(), QMetaMethod::Constructor); QCOMPARE(ctor1.returnType(), QByteArray("int")); QCOMPARE(ctor1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QCOMPARE(ctor1.parameterNames(), QList<QByteArray>() << "a" << "b"); QCOMPARE(ctor1.tag(), QByteArray("tag")); - QVERIFY(ctor1.access() == QMetaMethod::Private); + QCOMPARE(ctor1.access(), QMetaMethod::Private); QCOMPARE(ctor1.attributes(), 42); QCOMPARE(ctor1.index(), 0); QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); - QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); + QCOMPARE(ctor2.methodType(), QMetaMethod::Constructor); QVERIFY(ctor2.returnType().isEmpty()); QCOMPARE(ctor2.parameterTypes(), QList<QByteArray>() << "QString"); QVERIFY(ctor2.parameterNames().isEmpty()); QVERIFY(ctor2.tag().isEmpty()); - QVERIFY(ctor2.access() == QMetaMethod::Public); + QCOMPARE(ctor2.access(), QMetaMethod::Public); QCOMPARE(ctor2.attributes(), 0); QCOMPARE(ctor2.index(), 1); QCOMPARE(builder.constructorCount(), 2); @@ -492,21 +492,21 @@ void tst_QMetaObjectBuilder::constructor() // This time check that only ctor2 changed. QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)")); - QVERIFY(ctor1.methodType() == QMetaMethod::Constructor); + QCOMPARE(ctor1.methodType(), QMetaMethod::Constructor); QCOMPARE(ctor1.returnType(), QByteArray("int")); QCOMPARE(ctor1.parameterTypes(), QList<QByteArray>() << "QString" << "int"); QCOMPARE(ctor1.parameterNames(), QList<QByteArray>() << "a" << "b"); QCOMPARE(ctor1.tag(), QByteArray("tag")); - QVERIFY(ctor1.access() == QMetaMethod::Private); + QCOMPARE(ctor1.access(), QMetaMethod::Private); QCOMPARE(ctor1.attributes(), 42); QCOMPARE(ctor1.index(), 0); QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); - QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); + QCOMPARE(ctor2.methodType(), QMetaMethod::Constructor); QCOMPARE(ctor2.returnType(), QByteArray("QString")); QCOMPARE(ctor2.parameterTypes(), QList<QByteArray>() << "QString"); QCOMPARE(ctor2.parameterNames(), QList<QByteArray>() << "c"); QCOMPARE(ctor2.tag(), QByteArray("Q_FOO")); - QVERIFY(ctor2.access() == QMetaMethod::Protected); + QCOMPARE(ctor2.access(), QMetaMethod::Protected); QCOMPARE(ctor2.attributes(), 24); QCOMPARE(ctor2.index(), 1); QCOMPARE(builder.constructorCount(), 2); @@ -516,12 +516,12 @@ void tst_QMetaObjectBuilder::constructor() QCOMPARE(builder.constructorCount(), 1); ctor2 = builder.constructor(0); QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); - QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); + QCOMPARE(ctor2.methodType(), QMetaMethod::Constructor); QCOMPARE(ctor2.returnType(), QByteArray("QString")); QCOMPARE(ctor2.parameterTypes(), QList<QByteArray>() << "QString"); QCOMPARE(ctor2.parameterNames(), QList<QByteArray>() << "c"); QCOMPARE(ctor2.tag(), QByteArray("Q_FOO")); - QVERIFY(ctor2.access() == QMetaMethod::Protected); + QCOMPARE(ctor2.access(), QMetaMethod::Protected); QCOMPARE(ctor2.attributes(), 24); QCOMPARE(ctor2.index(), 0); @@ -536,10 +536,10 @@ void tst_QMetaObjectBuilder::constructor() QCOMPARE(builder.constructorCount(), 2); QCOMPARE(prototypeConstructor.signature(), QByteArray("SomethingOfEverything()")); - QVERIFY(prototypeConstructor.methodType() == QMetaMethod::Constructor); + QCOMPARE(prototypeConstructor.methodType(), QMetaMethod::Constructor); QCOMPARE(prototypeConstructor.returnType(), QByteArray()); QVERIFY(prototypeConstructor.parameterTypes().isEmpty()); - QVERIFY(prototypeConstructor.access() == QMetaMethod::Public); + QCOMPARE(prototypeConstructor.access(), QMetaMethod::Public); QCOMPARE(prototypeConstructor.index(), 1); // Check that nothing else changed. @@ -967,13 +967,13 @@ void tst_QMetaObjectBuilder::relatedMetaObject() // Add two related meta objects and check their attributes. QCOMPARE(builder.addRelatedMetaObject(&QObject::staticMetaObject), 0); QCOMPARE(builder.addRelatedMetaObject(&staticMetaObject), 1); - QVERIFY(builder.relatedMetaObject(0) == &QObject::staticMetaObject); - QVERIFY(builder.relatedMetaObject(1) == &staticMetaObject); + QCOMPARE(builder.relatedMetaObject(0), &QObject::staticMetaObject); + QCOMPARE(builder.relatedMetaObject(1), &staticMetaObject); QCOMPARE(builder.relatedMetaObjectCount(), 2); // Remove the first one and check again. builder.removeRelatedMetaObject(0); - QVERIFY(builder.relatedMetaObject(0) == &staticMetaObject); + QCOMPARE(builder.relatedMetaObject(0), &staticMetaObject); QCOMPARE(builder.relatedMetaObjectCount(), 1); // Check that nothing else changed. @@ -1617,7 +1617,7 @@ void tst_QMetaObjectBuilder::usage_slot() QVERIFY(index != -1); QMetaMethod voidSlotInt = testObject->metaObject()->method(index); - QVERIFY(testObject->voidSlotIntArgument() == -1); + QCOMPARE(testObject->voidSlotIntArgument(), -1); QVERIFY(voidSlotInt.invoke(testObject.data(), Q_ARG(int, 123))); QCOMPARE(testObject->voidSlotIntArgument(), 123); } @@ -1658,7 +1658,7 @@ void tst_QMetaObjectBuilder::usage_connect() QVERIFY(QObject::connect(testObject.data(), SIGNAL(intPropChanged(int)), testObject.data(), SLOT(voidSlotInt(int)))); - QVERIFY(testObject->voidSlotIntArgument() == -1); + QCOMPARE(testObject->voidSlotIntArgument(), -1); testObject->setProperty("intProp", 123); QCOMPARE(testObject->voidSlotIntArgument(), 123); @@ -1674,7 +1674,7 @@ void tst_QMetaObjectBuilder::usage_templateConnect() testObject.data(), &TestObject::voidSlotInt); QVERIFY(con); - QVERIFY(testObject->voidSlotIntArgument() == -1); + QCOMPARE(testObject->voidSlotIntArgument(), -1); testObject->setProperty("intProp", 123); QCOMPARE(testObject->voidSlotIntArgument(), 123); diff --git a/tests/auto/corelib/kernel/qmetaproperty/qmetaproperty.pro b/tests/auto/corelib/kernel/qmetaproperty/qmetaproperty.pro index f103abdd2b..1f338a909b 100644 --- a/tests/auto/corelib/kernel/qmetaproperty/qmetaproperty.pro +++ b/tests/auto/corelib/kernel/qmetaproperty/qmetaproperty.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmetaproperty QT = core testlib SOURCES = tst_qmetaproperty.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro index fc262b8fc7..1d4e647a4b 100644 --- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro +++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmetatype QT = core testlib INCLUDEPATH += $$PWD/../../../other/qvariant_common diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 10ffa06245..d4e83933a9 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -2394,8 +2394,8 @@ void tst_QMetaType::compareCustomEqualOnlyType() QVERIFY(variant50 != variant100x); QVERIFY(variant100 != variant50); QVERIFY(variant100x != variant50); - QVERIFY(variant100 == variant100x); - QVERIFY(variant100 == variant100); + QCOMPARE(variant100, variant100x); + QCOMPARE(variant100, variant100); // compare always fails QVERIFY(!(variant50 < variant50)); diff --git a/tests/auto/corelib/kernel/qmimedata/qmimedata.pro b/tests/auto/corelib/kernel/qmimedata/qmimedata.pro index 51389da6ee..502ec78024 100644 --- a/tests/auto/corelib/kernel/qmimedata/qmimedata.pro +++ b/tests/auto/corelib/kernel/qmimedata/qmimedata.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmimedata QT += testlib SOURCES = tst_qmimedata.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp index d368d9961b..4f88dc2a76 100644 --- a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp +++ b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp @@ -101,7 +101,7 @@ void tst_QMimeData::data() const // set text, verify mimeData.setData("text/plain", "pirates"); QCOMPARE(mimeData.data("text/plain"), QByteArray("pirates")); - QVERIFY(mimeData.data("text/html").length() == 0); + QCOMPARE(mimeData.data("text/html").length(), 0); // html time mimeData.setData("text/html", "ninjas"); diff --git a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro index b08dfb1838..125915047a 100644 --- a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro +++ b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro @@ -12,4 +12,3 @@ SOURCES += signalbug.cpp # This app is testdata for tst_qobject target.path = $$[QT_INSTALL_TESTS]/tst_qobject/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qobject/test/test.pro b/tests/auto/corelib/kernel/qobject/test/test.pro index 0a15ae384e..e9c1537fa7 100644 --- a/tests/auto/corelib/kernel/qobject/test/test.pro +++ b/tests/auto/corelib/kernel/qobject/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase console -CONFIG += parallel_test TARGET = ../tst_qobject QT = core-private network testlib SOURCES = ../tst_qobject.cpp diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index a3c6d8e9df..90f7780344 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -2038,57 +2038,57 @@ void tst_QObject::metamethod() m = mobj->method(mobj->indexOfMethod("invoke1()")); QVERIFY(m.methodSignature() == "invoke1()"); - QVERIFY(m.methodType() == QMetaMethod::Method); - QVERIFY(m.access() == QMetaMethod::Public); + QCOMPARE(m.methodType(), QMetaMethod::Method); + QCOMPARE(m.access(), QMetaMethod::Public); QVERIFY(!(m.attributes() & QMetaMethod::Scriptable)); QVERIFY(!(m.attributes() & QMetaMethod::Compatibility)); m = mobj->method(mobj->indexOfMethod("sinvoke1()")); QVERIFY(m.methodSignature() == "sinvoke1()"); - QVERIFY(m.methodType() == QMetaMethod::Method); - QVERIFY(m.access() == QMetaMethod::Public); + QCOMPARE(m.methodType(), QMetaMethod::Method); + QCOMPARE(m.access(), QMetaMethod::Public); QVERIFY((m.attributes() & QMetaMethod::Scriptable)); QVERIFY(!(m.attributes() & QMetaMethod::Compatibility)); m = mobj->method(mobj->indexOfMethod("invoke2()")); QVERIFY(m.methodSignature() == "invoke2()"); - QVERIFY(m.methodType() == QMetaMethod::Method); - QVERIFY(m.access() == QMetaMethod::Protected); + QCOMPARE(m.methodType(), QMetaMethod::Method); + QCOMPARE(m.access(), QMetaMethod::Protected); QVERIFY(!(m.attributes() & QMetaMethod::Scriptable)); QVERIFY((m.attributes() & QMetaMethod::Compatibility)); m = mobj->method(mobj->indexOfMethod("sinvoke2()")); QVERIFY(m.methodSignature() == "sinvoke2()"); - QVERIFY(m.methodType() == QMetaMethod::Method); - QVERIFY(m.access() == QMetaMethod::Protected); + QCOMPARE(m.methodType(), QMetaMethod::Method); + QCOMPARE(m.access(), QMetaMethod::Protected); QVERIFY((m.attributes() & QMetaMethod::Scriptable)); QVERIFY((m.attributes() & QMetaMethod::Compatibility)); m = mobj->method(mobj->indexOfMethod("invoke3()")); QVERIFY(m.methodSignature() == "invoke3()"); - QVERIFY(m.methodType() == QMetaMethod::Method); - QVERIFY(m.access() == QMetaMethod::Private); + QCOMPARE(m.methodType(), QMetaMethod::Method); + QCOMPARE(m.access(), QMetaMethod::Private); QVERIFY(!(m.attributes() & QMetaMethod::Scriptable)); QVERIFY(!(m.attributes() & QMetaMethod::Compatibility)); m = mobj->method(mobj->indexOfMethod("sinvoke3()")); QVERIFY(m.methodSignature() == "sinvoke3()"); - QVERIFY(m.methodType() == QMetaMethod::Method); - QVERIFY(m.access() == QMetaMethod::Private); + QCOMPARE(m.methodType(), QMetaMethod::Method); + QCOMPARE(m.access(), QMetaMethod::Private); QVERIFY((m.attributes() & QMetaMethod::Scriptable)); QVERIFY(!(m.attributes() & QMetaMethod::Compatibility)); m = mobj->method(mobj->indexOfMethod("signal5()")); QVERIFY(m.methodSignature() == "signal5()"); - QVERIFY(m.methodType() == QMetaMethod::Signal); - QVERIFY(m.access() == QMetaMethod::Public); + QCOMPARE(m.methodType(), QMetaMethod::Signal); + QCOMPARE(m.access(), QMetaMethod::Public); QVERIFY(!(m.attributes() & QMetaMethod::Scriptable)); QVERIFY((m.attributes() & QMetaMethod::Compatibility)); m = mobj->method(mobj->indexOfMethod("aPublicSlot()")); QVERIFY(m.methodSignature() == "aPublicSlot()"); - QVERIFY(m.methodType() == QMetaMethod::Slot); - QVERIFY(m.access() == QMetaMethod::Public); + QCOMPARE(m.methodType(), QMetaMethod::Slot); + QCOMPARE(m.access(), QMetaMethod::Public); QVERIFY(!(m.attributes() & QMetaMethod::Scriptable)); QVERIFY(!(m.attributes() & QMetaMethod::Compatibility)); @@ -2360,7 +2360,7 @@ void tst_QObject::testUserData() int id = user_data_ids[i]; CustomData *data = static_cast<CustomData *>(my_test_object.userData(id)); QVERIFY(data != 0); - QVERIFY(data->id == id); + QCOMPARE(data->id, id); } } @@ -2902,12 +2902,12 @@ void tst_QObject::floatProperty() QVERIFY(idx > 0); QMetaProperty prop = obj.metaObject()->property(idx); QVERIFY(prop.isValid()); - QVERIFY(prop.type() == uint(QMetaType::type("float"))); + QCOMPARE(int(prop.type()), QMetaType::type("float")); QVERIFY(!prop.write(&obj, QVariant("Hello"))); QVERIFY(prop.write(&obj, QVariant::fromValue(128.0f))); QVariant v = prop.read(&obj); - QVERIFY(int(v.userType()) == QMetaType::Float); - QVERIFY(qvariant_cast<float>(v) == 128.0f); + QCOMPARE(v.userType(), int(QMetaType::Float)); + QCOMPARE(qvariant_cast<float>(v), 128.0f); } void tst_QObject::qrealProperty() @@ -2917,18 +2917,18 @@ void tst_QObject::qrealProperty() QVERIFY(idx > 0); QMetaProperty prop = obj.metaObject()->property(idx); QVERIFY(prop.isValid()); - QVERIFY(prop.type() == uint(QMetaType::type("qreal"))); + QCOMPARE(int(prop.type()), QMetaType::type("qreal")); QVERIFY(!prop.write(&obj, QVariant("Hello"))); QVERIFY(prop.write(&obj, QVariant::fromValue(128.0f))); QVariant v = prop.read(&obj); QCOMPARE(v.userType(), qMetaTypeId<qreal>()); - QVERIFY(qvariant_cast<qreal>(v) == 128.0); + QCOMPARE(qvariant_cast<qreal>(v), 128.0); QVERIFY(prop.write(&obj, QVariant::fromValue(double(127)))); v = prop.read(&obj); QCOMPARE(v.userType(), qMetaTypeId<qreal>()); - QVERIFY(qvariant_cast<qreal>(v) == 127.0); + QCOMPARE(qvariant_cast<qreal>(v), 127.0); } class DynamicPropertyObject : public PropertyObject @@ -2994,7 +2994,7 @@ void tst_QObject::recursiveSignalEmission() proc.start(path); QVERIFY2(proc.waitForStarted(), qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, proc.errorString()))); QVERIFY(proc.waitForFinished()); - QVERIFY(proc.exitStatus() == QProcess::NormalExit); + QCOMPARE(proc.exitStatus(), QProcess::NormalExit); QCOMPARE(proc.exitCode(), 0); #endif } diff --git a/tests/auto/corelib/kernel/qpointer/qpointer.pro b/tests/auto/corelib/kernel/qpointer/qpointer.pro index 4b573cb6a5..02765efdbd 100644 --- a/tests/auto/corelib/kernel/qpointer/qpointer.pro +++ b/tests/auto/corelib/kernel/qpointer/qpointer.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpointer QT = core testlib qtHaveModule(widgets): QT += widgets SOURCES = tst_qpointer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp index 26bb70fc66..dbac689ebb 100644 --- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp +++ b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp @@ -145,7 +145,7 @@ void tst_QSharedMemory::init() { existingSharedMemory = new QSharedMemory(EXISTING_SHARE); if (!existingSharedMemory->create(EXISTING_SIZE)) { - QVERIFY(existingSharedMemory->error() == QSharedMemory::AlreadyExists); + QCOMPARE(existingSharedMemory->error(), QSharedMemory::AlreadyExists); } } @@ -244,10 +244,10 @@ void tst_QSharedMemory::constructor() QSharedMemory sm; QCOMPARE(sm.key(), QString()); QVERIFY(!sm.isAttached()); - QVERIFY(sm.data() == 0); + QVERIFY(!sm.data()); QCOMPARE(sm.size(), 0); QCOMPARE(sm.error(), QSharedMemory::NoError); - QVERIFY(sm.errorString() == QString()); + QCOMPARE(sm.errorString(), QString()); } void tst_QSharedMemory::key_data() @@ -288,8 +288,8 @@ void tst_QSharedMemory::key() QCOMPARE(sm.isAttached(), false); QCOMPARE(sm.error(), QSharedMemory::NoError); - QVERIFY(sm.errorString() == QString()); - QVERIFY(sm.data() == 0); + QCOMPARE(sm.errorString(), QString()); + QVERIFY(!sm.data()); QCOMPARE(sm.size(), 0); QCOMPARE(sm.detach(), false); @@ -328,11 +328,11 @@ void tst_QSharedMemory::create() qDebug() << sm.errorString(); QCOMPARE(sm.key(), key); if (canCreate) { - QVERIFY(sm.errorString() == QString()); + QCOMPARE(sm.errorString(), QString()); QVERIFY(sm.data() != 0); QVERIFY(sm.size() != 0); } else { - QVERIFY(sm.data() == 0); + QVERIFY(!sm.data()); QVERIFY(sm.errorString() != QString()); } } @@ -377,10 +377,10 @@ void tst_QSharedMemory::attach() QVERIFY(sm.size() != 0); QVERIFY(sm.detach()); QCOMPARE(sm.size(), 0); - QVERIFY(sm.data() == 0); + QVERIFY(!sm.data()); } else { - QVERIFY(sm.data() == 0); - QVERIFY(sm.size() == 0); + QVERIFY(!sm.data()); + QCOMPARE(sm.size(), 0); QVERIFY(sm.errorString() != QString()); QVERIFY(!sm.detach()); } @@ -498,7 +498,7 @@ void tst_QSharedMemory::useTooMuchMemory() QVERIFY(!sm->isAttached()); QCOMPARE(sm->key(), key); QCOMPARE(sm->size(), 0); - QVERIFY(sm->data() == 0); + QVERIFY(!sm->data()); if (sm->error() != QSharedMemory::OutOfResources) qDebug() << sm->error() << sm->errorString(); // ### Linux won't return OutOfResources if there are not enough semaphores to use. @@ -535,7 +535,7 @@ void tst_QSharedMemory::attachTooMuch() QVERIFY(!war->isAttached()); QCOMPARE(war->key(), government.key()); QCOMPARE(war->size(), 0); - QVERIFY(war->data() == 0); + QVERIFY(!war->data()); QCOMPARE(war->error(), QSharedMemory::OutOfResources); QVERIFY(war->errorString() != QString()); QVERIFY(!war->detach()); diff --git a/tests/auto/corelib/kernel/qsignalblocker/qsignalblocker.pro b/tests/auto/corelib/kernel/qsignalblocker/qsignalblocker.pro index c6c6f379eb..6e4913db5d 100644 --- a/tests/auto/corelib/kernel/qsignalblocker/qsignalblocker.pro +++ b/tests/auto/corelib/kernel/qsignalblocker/qsignalblocker.pro @@ -1,7 +1,5 @@ CONFIG += testcase console -CONFIG += parallel_test TARGET = tst_qsignalblocker QT = core testlib SOURCES = tst_qsignalblocker.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qsignalmapper/qsignalmapper.pro b/tests/auto/corelib/kernel/qsignalmapper/qsignalmapper.pro index 526db5eef3..418d6dce62 100644 --- a/tests/auto/corelib/kernel/qsignalmapper/qsignalmapper.pro +++ b/tests/auto/corelib/kernel/qsignalmapper/qsignalmapper.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsignalmapper QT = core testlib SOURCES = tst_qsignalmapper.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp b/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp index 579aa78ac4..8a5275e032 100644 --- a/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp +++ b/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp @@ -97,16 +97,16 @@ void tst_QSignalMapper::mapped() connect(&mapper, SIGNAL(mapped(QString)), &target, SLOT(myslot(QString))); src1.emit_mysignal(20); - QVERIFY(target.id == 1); + QCOMPARE(target.id, 1); QVERIFY(target.str.isEmpty()); src2.emit_mysignal(20); - QVERIFY(target.id == 2); - QVERIFY(target.str == "two"); + QCOMPARE(target.id, 2); + QCOMPARE(target.str, QLatin1String("two")); src3.emit_mysignal(20); - QVERIFY(target.id == 2); - QVERIFY(target.str == "three"); + QCOMPARE(target.id, 2); + QCOMPARE(target.str, QLatin1String("three")); } QTEST_MAIN(tst_QSignalMapper) diff --git a/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro b/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro index 303a96c68f..58e4b98af7 100644 --- a/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro +++ b/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsocketnotifier QT = core-private network-private testlib SOURCES = tst_qsocketnotifier.cpp @@ -7,4 +6,3 @@ SOURCES = tst_qsocketnotifier.cpp requires(contains(QT_CONFIG,private_tests)) include(../../../network/socket/platformsocketengine/platformsocketengine.pri) -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp index f49da1f5a8..30ce65849d 100644 --- a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp +++ b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp @@ -151,7 +151,7 @@ void tst_QSocketNotifier::unexpectedDisconnection() readEnd1.initialize(QAbstractSocket::TcpSocket); readEnd1.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd1.waitForWrite()); - QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState); + QCOMPARE(readEnd1.state(), QAbstractSocket::ConnectedState); QVERIFY(server.waitForNewConnection()); QTcpSocket *writeEnd1 = server.nextPendingConnection(); QVERIFY(writeEnd1 != 0); @@ -160,7 +160,7 @@ void tst_QSocketNotifier::unexpectedDisconnection() readEnd2.initialize(QAbstractSocket::TcpSocket); readEnd2.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd2.waitForWrite()); - QVERIFY(readEnd2.state() == QAbstractSocket::ConnectedState); + QCOMPARE(readEnd2.state(), QAbstractSocket::ConnectedState); QVERIFY(server.waitForNewConnection()); QTcpSocket *writeEnd2 = server.nextPendingConnection(); QVERIFY(writeEnd2 != 0); @@ -186,8 +186,8 @@ void tst_QSocketNotifier::unexpectedDisconnection() QVERIFY(timer.isActive()); //escape if test would hang } while(tester.sequence <= 0); - QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState); - QVERIFY(readEnd2.state() == QAbstractSocket::ConnectedState); + QCOMPARE(readEnd1.state(), QAbstractSocket::ConnectedState); + QCOMPARE(readEnd2.state(), QAbstractSocket::ConnectedState); QCOMPARE(tester.sequence, 2); diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp index 169a13aff2..0c0fdb8067 100644 --- a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp +++ b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp @@ -191,13 +191,13 @@ void tst_QSystemSemaphore::basicProcesses() acquire.start(m_helperBinary, QStringList("acquire")); QVERIFY2(acquire.waitForStarted(), "Could not start helper binary"); acquire.waitForFinished(HELPERWAITTIME); - QVERIFY(acquire.state() == QProcess::Running); + QCOMPARE(acquire.state(), QProcess::Running); acquire.kill(); release.start(m_helperBinary, QStringList("release")); QVERIFY2(release.waitForStarted(), "Could not start helper binary"); acquire.waitForFinished(HELPERWAITTIME); release.waitForFinished(HELPERWAITTIME); - QVERIFY(acquire.state() == QProcess::NotRunning); + QCOMPARE(acquire.state(), QProcess::NotRunning); #endif } diff --git a/tests/auto/corelib/kernel/qtimer/qtimer.pro b/tests/auto/corelib/kernel/qtimer/qtimer.pro index 48adf07f64..8afdbb148e 100644 --- a/tests/auto/corelib/kernel/qtimer/qtimer.pro +++ b/tests/auto/corelib/kernel/qtimer/qtimer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtimer QT = core testlib SOURCES = tst_qtimer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index b34a3a6beb..c17d81ea9e 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -529,7 +529,7 @@ void tst_QTimer::restartedTimerFiresTooSoon() { RestartedTimerFiresTooSoonObject object; object.timerFired(); - QVERIFY(object.eventLoop.exec() == 0); + QCOMPARE(object.eventLoop.exec(), 0); } class LongLastingSlotClass : public QObject diff --git a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro index e588f44370..b7a5a85e09 100644 --- a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro +++ b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtranslator QT = core testlib SOURCES = tst_qtranslator.cpp diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp index 2707b6df41..5e967207d4 100644 --- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp @@ -107,7 +107,7 @@ void tst_QTranslator::load() QTranslator tor( 0 ); tor.load("hellotr_la"); QVERIFY(!tor.isEmpty()); - QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!")); } void tst_QTranslator::load2() @@ -118,7 +118,7 @@ void tst_QTranslator::load2() QByteArray data = file.readAll(); tor.load((const uchar *)data.constData(), data.length()); QVERIFY(!tor.isEmpty()); - QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!")); } class TranslatorThread : public QThread @@ -129,7 +129,7 @@ class TranslatorThread : public QThread if (tor.isEmpty()) qFatal("Could not load translation"); - if (tor.translate("QPushButton", "Hello world!") != QString::fromLatin1("Hallo Welt!")) + if (tor.translate("QPushButton", "Hello world!") != QLatin1String("Hallo Welt!")) qFatal("Test string was not translated correctlys"); } }; @@ -212,9 +212,9 @@ void tst_QTranslator::plural() tor.load("hellotr_la"); QVERIFY(!tor.isEmpty()); QCoreApplication::installTranslator(&tor); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 0), QString::fromLatin1("Hallo 0 Welten!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 1), QString::fromLatin1("Hallo 1 Welt!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 2), QString::fromLatin1("Hallo 2 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 0), QLatin1String("Hallo 0 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 1), QLatin1String("Hallo 1 Welt!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 2), QLatin1String("Hallo 2 Welten!")); } void tst_QTranslator::translate_qm_file_generated_with_msgfmt() @@ -240,7 +240,7 @@ void tst_QTranslator::loadFromResource() QTranslator tor; tor.load(":/tst_qtranslator/hellotr_la.qm"); QVERIFY(!tor.isEmpty()); - QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!")); } void tst_QTranslator::loadDirectory() @@ -260,16 +260,16 @@ void tst_QTranslator::dependencies() QTranslator tor; tor.load("dependencies_la"); QVERIFY(!tor.isEmpty()); - QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!")); // plural QCoreApplication::installTranslator(&tor); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 0), QString::fromLatin1("Hallo 0 Welten!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 1), QString::fromLatin1("Hallo 1 Welt!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 2), QString::fromLatin1("Hallo 2 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 0), QLatin1String("Hallo 0 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 1), QLatin1String("Hallo 1 Welt!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 2), QLatin1String("Hallo 2 Welten!")); // pick up translation from the file with dependencies - QCOMPARE(tor.translate("QPushButton", "It's a small world"), QString::fromLatin1("Es ist eine kleine Welt")); + QCOMPARE(tor.translate("QPushButton", "It's a small world"), QLatin1String("Es ist eine kleine Welt")); } { @@ -279,7 +279,7 @@ void tst_QTranslator::dependencies() QByteArray data = file.readAll(); tor.load((const uchar *)data.constData(), data.length()); QVERIFY(!tor.isEmpty()); - QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!")); } } diff --git a/tests/auto/corelib/kernel/qvariant/qvariant.pro b/tests/auto/corelib/kernel/qvariant/qvariant.pro index 39178ba9e6..a2dda809ad 100644 --- a/tests/auto/corelib/kernel/qvariant/qvariant.pro +++ b/tests/auto/corelib/kernel/qvariant/qvariant.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qvariant QT = core testlib INCLUDEPATH += $$PWD/../../../other/qvariant_common diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 6da8f55e61..de53ab1fa3 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -351,13 +351,13 @@ void tst_QVariant::constructor_invalid() QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:")); QVariant variant(static_cast<QVariant::Type>(typeId)); QVERIFY(!variant.isValid()); - QVERIFY(variant.userType() == QMetaType::UnknownType); + QCOMPARE(variant.userType(), int(QMetaType::UnknownType)); } { QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:")); QVariant variant(typeId, /* copy */ 0); QVERIFY(!variant.isValid()); - QVERIFY(variant.userType() == QMetaType::UnknownType); + QCOMPARE(variant.userType(), int(QMetaType::UnknownType)); } } @@ -901,7 +901,7 @@ void tst_QVariant::toFloat() bool ok; float d = value.toFloat(&ok); QCOMPARE(d, result); - QVERIFY(ok == valueOK); + QCOMPARE(ok, valueOK); } void tst_QVariant::toLongLong_data() @@ -1323,9 +1323,9 @@ void tst_QVariant::writeToReadFromDataStream() // the uninitialized float can be NaN (observed on Windows Mobile 5 ARMv4i) float readFloat = qvariant_cast<float>(readVariant); float writtenFloat = qvariant_cast<float>(writeVariant); - QVERIFY(qIsNaN(readFloat) == qIsNaN(writtenFloat)); + QCOMPARE(qIsNaN(readFloat), qIsNaN(writtenFloat)); if (!qIsNaN(readFloat)) - QVERIFY(readFloat == writtenFloat); + QCOMPARE(readFloat, writtenFloat); } break; } @@ -2115,7 +2115,7 @@ void tst_QVariant::userType() QVERIFY(!userVar.canConvert(QVariant::String)); QVariant userVar2(userVar); - QVERIFY(userVar == userVar2); + QCOMPARE(userVar, userVar2); userVar2.setValue(data2); QVERIFY(userVar != userVar2); @@ -2129,7 +2129,7 @@ void tst_QVariant::userType() userVar3.setValue(data2); userVar3 = userVar2; - QVERIFY(userVar2 == userVar3); + QCOMPARE(userVar2, userVar3); } // At this point all QVariants got destroyed but we have 2 MyType instances. QCOMPARE(instanceCount, 2); @@ -2144,7 +2144,7 @@ void tst_QVariant::userType() QVERIFY(!userVar.canConvert(QVariant::String)); QVariant userVar2(userVar); - QVERIFY(userVar == userVar2); + QCOMPARE(userVar, userVar2); userVar2.setValue(&data2); QVERIFY(userVar != userVar2); @@ -2158,10 +2158,10 @@ void tst_QVariant::userType() /* This check is correct now. userVar2 contains a pointer to data2 and so * does userVar3. */ - QVERIFY(userVar2 == userVar3); + QCOMPARE(userVar2, userVar3); userVar3 = userVar2; - QVERIFY(userVar2 == userVar3); + QCOMPARE(userVar2, userVar3); } QCOMPARE(instanceCount, 2); @@ -2446,7 +2446,7 @@ void tst_QVariant::saveLoadCustomTypes() qRegisterMetaTypeStreamOperators<Blah>("Blah"); QCOMPARE(v.userType(), tp); - QVERIFY(v.type() == QVariant::UserType); + QCOMPARE(v.type(), QVariant::UserType); { QDataStream stream(&data, QIODevice::WriteOnly); stream << v; @@ -2610,7 +2610,7 @@ void tst_QVariant::qvariant_cast_QObject_derived() { CustomQObjectDerivedNoMetaType *object = new CustomQObjectDerivedNoMetaType(this); QVariant data = QVariant::fromValue(object); - QVERIFY(data.userType() == qMetaTypeId<CustomQObjectDerivedNoMetaType*>()); + QCOMPARE(data.userType(), qMetaTypeId<CustomQObjectDerivedNoMetaType*>()); QCOMPARE(data.value<QObject *>(), object); QCOMPARE(data.value<CustomQObjectDerivedNoMetaType *>(), object); QCOMPARE(data.value<CustomQObject *>(), object); @@ -2619,7 +2619,7 @@ void tst_QVariant::qvariant_cast_QObject_derived() CustomQObjectDerived *object = new CustomQObjectDerived(this); QVariant data = QVariant::fromValue(object); - QVERIFY(data.userType() == qMetaTypeId<CustomQObjectDerived*>()); + QCOMPARE(data.userType(), qMetaTypeId<CustomQObjectDerived*>()); QCOMPARE(data.value<QObject *>(), object); QCOMPARE(data.value<CustomQObjectDerived *>(), object); @@ -2886,10 +2886,10 @@ void tst_QVariant::voidStar() const QVariant v1, v2; v1 = QVariant::fromValue(p1); v2 = v1; - QVERIFY(v1 == v2); + QCOMPARE(v1, v2); v2 = QVariant::fromValue(p2); - QVERIFY(v1 == v2); + QCOMPARE(v1, v2); p2 = 0; v2 = QVariant::fromValue(p2); @@ -2906,10 +2906,10 @@ void tst_QVariant::dataStar() const QCOMPARE(qvariant_cast<Data*>(v1), p1); QVariant v2 = v1; - QVERIFY(v1 == v2); + QCOMPARE(v1, v2); v2 = QVariant::fromValue(p1); - QVERIFY(v1 == v2); + QCOMPARE(v1, v2); delete p1; } @@ -3081,8 +3081,8 @@ void tst_QVariant::compareCustomTypes() const /* We compare pointers. */ QVERIFY(variant1 != variant2); - QVERIFY(variant1 == variant1); - QVERIFY(variant2 == variant2); + QCOMPARE(variant1, variant1); + QCOMPARE(variant2, variant2); } void tst_QVariant::timeToDateTime() const @@ -3289,7 +3289,7 @@ void tst_QVariant::toIntFromQString() const void tst_QVariant::toIntFromDouble() const { double d = 2147483630; // max int 2147483647 - QVERIFY((int)d == 2147483630); + QCOMPARE((int)d, 2147483630); QVariant var(d); QVERIFY( var.canConvert( QVariant::Int ) ); @@ -4119,7 +4119,7 @@ void tst_QVariant::saveInvalid() QDataStream stream(&data, QIODevice::WriteOnly); stream.setVersion(version); stream << QVariant(); - QVERIFY(stream.status() == QDataStream::Ok); + QCOMPARE(stream.status(), QDataStream::Ok); QVERIFY(data.size() >= 4); QCOMPARE(int(data.constData()[0]), 0); QCOMPARE(int(data.constData()[1]), 0); @@ -4133,7 +4133,7 @@ void tst_QVariant::saveNewBuiltinWithOldStream() QDataStream stream(&data, QIODevice::WriteOnly); stream.setVersion(QDataStream::Qt_3_1); stream << QVariant::fromValue<QJsonValue>(123); // QJsonValue class was introduced in Qt5 - QVERIFY(stream.status() == QDataStream::Ok); + QCOMPARE(stream.status(), QDataStream::Ok); QVERIFY(data.size() >= 4); QCOMPARE(int(data.constData()[0]), 0); QCOMPARE(int(data.constData()[1]), 0); diff --git a/tests/auto/corelib/kernel/qwineventnotifier/qwineventnotifier.pro b/tests/auto/corelib/kernel/qwineventnotifier/qwineventnotifier.pro index f0ac7c621f..20ec7572fb 100644 --- a/tests/auto/corelib/kernel/qwineventnotifier/qwineventnotifier.pro +++ b/tests/auto/corelib/kernel/qwineventnotifier/qwineventnotifier.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qwineventnotifier QT = core-private testlib SOURCES = tst_qwineventnotifier.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro index d0b834824a..e661ff8412 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro @@ -10,6 +10,5 @@ RESOURCES += $$QT_SOURCE_TREE/src/corelib/mimetypes/mimetypes.qrc RESOURCES += ../testdata.qrc *-g++*:QMAKE_CXXFLAGS += -W -Wall -Wextra -Wshadow -Wno-long-long -Wnon-virtual-dtor -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 unix:!mac:!qnx: DEFINES += USE_XDG_DATA_DIRS diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro index 4add6c2bcd..160f359116 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmimedatabase-xml @@ -11,6 +11,5 @@ RESOURCES += $$QT_SOURCE_TREE/src/corelib/mimetypes/mimetypes.qrc RESOURCES += ../testdata.qrc *-g++*:QMAKE_CXXFLAGS += -W -Wall -Wextra -Wshadow -Wno-long-long -Wnon-virtual-dtor -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 unix:!mac:!qnx: DEFINES += USE_XDG_DATA_DIRS diff --git a/tests/auto/corelib/mimetypes/qmimetype/qmimetype.pro b/tests/auto/corelib/mimetypes/qmimetype/qmimetype.pro index f76a4ab951..1540e75c28 100644 --- a/tests/auto/corelib/mimetypes/qmimetype/qmimetype.pro +++ b/tests/auto/corelib/mimetypes/qmimetype/qmimetype.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmimetype QT = core-private testlib SOURCES = tst_qmimetype.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/plugin.pro b/tests/auto/corelib/plugin/plugin.pro index 506f6abaeb..e6b748e4f4 100644 --- a/tests/auto/corelib/plugin/plugin.pro +++ b/tests/auto/corelib/plugin/plugin.pro @@ -1,7 +1,10 @@ TEMPLATE=subdirs SUBDIRS=\ qfactoryloader \ - qlibrary \ - qplugin \ - qpluginloader \ quuid + +load(qfeatures) +!contains(QT_DISABLED_FEATURES, library): SUBDIRS += \ + qpluginloader \ + qplugin \ + qlibrary diff --git a/tests/auto/corelib/plugin/qfactoryloader/plugin1/plugin1.pro b/tests/auto/corelib/plugin/qfactoryloader/plugin1/plugin1.pro index 2496cd2f1e..b7a641959a 100644 --- a/tests/auto/corelib/plugin/qfactoryloader/plugin1/plugin1.pro +++ b/tests/auto/corelib/plugin/qfactoryloader/plugin1/plugin1.pro @@ -9,4 +9,3 @@ DESTDIR = ../bin # This is testdata for the tst_qpluginloader test. target.path = $$[QT_INSTALL_TESTS]/tst_qfactoryloader/bin INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qfactoryloader/plugin2/plugin2.pro b/tests/auto/corelib/plugin/qfactoryloader/plugin2/plugin2.pro index e70ed4fb25..b536aff486 100644 --- a/tests/auto/corelib/plugin/qfactoryloader/plugin2/plugin2.pro +++ b/tests/auto/corelib/plugin/qfactoryloader/plugin2/plugin2.pro @@ -9,4 +9,3 @@ DESTDIR = ../bin # This is testdata for the tst_qpluginloader test. target.path = $$[QT_INSTALL_TESTS]/tst_qfactoryloader/bin INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qfactoryloader/qfactoryloader.pro b/tests/auto/corelib/plugin/qfactoryloader/qfactoryloader.pro index 42bc01e2ed..ace9fe8fd0 100644 --- a/tests/auto/corelib/plugin/qfactoryloader/qfactoryloader.pro +++ b/tests/auto/corelib/plugin/qfactoryloader/qfactoryloader.pro @@ -12,4 +12,3 @@ TARGET = tst_qpluginloader INSTALLS = -CONFIG += parallel_test diff --git a/tests/auto/corelib/plugin/qfactoryloader/test/test.pro b/tests/auto/corelib/plugin/qfactoryloader/test/test.pro index d8dfaac29e..f1e76c31bf 100644 --- a/tests/auto/corelib/plugin/qfactoryloader/test/test.pro +++ b/tests/auto/corelib/plugin/qfactoryloader/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = ../tst_qfactoryloader QT = core-private testlib @@ -19,4 +18,8 @@ win32 { } mac: CONFIG -= app_bundle -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +load(qfeatures) +contains(QT_DISABLED_FEATURES, library) { + LIBS += -L ../bin/ -lplugin1 -lplugin2 +} diff --git a/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp b/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp index 474f4e9868..92a4dda252 100644 --- a/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp +++ b/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp @@ -38,6 +38,11 @@ #include "plugin1/plugininterface1.h" #include "plugin2/plugininterface2.h" +#ifdef QT_NO_LIBRARY +Q_IMPORT_PLUGIN(Plugin1) +Q_IMPORT_PLUGIN(Plugin2) +#endif + class tst_QFactoryLoader : public QObject { Q_OBJECT @@ -54,8 +59,9 @@ void tst_QFactoryLoader::initTestCase() { const QString binFolder = QFINDTESTDATA(binFolderC); QVERIFY2(!binFolder.isEmpty(), "Unable to locate 'bin' folder"); - +#ifndef QT_NO_LIBRARY QCoreApplication::setLibraryPaths(QStringList(QFileInfo(binFolder).absolutePath())); +#endif } void tst_QFactoryLoader::usingTwoFactoriesFromSameDir() diff --git a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro index 195e48da93..44bd0be14e 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro @@ -20,4 +20,3 @@ win32 { DESTDIR = ../release/ } } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro index 52dd8b9679..d55747501c 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro @@ -46,4 +46,3 @@ renamed_target.extra = $$member(renamed_target.extra, 0, -2) QMAKE_POST_LINK = $$member(QMAKE_POST_LINK, 0, -2) INSTALLS += target renamed_target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qlibrary/qlibrary.pro b/tests/auto/corelib/plugin/qlibrary/qlibrary.pro index 5bdf780fc0..ec58838e71 100644 --- a/tests/auto/corelib/plugin/qlibrary/qlibrary.pro +++ b/tests/auto/corelib/plugin/qlibrary/qlibrary.pro @@ -9,4 +9,3 @@ TARGET = tst_qlibrary # no special install rule for subdir INSTALLS = -CONFIG += parallel_test diff --git a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro index 27433d59c0..d59cd738bf 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro +++ b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle TARGET = ../tst_qlibrary QT = core testlib @@ -14,4 +13,3 @@ win32 { } TESTDATA += ../library_path/invalid.so -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index e87585163b..c613653557 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -96,7 +96,7 @@ static QString sys_qualifiedLibraryName(const QString &fileName) { QString appDir = QCoreApplication::applicationDirPath(); - return appDir + "/" + PREFIX + fileName + SUFFIX; + return appDir + QLatin1Char('/') + PREFIX + fileName + SUFFIX; } QT_FORWARD_DECLARE_CLASS(QLibrary) diff --git a/tests/auto/corelib/plugin/qplugin/debugplugin/debugplugin.pro b/tests/auto/corelib/plugin/qplugin/debugplugin/debugplugin.pro index a4db0eccf6..ca47df22bd 100644 --- a/tests/auto/corelib/plugin/qplugin/debugplugin/debugplugin.pro +++ b/tests/auto/corelib/plugin/qplugin/debugplugin/debugplugin.pro @@ -4,4 +4,3 @@ CONFIG -= release debug_and_release SOURCES = main.cpp QT = core DESTDIR = ../plugins -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qplugin/qplugin.pro b/tests/auto/corelib/plugin/qplugin/qplugin.pro index e8840a0fb2..918ffb44bd 100644 --- a/tests/auto/corelib/plugin/qplugin/qplugin.pro +++ b/tests/auto/corelib/plugin/qplugin/qplugin.pro @@ -25,4 +25,3 @@ mac { SUBDIRS += tst_qplugin.pro -CONFIG += parallel_test diff --git a/tests/auto/corelib/plugin/qplugin/releaseplugin/releaseplugin.pro b/tests/auto/corelib/plugin/qplugin/releaseplugin/releaseplugin.pro index 0f698312bd..b7dea67894 100644 --- a/tests/auto/corelib/plugin/qplugin/releaseplugin/releaseplugin.pro +++ b/tests/auto/corelib/plugin/qplugin/releaseplugin/releaseplugin.pro @@ -4,4 +4,3 @@ CONFIG -= debug debug_and_release SOURCES = main.cpp QT = core DESTDIR = ../plugins -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro b/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro index d1ffff9c4e..8c6540fe87 100644 --- a/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro +++ b/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro @@ -1,8 +1,6 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qplugin QT = core testlib SOURCES = tst_qplugin.cpp TESTDATA += plugins/* -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro index 70ab54a964..abfc70883e 100644 --- a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro +++ b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro @@ -10,4 +10,3 @@ QT = core # This is testdata for the tst_qpluginloader test. target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro b/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro index c74a00e9a6..bd6f19cb4f 100644 --- a/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro +++ b/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro @@ -11,4 +11,3 @@ win32-msvc: DEFINES += WIN32_MSVC # This is testdata for the tst_qpluginloader test. target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro index 5c6c56e389..83d00f7cd8 100644 --- a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro +++ b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro @@ -12,4 +12,3 @@ TARGET = tst_qpluginloader INSTALLS = -CONFIG += parallel_test diff --git a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro index 2ea9c27cc9..6ec4a8de05 100644 --- a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro +++ b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro @@ -11,4 +11,3 @@ QT = core # This is testdata for the tst_qpluginloader test. target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro index 3894c90ae3..101392927c 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro +++ b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = ../tst_qpluginloader QT = core testlib contains(QT_CONFIG, private_tests): QT += core-private @@ -16,4 +15,3 @@ win32 { } TESTDATA += ../elftest ../machtest -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/quuid/quuid.pro b/tests/auto/corelib/plugin/quuid/quuid.pro index 461956f313..25e24561ae 100644 --- a/tests/auto/corelib/plugin/quuid/quuid.pro +++ b/tests/auto/corelib/plugin/quuid/quuid.pro @@ -4,4 +4,3 @@ SUBDIRS = testProcessUniqueness SUBDIRS += test -CONFIG += parallel_test diff --git a/tests/auto/corelib/plugin/quuid/test/test.pro b/tests/auto/corelib/plugin/quuid/test/test.pro index c8312c0985..0f6f915814 100644 --- a/tests/auto/corelib/plugin/quuid/test/test.pro +++ b/tests/auto/corelib/plugin/quuid/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_quuid QT = core testlib SOURCES = ../tst_quuid.cpp @@ -13,4 +12,3 @@ CONFIG(debug_and_release_target) { } else { DESTDIR = .. } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/quuid/testProcessUniqueness/testProcessUniqueness.pro b/tests/auto/corelib/plugin/quuid/testProcessUniqueness/testProcessUniqueness.pro index b2f7aaf2d3..5ee7b1a21f 100644 --- a/tests/auto/corelib/plugin/quuid/testProcessUniqueness/testProcessUniqueness.pro +++ b/tests/auto/corelib/plugin/quuid/testProcessUniqueness/testProcessUniqueness.pro @@ -7,4 +7,3 @@ DESTDIR = ./ # This app is testdata for tst_quuid target.path = $$[QT_INSTALL_TESTS]/tst_quuid/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp index f31aed6976..e40f3416aa 100644 --- a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp +++ b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp @@ -223,11 +223,11 @@ void tst_QUuid::equal() QVERIFY( !(uuidA == uuidB) ); QUuid copy(uuidA); - QVERIFY(uuidA == copy); + QCOMPARE(uuidA, copy); QUuid assigned; assigned = uuidA; - QVERIFY(uuidA == assigned); + QCOMPARE(uuidA, assigned); } diff --git a/tests/auto/corelib/statemachine/qstate/qstate.pro b/tests/auto/corelib/statemachine/qstate/qstate.pro index 22e57d5615..e2251ded9d 100644 --- a/tests/auto/corelib/statemachine/qstate/qstate.pro +++ b/tests/auto/corelib/statemachine/qstate/qstate.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstate QT = core testlib SOURCES = tst_qstate.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro index f6fbbc83c6..4f16b2a9ca 100644 --- a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro +++ b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstatemachine QT = core-private testlib qtHaveModule(widgets): QT += widgets SOURCES = tst_qstatemachine.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp index 28df7cce7b..a46d42d91f 100644 --- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp @@ -3035,7 +3035,7 @@ void tst_QStateMachine::graphicsSceneEventTransitions() QVERIFY(runningSpy.isValid()); machine.start(); QTRY_COMPARE(startedSpy.count(), 1); - QVERIFY(finishedSpy.count() == 0); + QCOMPARE(finishedSpy.count(), 0); TEST_RUNNING_CHANGED(true); QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove); scene.sendEvent(textItem, &mouseEvent); @@ -6157,26 +6157,26 @@ void tst_QStateMachine::childModeConstructor() { QStateMachine machine(QState::ExclusiveStates); QCOMPARE(machine.childMode(), QState::ExclusiveStates); - QVERIFY(machine.parent() == 0); - QVERIFY(machine.parentState() == 0); + QVERIFY(!machine.parent()); + QVERIFY(!machine.parentState()); } { QStateMachine machine(QState::ParallelStates); QCOMPARE(machine.childMode(), QState::ParallelStates); - QVERIFY(machine.parent() == 0); - QVERIFY(machine.parentState() == 0); + QVERIFY(!machine.parent()); + QVERIFY(!machine.parentState()); } { QStateMachine machine(QState::ExclusiveStates, this); QCOMPARE(machine.childMode(), QState::ExclusiveStates); QCOMPARE(machine.parent(), static_cast<QObject *>(this)); - QVERIFY(machine.parentState() == 0); + QVERIFY(!machine.parentState()); } { QStateMachine machine(QState::ParallelStates, this); QCOMPARE(machine.childMode(), QState::ParallelStates); QCOMPARE(machine.parent(), static_cast<QObject *>(this)); - QVERIFY(machine.parentState() == 0); + QVERIFY(!machine.parentState()); } QState state; { diff --git a/tests/auto/corelib/thread/qatomicint/qatomicint.pro b/tests/auto/corelib/thread/qatomicint/qatomicint.pro index 1a3f7cc926..89ac465e81 100644 --- a/tests/auto/corelib/thread/qatomicint/qatomicint.pro +++ b/tests/auto/corelib/thread/qatomicint/qatomicint.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qatomicint QT = core testlib SOURCES = tst_qatomicint.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri index d9ebe64d5b..fd4387b188 100644 --- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri +++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri @@ -13,7 +13,7 @@ equals(FORCE, cxx11) { suffix = $$TYPE } -CONFIG += testcase parallel_test +CONFIG += testcase QT = core testlib TARGET = tst_qatomicinteger_$$lower($$suffix) SOURCES = $$PWD/tst_qatomicinteger.cpp diff --git a/tests/auto/corelib/thread/qatomicpointer/qatomicpointer.pro b/tests/auto/corelib/thread/qatomicpointer/qatomicpointer.pro index 8468496d9c..cce822da6e 100644 --- a/tests/auto/corelib/thread/qatomicpointer/qatomicpointer.pro +++ b/tests/auto/corelib/thread/qatomicpointer/qatomicpointer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qatomicpointer QT = core testlib SOURCES = tst_qatomicpointer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp index dbc239a3f9..392c4be1c6 100644 --- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp +++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp @@ -123,15 +123,15 @@ void tst_QAtomicPointer::constructor() { void *one = this; QAtomicPointer<void> atomic1 = one; - QVERIFY(atomic1.load() == one); + QCOMPARE(atomic1.load(), one); void *two = &one; QAtomicPointer<void> atomic2 = two; - QVERIFY(atomic2.load() == two); + QCOMPARE(atomic2.load(), two); void *three = &two; QAtomicPointer<void> atomic3 = three; - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); } void tst_QAtomicPointer::copy_constructor() @@ -139,19 +139,19 @@ void tst_QAtomicPointer::copy_constructor() void *one = this; QAtomicPointer<void> atomic1 = one; QAtomicPointer<void> atomic1_copy = atomic1; - QVERIFY(atomic1_copy.load() == one); + QCOMPARE(atomic1_copy.load(), one); QCOMPARE(atomic1_copy.load(), atomic1.load()); void *two = &one; QAtomicPointer<void> atomic2 = two; QAtomicPointer<void> atomic2_copy = atomic2; - QVERIFY(atomic2_copy.load() == two); + QCOMPARE(atomic2_copy.load(), two); QCOMPARE(atomic2_copy.load(), atomic2.load()); void *three = &two; QAtomicPointer<void> atomic3 = three; QAtomicPointer<void> atomic3_copy = atomic3; - QVERIFY(atomic3_copy.load() == three); + QCOMPARE(atomic3_copy.load(), three); QCOMPARE(atomic3_copy.load(), atomic3.load()); } @@ -165,17 +165,17 @@ void tst_QAtomicPointer::assignment_operator() QAtomicPointer<void> atomic2 = two; QAtomicPointer<void> atomic3 = three; - QVERIFY(atomic1.load() == one); - QVERIFY(atomic2.load() == two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic1.load(), one); + QCOMPARE(atomic2.load(), two); + QCOMPARE(atomic3.load(), three); atomic1 = two; atomic2 = three; atomic3 = one; - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } void tst_QAtomicPointer::isTestAndSetNative() @@ -240,15 +240,15 @@ void tst_QAtomicPointer::testAndSet() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QVERIFY(atomic1.testAndSetRelaxed(one, two)); QVERIFY(atomic2.testAndSetRelaxed(two, three)); QVERIFY(atomic3.testAndSetRelaxed(three, one)); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } { @@ -258,15 +258,15 @@ void tst_QAtomicPointer::testAndSet() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QVERIFY(atomic1.testAndSetAcquire(one, two)); QVERIFY(atomic2.testAndSetAcquire(two, three)); QVERIFY(atomic3.testAndSetAcquire(three, one)); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } { @@ -276,15 +276,15 @@ void tst_QAtomicPointer::testAndSet() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QVERIFY(atomic1.testAndSetRelease(one, two)); QVERIFY(atomic2.testAndSetRelease(two, three)); QVERIFY(atomic3.testAndSetRelease(three, one)); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } { @@ -294,15 +294,15 @@ void tst_QAtomicPointer::testAndSet() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QVERIFY(atomic1.testAndSetOrdered(one, two)); QVERIFY(atomic2.testAndSetOrdered(two, three)); QVERIFY(atomic3.testAndSetOrdered(three, one)); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } } @@ -368,15 +368,15 @@ void tst_QAtomicPointer::fetchAndStore() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QCOMPARE(atomic1.fetchAndStoreRelaxed(two), one); QCOMPARE(atomic2.fetchAndStoreRelaxed(three), two); QCOMPARE(atomic3.fetchAndStoreRelaxed(one), three); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } { @@ -386,15 +386,15 @@ void tst_QAtomicPointer::fetchAndStore() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QCOMPARE(atomic1.fetchAndStoreAcquire(two), one); QCOMPARE(atomic2.fetchAndStoreAcquire(three), two); QCOMPARE(atomic3.fetchAndStoreAcquire(one), three); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } { @@ -404,15 +404,15 @@ void tst_QAtomicPointer::fetchAndStore() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QCOMPARE(atomic1.fetchAndStoreRelease(two), one); QCOMPARE(atomic2.fetchAndStoreRelease(three), two); QCOMPARE(atomic3.fetchAndStoreRelease(one), three); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } { @@ -422,15 +422,15 @@ void tst_QAtomicPointer::fetchAndStore() QCOMPARE(atomic1.load(), one); QCOMPARE(atomic2.load(), two); - QVERIFY(atomic3.load() == three); + QCOMPARE(atomic3.load(), three); QCOMPARE(atomic1.fetchAndStoreOrdered(two), one); QCOMPARE(atomic2.fetchAndStoreOrdered(three), two); QCOMPARE(atomic3.fetchAndStoreOrdered(one), three); - QVERIFY(atomic1.load() == two); - QVERIFY(atomic2.load() == three); - QVERIFY(atomic3.load() == one); + QCOMPARE(atomic1.load(), two); + QCOMPARE(atomic2.load(), three); + QCOMPARE(atomic3.load(), one); } } diff --git a/tests/auto/corelib/thread/qfuture/qfuture.pro b/tests/auto/corelib/thread/qfuture/qfuture.pro index 36853de2f0..ed9e189668 100644 --- a/tests/auto/corelib/thread/qfuture/qfuture.pro +++ b/tests/auto/corelib/thread/qfuture/qfuture.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qfuture QT = core core-private testlib concurrent SOURCES = tst_qfuture.cpp DEFINES += QT_STRICT_ITERATORS -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp index ad690a094b..e9db99f3cd 100644 --- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp +++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp @@ -84,9 +84,9 @@ void tst_QFuture::resultStore() { QtPrivate::ResultStore<int> store; - QVERIFY(store.begin() == store.end()); - QVERIFY(store.resultAt(0) == store.end()); - QVERIFY(store.resultAt(1) == store.end()); + QCOMPARE(store.begin(), store.end()); + QCOMPARE(store.resultAt(0), store.end()); + QCOMPARE(store.resultAt(1), store.end()); } @@ -118,7 +118,7 @@ void tst_QFuture::resultStore() store.addResults(-1, &vec1, 2, 2); QtPrivate::ResultIteratorBase it = store.begin(); QCOMPARE(it.resultIndex(), 0); - QVERIFY(it == store.begin()); + QCOMPARE(it, store.begin()); QVERIFY(it != store.end()); ++it; @@ -133,7 +133,7 @@ void tst_QFuture::resultStore() QCOMPARE(it.resultIndex(), 3); ++it; - QVERIFY(it == store.end()); + QCOMPARE(it, store.end()); } { QtPrivate::ResultStoreBase store; @@ -1012,14 +1012,14 @@ void tst_QFuture::iterators() QFuture<int>::const_iterator i1 = f.begin(), i2 = i1 + 1; QFuture<int>::const_iterator c1 = i1, c2 = c1 + 1; - QVERIFY(i1 == i1); - QVERIFY(i1 == c1); - QVERIFY(c1 == i1); - QVERIFY(c1 == c1); - QVERIFY(i2 == i2); - QVERIFY(i2 == c2); - QVERIFY(c2 == i2); - QVERIFY(c2 == c2); + QCOMPARE(i1, i1); + QCOMPARE(i1, c1); + QCOMPARE(c1, i1); + QCOMPARE(c1, c1); + QCOMPARE(i2, i2); + QCOMPARE(i2, c2); + QCOMPARE(c2, i2); + QCOMPARE(c2, c2); QVERIFY(i1 != i2); QVERIFY(i1 != c2); @@ -1061,14 +1061,14 @@ void tst_QFuture::iterators() QFuture<QString>::const_iterator i1 = f.begin(), i2 = i1 + 1; QFuture<QString>::const_iterator c1 = i1, c2 = c1 + 1; - QVERIFY(i1 == i1); - QVERIFY(i1 == c1); - QVERIFY(c1 == i1); - QVERIFY(c1 == c1); - QVERIFY(i2 == i2); - QVERIFY(i2 == c2); - QVERIFY(c2 == i2); - QVERIFY(c2 == c2); + QCOMPARE(i1, i1); + QCOMPARE(i1, c1); + QCOMPARE(c1, i1); + QCOMPARE(c1, c1); + QCOMPARE(i2, i2); + QCOMPARE(i2, c2); + QCOMPARE(c2, i2); + QCOMPARE(c2, c2); QVERIFY(i1 != i2); QVERIFY(i1 != c2); @@ -1438,6 +1438,8 @@ void tst_QFuture::nestedExceptions() QVERIFY(MyClass::caught); } +#endif // QT_NO_EXCEPTIONS + void tst_QFuture::nonGlobalThreadPool() { static Q_CONSTEXPR int Answer = 42; @@ -1485,7 +1487,5 @@ void tst_QFuture::nonGlobalThreadPool() } } -#endif // QT_NO_EXCEPTIONS - QTEST_MAIN(tst_QFuture) #include "tst_qfuture.moc" diff --git a/tests/auto/corelib/thread/qfuturesynchronizer/qfuturesynchronizer.pro b/tests/auto/corelib/thread/qfuturesynchronizer/qfuturesynchronizer.pro index a828213ade..5eebd12deb 100644 --- a/tests/auto/corelib/thread/qfuturesynchronizer/qfuturesynchronizer.pro +++ b/tests/auto/corelib/thread/qfuturesynchronizer/qfuturesynchronizer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qfuturesynchronizer QT = core testlib concurrent SOURCES = tst_qfuturesynchronizer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qfuturewatcher/qfuturewatcher.pro b/tests/auto/corelib/thread/qfuturewatcher/qfuturewatcher.pro index 17c0363ce4..d0e8b4c982 100644 --- a/tests/auto/corelib/thread/qfuturewatcher/qfuturewatcher.pro +++ b/tests/auto/corelib/thread/qfuturewatcher/qfuturewatcher.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qfuturewatcher QT = core core-private testlib concurrent SOURCES = tst_qfuturewatcher.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qmutex/qmutex.pro b/tests/auto/corelib/thread/qmutex/qmutex.pro index dde0a7f88f..229e57eb89 100644 --- a/tests/auto/corelib/thread/qmutex/qmutex.pro +++ b/tests/auto/corelib/thread/qmutex/qmutex.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmutex QT = core testlib SOURCES = tst_qmutex.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qmutexlocker/qmutexlocker.pro b/tests/auto/corelib/thread/qmutexlocker/qmutexlocker.pro index d35eca1009..76ec0471ca 100644 --- a/tests/auto/corelib/thread/qmutexlocker/qmutexlocker.pro +++ b/tests/auto/corelib/thread/qmutexlocker/qmutexlocker.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmutexlocker QT = core testlib SOURCES = tst_qmutexlocker.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qreadlocker/qreadlocker.pro b/tests/auto/corelib/thread/qreadlocker/qreadlocker.pro index d391768102..ba46786750 100644 --- a/tests/auto/corelib/thread/qreadlocker/qreadlocker.pro +++ b/tests/auto/corelib/thread/qreadlocker/qreadlocker.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qreadlocker QT = core testlib SOURCES = tst_qreadlocker.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qreadwritelock/qreadwritelock.pro b/tests/auto/corelib/thread/qreadwritelock/qreadwritelock.pro index b38d731049..c108c3d8af 100644 --- a/tests/auto/corelib/thread/qreadwritelock/qreadwritelock.pro +++ b/tests/auto/corelib/thread/qreadwritelock/qreadwritelock.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qreadwritelock QT = core testlib SOURCES = tst_qreadwritelock.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qresultstore/qresultstore.pro b/tests/auto/corelib/thread/qresultstore/qresultstore.pro index 5e9e83c503..2f6c18f64c 100644 --- a/tests/auto/corelib/thread/qresultstore/qresultstore.pro +++ b/tests/auto/corelib/thread/qresultstore/qresultstore.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qresultstore QT = core-private testlib concurrent SOURCES = tst_qresultstore.cpp DEFINES += QT_STRICT_ITERATORS -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qresultstore/tst_qresultstore.cpp b/tests/auto/corelib/thread/qresultstore/tst_qresultstore.cpp index ff850683ac..821077de18 100644 --- a/tests/auto/corelib/thread/qresultstore/tst_qresultstore.cpp +++ b/tests/auto/corelib/thread/qresultstore/tst_qresultstore.cpp @@ -80,9 +80,9 @@ void tst_QtConcurrentResultStore::iterators() { { ResultStore<int> store; - QVERIFY(store.begin() == store.end()); - QVERIFY(store.resultAt(0) == store.end()); - QVERIFY(store.resultAt(1) == store.end()); + QCOMPARE(store.begin(), store.end()); + QCOMPARE(store.resultAt(0), store.end()); + QCOMPARE(store.resultAt(1), store.end()); } { ResultStoreBase storebase; @@ -90,7 +90,7 @@ void tst_QtConcurrentResultStore::iterators() storebase.addResult(1, &int1); // ResultStoreBase does not take ownership, only ResultStore<> does. ResultIteratorBase it = storebase.begin(); QCOMPARE(it.resultIndex(), 0); - QVERIFY(it == storebase.begin()); + QCOMPARE(it, storebase.begin()); QVERIFY(it != storebase.end()); ++it; @@ -100,7 +100,7 @@ void tst_QtConcurrentResultStore::iterators() ++it; QVERIFY(it != storebase.begin()); - QVERIFY(it == storebase.end()); + QCOMPARE(it, storebase.end()); } } @@ -160,7 +160,7 @@ void tst_QtConcurrentResultStore::addResults() store.addResults(-1, &vec1, 2, 2); ResultIteratorBase it = store.begin(); QCOMPARE(it.resultIndex(), 0); - QVERIFY(it == store.begin()); + QCOMPARE(it, store.begin()); QVERIFY(it != store.end()); ++it; @@ -175,7 +175,7 @@ void tst_QtConcurrentResultStore::addResults() QCOMPARE(it.resultIndex(), 3); ++it; - QVERIFY(it == store.end()); + QCOMPARE(it, store.end()); } void tst_QtConcurrentResultStore::resultIndex() diff --git a/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro b/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro index 56e9fd5da6..5a0f0337e6 100644 --- a/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro +++ b/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qsemaphore QT = core testlib SOURCES = tst_qsemaphore.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qthread/qthread.pro b/tests/auto/corelib/thread/qthread/qthread.pro index 9efce4e7ed..18d867ecef 100644 --- a/tests/auto/corelib/thread/qthread/qthread.pro +++ b/tests/auto/corelib/thread/qthread/qthread.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qthread QT = core testlib SOURCES = tst_qthread.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qthreadonce/qthreadonce.pro b/tests/auto/corelib/thread/qthreadonce/qthreadonce.pro index 2c189e7422..e8b95a06a7 100644 --- a/tests/auto/corelib/thread/qthreadonce/qthreadonce.pro +++ b/tests/auto/corelib/thread/qthreadonce/qthreadonce.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qthreadonce QT = core testlib SOURCES = tst_qthreadonce.cpp @@ -10,4 +10,3 @@ SOURCES = tst_qthreadonce.cpp # Temporary: SOURCES += qthreadonce.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp index 0699c50464..7a3054abb0 100644 --- a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp +++ b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp @@ -163,7 +163,7 @@ void tst_QThreadOnce::nesting() } } - QVERIFY(variable == 1); + QCOMPARE(variable, 1); } static void reentrant(int control, int &counter) diff --git a/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro b/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro index 387b79b012..eac4ef9365 100644 --- a/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro +++ b/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qthreadpool QT = core testlib SOURCES = tst_qthreadpool.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro index eb8d06d094..94a0a01e94 100644 --- a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro +++ b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro @@ -7,4 +7,3 @@ CONFIG += console # This app is testdata for tst_qthreadstorage target.path = $$[QT_INSTALL_TESTS]/tst_qthreadstorage/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro index 2fa973d2f7..d821e56366 100644 --- a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro +++ b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro @@ -2,4 +2,4 @@ TEMPLATE = subdirs SUBDIRS = \ crashonexit \ test -CONFIG += ordered parallel_test +CONFIG += ordered diff --git a/tests/auto/corelib/thread/qthreadstorage/test/test.pro b/tests/auto/corelib/thread/qthreadstorage/test/test.pro index 8b7caf1e24..729241f891 100644 --- a/tests/auto/corelib/thread/qthreadstorage/test/test.pro +++ b/tests/auto/corelib/thread/qthreadstorage/test/test.pro @@ -7,4 +7,3 @@ SOURCES = ../tst_qthreadstorage.cpp TEST_HELPER_INSTALLS = ../crashonexit/crashonexit -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qwaitcondition/qwaitcondition.pro b/tests/auto/corelib/thread/qwaitcondition/qwaitcondition.pro index 7383997e67..2098d9dd2f 100644 --- a/tests/auto/corelib/thread/qwaitcondition/qwaitcondition.pro +++ b/tests/auto/corelib/thread/qwaitcondition/qwaitcondition.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qwaitcondition QT = core testlib SOURCES = tst_qwaitcondition.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/thread/qwritelocker/qwritelocker.pro b/tests/auto/corelib/thread/qwritelocker/qwritelocker.pro index 4a797975ab..a6c4f70b8d 100644 --- a/tests/auto/corelib/thread/qwritelocker/qwritelocker.pro +++ b/tests/auto/corelib/thread/qwritelocker/qwritelocker.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qwritelocker QT = core testlib SOURCES = tst_qwritelocker.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/collections/collections.pro b/tests/auto/corelib/tools/collections/collections.pro index 51ea667f58..5c04515fa0 100644 --- a/tests/auto/corelib/tools/collections/collections.pro +++ b/tests/auto/corelib/tools/collections/collections.pro @@ -2,8 +2,6 @@ CONFIG += testcase TARGET = tst_collections SOURCES += tst_collections.cpp QT = core testlib -CONFIG += parallel_test # This test does not work with strict iterators DEFINES -= QT_STRICT_ITERATORS -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp index ae8ffe48be..22a282457b 100644 --- a/tests/auto/corelib/tools/collections/tst_collections.cpp +++ b/tests/auto/corelib/tools/collections/tst_collections.cpp @@ -517,11 +517,11 @@ void tst_Collections::list() QList<QString> list = vector.toList(); QVERIFY(list.size() == 5); - QVERIFY(list.at(0) == "99"); - QVERIFY(list.at(4) == "100"); + QCOMPARE(list.at(0), QLatin1String("99")); + QCOMPARE(list.at(4), QLatin1String("100")); list[0] = "10"; - QVERIFY(list.at(0) == "10"); - QVERIFY(vector.at(0) == "99"); + QCOMPARE(list.at(0), QLatin1String("10")); + QCOMPARE(vector.at(0), QLatin1String("99")); } @@ -533,15 +533,15 @@ void tst_Collections::list() QVERIFY((*it)[0] == QChar('H')); QVERIFY(it->constData()[0] == QChar('H')); it->replace(QChar('H'), QChar('X')); - QVERIFY(list.first() == "Xello"); + QCOMPARE(list.first(), QLatin1String("Xello")); QList<QString>::const_iterator cit = list.constBegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(), QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); cit = list.cbegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(),QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); } { @@ -575,10 +575,10 @@ void tst_Collections::list() list << "alpha" << "beta"; list += list; QVERIFY(list.size() == 4); - QVERIFY(list.at(0) == "alpha"); - QVERIFY(list.at(1) == "beta"); - QVERIFY(list.at(2) == "alpha"); - QVERIFY(list.at(3) == "beta"); + QCOMPARE(list.at(0), QLatin1String("alpha")); + QCOMPARE(list.at(1), QLatin1String("beta")); + QCOMPARE(list.at(2), QLatin1String("alpha")); + QCOMPARE(list.at(3), QLatin1String("beta")); } // test endcases for inserting into a qlist @@ -954,15 +954,15 @@ void tst_Collections::linkedList() QVERIFY((*it)[0] == QChar('H')); QVERIFY(it->constData()[0] == QChar('H')); it->replace(QChar('H'), QChar('X')); - QVERIFY(list.first() == "Xello"); + QCOMPARE(list.first(), QLatin1String("Xello")); QLinkedList<QString>::const_iterator cit = list.constBegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(), QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); cit = list.cbegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(), QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); } { @@ -970,10 +970,10 @@ void tst_Collections::linkedList() list << "alpha" << "beta"; list += list; QVERIFY(list.size() == 4); - QVERIFY(*list.begin() == "alpha"); - QVERIFY(*(list.begin() + 1) == "beta"); - QVERIFY(*(list.begin() + 2) == "alpha"); - QVERIFY(*(list.begin() + 3) == "beta"); + QCOMPARE(*list.begin(), QLatin1String("alpha")); + QCOMPARE(*(list.begin() + 1), QLatin1String("beta")); + QCOMPARE(*(list.begin() + 2), QLatin1String("alpha")); + QCOMPARE(*(list.begin() + 3), QLatin1String("beta")); } { @@ -1054,8 +1054,8 @@ void tst_Collections::vector() QVector<QString> vec; vec << "foo" << "bar"; vec.reserve( 512 ); - QVERIFY(vec[0] == "foo"); - QVERIFY(vec[1] == "bar"); + QCOMPARE(vec[0], QLatin1String("foo")); + QCOMPARE(vec[1], QLatin1String("bar")); int initialLargeStaticCount = LargeStatic::count; { @@ -1070,10 +1070,10 @@ void tst_Collections::vector() vector << "alpha" << "beta"; vector += vector; QVERIFY(vector.size() == 4); - QVERIFY(vector.at(0) == "alpha"); - QVERIFY(vector.at(1) == "beta"); - QVERIFY(vector.at(2) == "alpha"); - QVERIFY(vector.at(3) == "beta"); + QCOMPARE(vector.at(0), QLatin1String("alpha")); + QCOMPARE(vector.at(1), QLatin1String("beta")); + QCOMPARE(vector.at(2), QLatin1String("alpha")); + QCOMPARE(vector.at(3), QLatin1String("beta")); } int originalLargeStaticCount = LargeStatic::count; @@ -1594,15 +1594,15 @@ void tst_Collections::hash() QVERIFY((*it)[0] == QChar('H')); QVERIFY(it->constData()[0] == QChar('H')); it->replace(QChar('H'), QChar('X')); - QVERIFY(*hash.begin() == "Xello"); + QCOMPARE(*hash.begin(), QLatin1String("Xello")); QHash<int, QString>::const_iterator cit = hash.constBegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(), QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); cit = hash.cbegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(), QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); } { @@ -1915,15 +1915,15 @@ void tst_Collections::map() QVERIFY((*it)[0] == QChar('H')); QVERIFY(it->constData()[0] == QChar('H')); it->replace(QChar('H'), QChar('X')); - QVERIFY(*map.begin() == "Xello"); + QCOMPARE(*map.begin(), QLatin1String("Xello")); QMap<int, QString>::const_iterator cit = map.constBegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(), QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); cit = map.cbegin(); - QVERIFY((*cit).toLower() == "xello"); - QVERIFY(cit->toUpper() == "XELLO"); + QCOMPARE((*cit).toLower(), QLatin1String("xello")); + QCOMPARE(cit->toUpper(), QLatin1String("XELLO")); } { @@ -2005,17 +2005,17 @@ void tst_Collections::qstring() QVERIFY(hello.left(0) == ""); QVERIFY(!hello.left(0).isNull()); - QVERIFY(hello.left(1) == "h"); - QVERIFY(hello.left(2) == "he"); - QVERIFY(hello.left(200) == "hello"); + QCOMPARE(hello.left(1), QLatin1String("h")); + QCOMPARE(hello.left(2), QLatin1String("he")); + QCOMPARE(hello.left(200), QLatin1String("hello")); QVERIFY(hello.left(hello.size()) == hello); QVERIFY(hello.left(hello.size()+1) == hello); QVERIFY(hello.right(0) == ""); QVERIFY(!hello.right(0).isNull()); - QVERIFY(hello.right(1) == "o"); - QVERIFY(hello.right(2) == "lo"); - QVERIFY(hello.right(200) == "hello"); + QCOMPARE(hello.right(1), QLatin1String("o")); + QCOMPARE(hello.right(2), QLatin1String("lo")); + QCOMPARE(hello.right(200), QLatin1String("hello")); QVERIFY(hello.right(hello.size()) == hello); QVERIFY(hello.right(hello.size()+1) == hello); @@ -2023,16 +2023,16 @@ void tst_Collections::qstring() QVERIFY(hello.mid(0, 1) == "h"); QVERIFY(hello.mid(0, 2) == "he"); QVERIFY(hello.mid(0, 200) == "hello"); - QVERIFY(hello.mid(0) == "hello"); + QCOMPARE(hello.mid(0), QLatin1String("hello")); QVERIFY(hello.mid(0, hello.size()) == hello); QVERIFY(hello.mid(0, hello.size()+1) == hello); QVERIFY(hello.mid(hello.size()-0) == ""); QVERIFY(hello.mid(hello.size()-0).isEmpty()); QVERIFY(!hello.mid(hello.size()-0).isNull()); - QVERIFY(hello.mid(hello.size()-1) == "o"); - QVERIFY(hello.mid(hello.size()-2) == "lo"); - QVERIFY(hello.mid(hello.size()-200) == "hello"); + QCOMPARE(hello.mid(hello.size()-1), QLatin1String("o")); + QCOMPARE(hello.mid(hello.size()-2), QLatin1String("lo")); + QCOMPARE(hello.mid(hello.size()-200), QLatin1String("hello")); QString null; QString nonNull = ""; @@ -2048,7 +2048,7 @@ void tst_Collections::qstring() QString fill = "123"; fill.fill('a'); - QVERIFY(fill == "aaa"); + QCOMPARE(fill, QLatin1String("aaa")); s.clear(); s = hello; @@ -2060,15 +2060,15 @@ void tst_Collections::qstring() QVERIFY(s == helloWorld); s = "012345"; s.insert(3, 'E'); - QVERIFY(s == "012E345"); + QCOMPARE(s, QLatin1String("012E345")); s.insert(3, "INSID"); - QVERIFY(s == "012INSIDE345"); + QCOMPARE(s, QLatin1String("012INSIDE345")); s = "short"; s.insert(7, 'E'); - QVERIFY(s == "short E"); + QCOMPARE(s, QLatin1String("short E")); s = "short"; s.insert(7, "END"); - QVERIFY(s == "short END"); + QCOMPARE(s, QLatin1String("short END")); QVERIFY(QString::fromLatin1("hello") == "hello"); @@ -2125,25 +2125,25 @@ void tst_Collections::qstring() s += QChar((uchar) 0xb0); QVERIFY(s.toUtf8() != s.toLatin1()); QCOMPARE(s[s.length()-1].unicode(), (ushort)0xb0); - QVERIFY(s.left(s.length()-1) == "ascii"); + QCOMPARE(s.left(s.length()-1), QLatin1String("ascii")); QVERIFY(s == QString::fromUtf8(s.toUtf8().constData())); s = "12"; s.append('3'); s += '4'; - QVERIFY(s == "1234"); + QCOMPARE(s, QLatin1String("1234")); s = "repend"; s.prepend('p'); - QVERIFY(s == "prepend"); + QCOMPARE(s, QLatin1String("prepend")); s.prepend("abc "); - QVERIFY(s == "abc prepend"); + QCOMPARE(s, QLatin1String("abc prepend")); s = " whitespace "; - QVERIFY(s.trimmed() == "whitespace"); + QCOMPARE(s.trimmed(), QLatin1String("whitespace")); s = " lots of stuff "; - QVERIFY(s.simplified() == "lots of stuff"); + QCOMPARE(s.simplified(), QLatin1String("lots of stuff")); s = "a hat, a stick, a ski"; QVERIFY(s[2] == 'h'); @@ -2152,17 +2152,17 @@ void tst_Collections::qstring() s = "12223"; s.remove(1, 2); - QVERIFY(s == "123"); + QCOMPARE(s, QLatin1String("123")); s = "(%1)(%2)"; s = s.arg("foo").arg(7); - QVERIFY(s == "(foo)(7)"); + QCOMPARE(s, QLatin1String("(foo)(7)")); s = "stl rocks"; std::string stl_string = s.toStdString(); // TODO: std::string stl_string = s does not work. - QVERIFY(s == "stl rocks"); + QCOMPARE(s, QLatin1String("stl rocks")); s = QString::fromStdString(stl_string); // TODO: s = stl_string does not work. - QVERIFY(s == "stl rocks"); + QCOMPARE(s, QLatin1String("stl rocks")); { QString str("Bananas"); @@ -2178,10 +2178,10 @@ void tst_Collections::qstring() QString str = "Hello"; QString cstr = QString::fromRawData(str.unicode(), str.length()); - QVERIFY(str == "Hello"); - QVERIFY(cstr == "Hello"); + QCOMPARE(str, QLatin1String("Hello")); + QCOMPARE(cstr, QLatin1String("Hello")); cstr.clear(); - QVERIFY(str == "Hello"); + QCOMPARE(str, QLatin1String("Hello")); QVERIFY(cstr.isEmpty()); { @@ -2328,7 +2328,7 @@ void tst_Collections::pair() QPair<int, QString> a(1, "Zebra"), b(2, "Ying"), c(3, "Yang"), d(3, "Ying"), e(5, "Alabama"); QVERIFY(a.first == 1); - QVERIFY(a.second == "Zebra"); + QCOMPARE(a.second, QLatin1String("Zebra")); QVERIFY(a == qMakePair(1, QString("Zebra"))); QVERIFY(a == a && b == b && c == c && d == d && e == e); @@ -3482,7 +3482,7 @@ template<class Container> void foreach_test_arrays(const Container &container) void tst_Collections::foreach_2() { - QStringList strlist = QString::fromLatin1("a,b,c,d,e,f,g,h,ih,kl,mn,op,qr,st,uvw,xyz").split(","); + QStringList strlist = QString::fromLatin1("a,b,c,d,e,f,g,h,ih,kl,mn,op,qr,st,uvw,xyz").split(QLatin1Char(',')); foreach_test_arrays(strlist); foreach_test_arrays(QList<QString>(strlist)); foreach_test_arrays(strlist.toVector()); diff --git a/tests/auto/corelib/tools/qalgorithms/qalgorithms.pro b/tests/auto/corelib/tools/qalgorithms/qalgorithms.pro index cb6f6595b4..0e6e830185 100644 --- a/tests/auto/corelib/tools/qalgorithms/qalgorithms.pro +++ b/tests/auto/corelib/tools/qalgorithms/qalgorithms.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qalgorithms QT = core testlib SOURCES = tst_qalgorithms.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index 99e5c4c85d..105b8b45d8 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -312,24 +312,24 @@ void tst_QAlgorithms::swap() { QString a = "1", b = "2"; qSwap(a, b); - QVERIFY(a == "2"); - QVERIFY(b == "1"); + QCOMPARE(a, QLatin1String("2")); + QCOMPARE(b, QLatin1String("1")); qSwap(a, a); - QVERIFY(a == "2"); - QVERIFY(b == "1"); + QCOMPARE(a, QLatin1String("2")); + QCOMPARE(b, QLatin1String("1")); qSwap(b, b); - QVERIFY(a == "2"); - QVERIFY(b == "1"); + QCOMPARE(a, QLatin1String("2")); + QCOMPARE(b, QLatin1String("1")); qSwap(a, b); - QVERIFY(a == "1"); - QVERIFY(b == "2"); + QCOMPARE(a, QLatin1String("1")); + QCOMPARE(b, QLatin1String("2")); qSwap(b, a); - QVERIFY(a == "2"); - QVERIFY(b == "1"); + QCOMPARE(a, QLatin1String("2")); + QCOMPARE(b, QLatin1String("1")); } { diff --git a/tests/auto/corelib/tools/qarraydata/qarraydata.pro b/tests/auto/corelib/tools/qarraydata/qarraydata.pro index d5fe08c009..ee3faa9ad7 100644 --- a/tests/auto/corelib/tools/qarraydata/qarraydata.pro +++ b/tests/auto/corelib/tools/qarraydata/qarraydata.pro @@ -2,5 +2,4 @@ TARGET = tst_qarraydata SOURCES += $$PWD/tst_qarraydata.cpp HEADERS += $$PWD/simplevector.h QT = core testlib -CONFIG += testcase parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +CONFIG += testcase diff --git a/tests/auto/corelib/tools/qbitarray/qbitarray.pro b/tests/auto/corelib/tools/qbitarray/qbitarray.pro index 22f62faaca..1e7185b600 100644 --- a/tests/auto/corelib/tools/qbitarray/qbitarray.pro +++ b/tests/auto/corelib/tools/qbitarray/qbitarray.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qbitarray QT = core testlib SOURCES = tst_qbitarray.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp index d3bbfa338b..5e6459c58b 100644 --- a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp @@ -126,9 +126,9 @@ void tst_QBitArray::size() for (int j=0; j<len; j++) { bool b = a[j]; if (b) - S+= "1"; + S+= QLatin1Char('1'); else - S+= "0"; + S+= QLatin1Char('0'); } QTEST(S,"res"); } diff --git a/tests/auto/corelib/tools/qbytearray/qbytearray.pro b/tests/auto/corelib/tools/qbytearray/qbytearray.pro index 22104f817f..a4501611d6 100644 --- a/tests/auto/corelib/tools/qbytearray/qbytearray.pro +++ b/tests/auto/corelib/tools/qbytearray/qbytearray.pro @@ -1,10 +1,9 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qbytearray QT = core-private testlib SOURCES = tst_qbytearray.cpp TESTDATA += rfc3252.txt -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 mac { OBJECTIVE_SOURCES += tst_qbytearray_mac.mm diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index f942eab800..7a94d922c9 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -896,7 +896,9 @@ void tst_QByteArray::prepend() QCOMPARE(ba.prepend("1"), QByteArray("1foo")); QCOMPARE(ba.prepend(QByteArray("2")), QByteArray("21foo")); QCOMPARE(ba.prepend('3'), QByteArray("321foo")); - QCOMPARE(ba.prepend("\0 ", 2), QByteArray::fromRawData("\0 321foo", 8)); + QCOMPARE(ba.prepend(-1, 'x'), QByteArray("321foo")); + QCOMPARE(ba.prepend(3, 'x'), QByteArray("xxx321foo")); + QCOMPARE(ba.prepend("\0 ", 2), QByteArray::fromRawData("\0 xxx321foo", 11)); } void tst_QByteArray::prependExtended_data() @@ -924,8 +926,10 @@ void tst_QByteArray::prependExtended() QCOMPARE(array.prepend("1"), QByteArray("1data")); QCOMPARE(array.prepend(QByteArray("2")), QByteArray("21data")); QCOMPARE(array.prepend('3'), QByteArray("321data")); - QCOMPARE(array.prepend("\0 ", 2), QByteArray::fromRawData("\0 321data", 9)); - QCOMPARE(array.size(), 9); + QCOMPARE(array.prepend(-1, 'x'), QByteArray("321data")); + QCOMPARE(array.prepend(3, 'x'), QByteArray("xxx321data")); + QCOMPARE(array.prepend("\0 ", 2), QByteArray::fromRawData("\0 xxx321data", 12)); + QCOMPARE(array.size(), 12); } void tst_QByteArray::append() @@ -936,9 +940,11 @@ void tst_QByteArray::append() QCOMPARE(ba.append("1"), QByteArray("foo1")); QCOMPARE(ba.append(QByteArray("2")), QByteArray("foo12")); QCOMPARE(ba.append('3'), QByteArray("foo123")); - QCOMPARE(ba.append("\0"), QByteArray("foo123")); - QCOMPARE(ba.append("\0", 1), QByteArray::fromRawData("foo123\0", 7)); - QCOMPARE(ba.size(), 7); + QCOMPARE(ba.append(-1, 'x'), QByteArray("foo123")); + QCOMPARE(ba.append(3, 'x'), QByteArray("foo123xxx")); + QCOMPARE(ba.append("\0"), QByteArray("foo123xxx")); + QCOMPARE(ba.append("\0", 1), QByteArray::fromRawData("foo123xxx\0", 10)); + QCOMPARE(ba.size(), 10); } void tst_QByteArray::appendExtended_data() @@ -958,9 +964,11 @@ void tst_QByteArray::appendExtended() QCOMPARE(array.append("1"), QByteArray("data1")); QCOMPARE(array.append(QByteArray("2")), QByteArray("data12")); QCOMPARE(array.append('3'), QByteArray("data123")); - QCOMPARE(array.append("\0"), QByteArray("data123")); - QCOMPARE(array.append("\0", 1), QByteArray::fromRawData("data123\0", 8)); - QCOMPARE(array.size(), 8); + QCOMPARE(array.append(-1, 'x'), QByteArray("data123")); + QCOMPARE(array.append(3, 'x'), QByteArray("data123xxx")); + QCOMPARE(array.append("\0"), QByteArray("data123xxx")); + QCOMPARE(array.append("\0", 1), QByteArray::fromRawData("data123xxx\0", 11)); + QCOMPARE(array.size(), 11); } void tst_QByteArray::insert() @@ -976,6 +984,12 @@ void tst_QByteArray::insert() QCOMPARE(ba.insert(1, 'b'), QByteArray("abc")); QCOMPARE(ba.size(), 3); + ba = "ac"; + QCOMPARE(ba.insert(-1, 3, 'x'), QByteArray("ac")); + QCOMPARE(ba.insert(1, 3, 'x'), QByteArray("axxxc")); + QCOMPARE(ba.insert(6, 3, 'x'), QByteArray("axxxc xxx")); + QCOMPARE(ba.size(), 9); + ba = "ikl"; QCOMPARE(ba.insert(1, "j"), QByteArray("ijkl")); QCOMPARE(ba.size(), 4); @@ -994,7 +1008,8 @@ void tst_QByteArray::insertExtended() { QFETCH(QByteArray, array); QCOMPARE(array.insert(1, "i"), QByteArray("diata")); - QCOMPARE(array.size(), 5); + QCOMPARE(array.insert(1, 3, 'x'), QByteArray("dxxxiata")); + QCOMPARE(array.size(), 8); } void tst_QByteArray::remove_data() @@ -1969,15 +1984,15 @@ void tst_QByteArray::movablity() QCOMPARE(array.isEmpty(), newIsEmpty); QCOMPARE(array.isNull(), newIsNull); QCOMPARE(array.capacity(), newCapacity); - QVERIFY(array.startsWith("a")); - QVERIFY(array.endsWith("b")); + QVERIFY(array.startsWith('a')); + QVERIFY(array.endsWith('b')); QCOMPARE(copy.size(), newSize); QCOMPARE(copy.isEmpty(), newIsEmpty); QCOMPARE(copy.isNull(), newIsNull); QCOMPARE(copy.capacity(), newCapacity); - QVERIFY(copy.startsWith("a")); - QVERIFY(copy.endsWith("b")); + QVERIFY(copy.startsWith('a')); + QVERIFY(copy.endsWith('b')); // try to not crash array.squeeze(); diff --git a/tests/auto/corelib/tools/qbytearraylist/qbytearraylist.pro b/tests/auto/corelib/tools/qbytearraylist/qbytearraylist.pro index 2cd4522f67..6c05c288cf 100644 --- a/tests/auto/corelib/tools/qbytearraylist/qbytearraylist.pro +++ b/tests/auto/corelib/tools/qbytearraylist/qbytearraylist.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qbytearraylist QT = core testlib SOURCES = tst_qbytearraylist.cpp diff --git a/tests/auto/corelib/tools/qbytearraymatcher/qbytearraymatcher.pro b/tests/auto/corelib/tools/qbytearraymatcher/qbytearraymatcher.pro index 7da193d01a..0624e1886c 100644 --- a/tests/auto/corelib/tools/qbytearraymatcher/qbytearraymatcher.pro +++ b/tests/auto/corelib/tools/qbytearraymatcher/qbytearraymatcher.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qbytearraymatcher QT = core testlib SOURCES = tst_qbytearraymatcher.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qcache/qcache.pro b/tests/auto/corelib/tools/qcache/qcache.pro index 80a616ce38..07488ef40f 100644 --- a/tests/auto/corelib/tools/qcache/qcache.pro +++ b/tests/auto/corelib/tools/qcache/qcache.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qcache QT = core testlib SOURCES = tst_qcache.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qchar/qchar.pro b/tests/auto/corelib/tools/qchar/qchar.pro index a72f16fa49..771e4290b8 100644 --- a/tests/auto/corelib/tools/qchar/qchar.pro +++ b/tests/auto/corelib/tools/qchar/qchar.pro @@ -1,10 +1,9 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qchar QT = core-private testlib SOURCES = tst_qchar.cpp TESTDATA += data/NormalizationTest.txt -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index f80d6e6d93..3a24c82f9e 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -756,7 +756,7 @@ void tst_QChar::normalization_data() if (comment >= 0) line = line.left(comment); - if (line.startsWith("@")) { + if (line.startsWith('@')) { if (line.startsWith("@Part") && line.size() > 5 && QChar(line.at(5)).isDigit()) part = QChar(line.at(5)).digitValue(); continue; diff --git a/tests/auto/corelib/tools/qcollator/qcollator.pro b/tests/auto/corelib/tools/qcollator/qcollator.pro index 3c5987ffa0..ed879ee70e 100644 --- a/tests/auto/corelib/tools/qcollator/qcollator.pro +++ b/tests/auto/corelib/tools/qcollator/qcollator.pro @@ -1,7 +1,6 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qcollator QT = core testlib SOURCES = tst_qcollator.cpp DEFINES += QT_NO_CAST_TO_ASCII contains(QT_CONFIG,icu):DEFINES += QT_USE_ICU -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.pro b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.pro index 6d3e6d677f..75b74bbf4d 100644 --- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.pro +++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qcommandlineparser QT = core testlib SOURCES = tst_qcommandlineparser.cpp diff --git a/tests/auto/corelib/tools/qcontiguouscache/qcontiguouscache.pro b/tests/auto/corelib/tools/qcontiguouscache/qcontiguouscache.pro index db4412ed59..d79bd16c76 100644 --- a/tests/auto/corelib/tools/qcontiguouscache/qcontiguouscache.pro +++ b/tests/auto/corelib/tools/qcontiguouscache/qcontiguouscache.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qcontiguouscache QT = core testlib SOURCES = tst_qcontiguouscache.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro index 941a068f8e..15a57c692e 100644 --- a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro +++ b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro @@ -1,10 +1,9 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qcryptographichash QT = core testlib SOURCES = tst_qcryptographichash.cpp TESTDATA += data/* -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/corelib/tools/qdate/qdate.pro b/tests/auto/corelib/tools/qdate/qdate.pro index 6be3164fd7..dd7c6cb888 100644 --- a/tests/auto/corelib/tools/qdate/qdate.pro +++ b/tests/auto/corelib/tools/qdate/qdate.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qdate QT = core testlib SOURCES = tst_qdate.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index e515fcf5b9..27988e5b5b 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -1047,7 +1047,7 @@ void tst_QDate::fromStringFormat_data() QTest::newRow("data14") << QString("132") << QString("Md") << invalidDate(); QTest::newRow("data15") << february << QString("MMMM") << QDate(defDate().year(), 2, 1); - QString date = mon + " " + august + " 8 2005"; + QString date = mon + QLatin1Char(' ') + august + " 8 2005"; QTest::newRow("data16") << date << QString("ddd MMMM d yyyy") << QDate(2005, 8, 8); QTest::newRow("data17") << QString("2000:00") << QString("yyyy:yy") << QDate(2000, 1, 1); QTest::newRow("data18") << QString("1999:99") << QString("yyyy:yy") << QDate(1999, 1, 1); diff --git a/tests/auto/corelib/tools/qdatetime/qdatetime.pro b/tests/auto/corelib/tools/qdatetime/qdatetime.pro index 25d11443e4..ba36621cf1 100644 --- a/tests/auto/corelib/tools/qdatetime/qdatetime.pro +++ b/tests/auto/corelib/tools/qdatetime/qdatetime.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qdatetime QT = core-private testlib SOURCES = tst_qdatetime.cpp @@ -10,7 +10,6 @@ win32-msvc|win32-msvc9x { QMAKE_CFLAGS_RELEASE -= -O1 QMAKE_CXXFLAGS_RELEASE -= -O1 } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 mac { OBJECTIVE_SOURCES += tst_qdatetime_mac.mm diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index df9089057d..571e8deb00 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -2096,11 +2096,11 @@ void tst_QDateTime::fromStringStringFormat_data() QTest::newRow("data9") << QString("101010") << QString("dMyy") << QDateTime(QDate(1910, 10, 10), QTime()); QTest::newRow("data10") << QString("101010") << QString("dMyy") << QDateTime(QDate(1910, 10, 10), QTime()); QTest::newRow("data11") << date << QString("dd MMM yy") << QDateTime(QDate(1910, 10, 10), QTime()); - date = fri + " " + december + " 3 2004"; + date = fri + QLatin1Char(' ') + december + " 3 2004"; QTest::newRow("data12") << date << QString("ddd MMMM d yyyy") << QDateTime(QDate(2004, 12, 3), QTime()); QTest::newRow("data13") << QString("30.02.2004") << QString("dd.MM.yyyy") << invalidDateTime(); QTest::newRow("data14") << QString("32.01.2004") << QString("dd.MM.yyyy") << invalidDateTime(); - date = thu + " " + january + " 2004"; + date = thu + QLatin1Char(' ') + january + " 2004"; QTest::newRow("data15") << date << QString("ddd MMMM yyyy") << QDateTime(QDate(2004, 1, 1), QTime()); QTest::newRow("data16") << QString("2005-06-28T07:57:30.001Z") << QString("yyyy-MM-ddThh:mm:ss.zZ") diff --git a/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro b/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro index 679f9bbda4..80c5a94a83 100644 --- a/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro +++ b/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qeasingcurve QT = core testlib SOURCES = tst_qeasingcurve.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qelapsedtimer/qelapsedtimer.pro b/tests/auto/corelib/tools/qelapsedtimer/qelapsedtimer.pro index 7e9f907915..657a63a5d7 100644 --- a/tests/auto/corelib/tools/qelapsedtimer/qelapsedtimer.pro +++ b/tests/auto/corelib/tools/qelapsedtimer/qelapsedtimer.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qelapsedtimer QT = core testlib SOURCES = tst_qelapsedtimer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro index 2ee091c139..45fe1f60fe 100644 --- a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro +++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qexplicitlyshareddatapointer QT = core testlib SOURCES = tst_qexplicitlyshareddatapointer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qfreelist/qfreelist.pro b/tests/auto/corelib/tools/qfreelist/qfreelist.pro index 60ae819f87..fb108338bd 100644 --- a/tests/auto/corelib/tools/qfreelist/qfreelist.pro +++ b/tests/auto/corelib/tools/qfreelist/qfreelist.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfreelist QT = core-private testlib SOURCES = tst_qfreelist.cpp !contains(QT_CONFIG,private_tests): SOURCES += $$QT_SOURCE_TREE/src/corelib/tools/qfreelist.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qhash/qhash.pro b/tests/auto/corelib/tools/qhash/qhash.pro index 1ed062ca91..79ffd4e9d1 100644 --- a/tests/auto/corelib/tools/qhash/qhash.pro +++ b/tests/auto/corelib/tools/qhash/qhash.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qhash QT = core testlib SOURCES = $$PWD/tst_qhash.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 6a5c6b5670..340453fb3e 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -510,24 +510,24 @@ void tst_QHash::key() QCOMPARE(hash1.key(1, def), def); hash1.insert("one", 1); - QCOMPARE(hash1.key(1), QString("one")); - QCOMPARE(hash1.key(1, def), QString("one")); + QCOMPARE(hash1.key(1), QLatin1String("one")); + QCOMPARE(hash1.key(1, def), QLatin1String("one")); QCOMPARE(hash1.key(2), QString()); QCOMPARE(hash1.key(2, def), def); hash1.insert("two", 2); - QCOMPARE(hash1.key(1), QString("one")); - QCOMPARE(hash1.key(1, def), QString("one")); - QCOMPARE(hash1.key(2), QString("two")); - QCOMPARE(hash1.key(2, def), QString("two")); + QCOMPARE(hash1.key(1), QLatin1String("one")); + QCOMPARE(hash1.key(1, def), QLatin1String("one")); + QCOMPARE(hash1.key(2), QLatin1String("two")); + QCOMPARE(hash1.key(2, def), QLatin1String("two")); QCOMPARE(hash1.key(3), QString()); QCOMPARE(hash1.key(3, def), def); hash1.insert("deux", 2); - QCOMPARE(hash1.key(1), QString("one")); - QCOMPARE(hash1.key(1, def), QString("one")); - QVERIFY(hash1.key(2) == "deux" || hash1.key(2) == "two"); - QVERIFY(hash1.key(2, def) == "deux" || hash1.key(2, def) == "two"); + QCOMPARE(hash1.key(1), QLatin1String("one")); + QCOMPARE(hash1.key(1, def), QLatin1String("one")); + QVERIFY(hash1.key(2) == QLatin1String("deux") || hash1.key(2) == QLatin1String("two")); + QVERIFY(hash1.key(2, def) == QLatin1String("deux") || hash1.key(2, def) == QLatin1String("two")); QCOMPARE(hash1.key(3), QString()); QCOMPARE(hash1.key(3, def), def); } @@ -628,8 +628,8 @@ void tst_QHash::find() map1.insert(1,"Mayer"); map1.insert(2,"Hej"); - QVERIFY(map1.find(1).value() == "Mayer"); - QVERIFY(map1.find(2).value() == "Hej"); + QCOMPARE(map1.find(1).value(), QLatin1String("Mayer")); + QCOMPARE(map1.find(2).value(), QLatin1String("Hej")); for(i = 3; i < 10; ++i) { compareString = testString.arg(i); @@ -661,8 +661,8 @@ void tst_QHash::constFind() map1.insert(1,"Mayer"); map1.insert(2,"Hej"); - QVERIFY(map1.constFind(1).value() == "Mayer"); - QVERIFY(map1.constFind(2).value() == "Hej"); + QCOMPARE(map1.constFind(1).value(), QLatin1String("Mayer")); + QCOMPARE(map1.constFind(2).value(), QLatin1String("Hej")); for(i = 3; i < 10; ++i) { compareString = testString.arg(i); @@ -706,7 +706,7 @@ void tst_QHash::take() map.insert(2, "zwei"); map.insert(3, "drei"); - QVERIFY(map.take(3) == "drei"); + QCOMPARE(map.take(3), QLatin1String("drei")); QVERIFY(!map.contains(3)); } diff --git a/tests/auto/corelib/tools/qhashfunctions/qhashfunctions.pro b/tests/auto/corelib/tools/qhashfunctions/qhashfunctions.pro index 21426a4f55..853e9f30e5 100644 --- a/tests/auto/corelib/tools/qhashfunctions/qhashfunctions.pro +++ b/tests/auto/corelib/tools/qhashfunctions/qhashfunctions.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qhashfunctions QT = core testlib SOURCES = $$PWD/tst_qhashfunctions.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qline/qline.pro b/tests/auto/corelib/tools/qline/qline.pro index 56f852ac52..c66df2cd68 100644 --- a/tests/auto/corelib/tools/qline/qline.pro +++ b/tests/auto/corelib/tools/qline/qline.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qline QT = core testlib SOURCES = tst_qline.cpp unix:!mac:!vxworks:!haiku:LIBS+=-lm -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro b/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro index 439bf03707..80630f78ad 100644 --- a/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro +++ b/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qlinkedlist QT = core testlib SOURCES = tst_qlinkedlist.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qlist/qlist.pro b/tests/auto/corelib/tools/qlist/qlist.pro index 43c06e0ee1..47f0140abb 100644 --- a/tests/auto/corelib/tools/qlist/qlist.pro +++ b/tests/auto/corelib/tools/qlist/qlist.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qlist QT = core testlib SOURCES = $$PWD/tst_qlist.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro index 8995fce52c..b61f51d53a 100644 --- a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro +++ b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro @@ -6,4 +6,3 @@ CONFIG -= app_bundle QT = core -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro index df12d35a09..e9ad1e8281 100644 --- a/tests/auto/corelib/tools/qlocale/test/test.pro +++ b/tests/auto/corelib/tools/qlocale/test/test.pro @@ -1,5 +1,4 @@ CONFIG += console testcase -CONFIG += parallel_test CONFIG -= app_bundle QT = core testlib core-private embedded: QT += gui @@ -16,5 +15,4 @@ win32 { TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 blackberry:LIBS += -lpps diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 11b6922278..6c4fc5e62b 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -370,7 +370,7 @@ void tst_QLocale::ctor() && l.country() == QLocale::exp_country, \ QString("requested: \"" + QString(req_lc) + "\", got: " \ + QLocale::languageToString(l.language()) \ - + "/" + QLocale::countryToString(l.country())).toLatin1().constData()); \ + + QLatin1Char('/') + QLocale::countryToString(l.country())).toLatin1().constData()); \ QCOMPARE(l, QLocale(QLocale::exp_lang, QLocale::exp_country)); \ QCOMPARE(qHash(l), qHash(QLocale(QLocale::exp_lang, QLocale::exp_country))); \ } @@ -431,8 +431,8 @@ void tst_QLocale::ctor() && l.country() == QLocale::exp_country, \ QString("requested: \"" + QString(req_lc) + "\", got: " \ + QLocale::languageToString(l.language()) \ - + "/" + QLocale::scriptToString(l.script()) \ - + "/" + QLocale::countryToString(l.country())).toLatin1().constData()); \ + + QLatin1Char('/') + QLocale::scriptToString(l.script()) \ + + QLatin1Char('/') + QLocale::countryToString(l.country())).toLatin1().constData()); \ } TEST_CTOR("zh_CN", Chinese, SimplifiedHanScript, China) @@ -606,7 +606,7 @@ void tst_QLocale::legacyNames() && l.country() == QLocale::exp_country, \ QString("requested: \"" + QString(req_lc) + "\", got: " \ + QLocale::languageToString(l.language()) \ - + "/" + QLocale::countryToString(l.country())).toLatin1().constData()); \ + + QLatin1Char('/') + QLocale::countryToString(l.country())).toLatin1().constData()); \ } TEST_CTOR("mo_MD", Romanian, Moldova) @@ -1277,13 +1277,13 @@ void tst_QLocale::formatTimeZone() QLocale enUS("en_US"); QDateTime dt1(QDate(2013, 1, 1), QTime(1, 0, 0), Qt::OffsetFromUTC, 60 * 60); - QCOMPARE(enUS.toString(dt1, "t"), QString("UTC+01:00")); + QCOMPARE(enUS.toString(dt1, "t"), QLatin1String("UTC+01:00")); QDateTime dt2(QDate(2013, 1, 1), QTime(1, 0, 0), Qt::OffsetFromUTC, -60 * 60); - QCOMPARE(enUS.toString(dt2, "t"), QString("UTC-01:00")); + QCOMPARE(enUS.toString(dt2, "t"), QLatin1String("UTC-01:00")); QDateTime dt3(QDate(2013, 1, 1), QTime(0, 0, 0), Qt::UTC); - QCOMPARE(enUS.toString(dt3, "t"), QString("UTC")); + QCOMPARE(enUS.toString(dt3, "t"), QLatin1String("UTC")); // LocalTime should vary if (europeanTimeZone) { @@ -1292,14 +1292,14 @@ void tst_QLocale::formatTimeZone() #ifdef Q_OS_WIN QEXPECT_FAIL("", "Windows only returns long name (QTBUG-32759)", Continue); #endif // Q_OS_WIN - QCOMPARE(enUS.toString(dt4, "t"), QString("CET")); + QCOMPARE(enUS.toString(dt4, "t"), QLatin1String("CET")); // Time definitely in Daylight Time QDateTime dt5(QDate(2013, 6, 1), QTime(0, 0, 0), Qt::LocalTime); #ifdef Q_OS_WIN QEXPECT_FAIL("", "Windows only returns long name (QTBUG-32759)", Continue); #endif // Q_OS_WIN - QCOMPARE(enUS.toString(dt5, "t"), QString("CEST")); + QCOMPARE(enUS.toString(dt5, "t"), QLatin1String("CEST")); } else { QSKIP("You must test using Central European (CET/CEST) time zone, e.g. TZ=Europe/Oslo"); } @@ -1308,13 +1308,13 @@ void tst_QLocale::formatTimeZone() #ifdef Q_OS_WIN QEXPECT_FAIL("", "QTimeZone windows backend only returns long name", Continue); #endif - QCOMPARE(enUS.toString(dt6, "t"), QString("CET")); + QCOMPARE(enUS.toString(dt6, "t"), QLatin1String("CET")); QDateTime dt7(QDate(2013, 6, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin")); #ifdef Q_OS_WIN QEXPECT_FAIL("", "QTimeZone windows backend only returns long name", Continue); #endif - QCOMPARE(enUS.toString(dt7, "t"), QString("CEST")); + QCOMPARE(enUS.toString(dt7, "t"), QLatin1String("CEST")); // Current datetime should return current abbreviation QCOMPARE(enUS.toString(QDateTime::currentDateTime(), "t"), @@ -1460,9 +1460,9 @@ void tst_QLocale::macDefaultLocale() if (timeString.contains(QString("GMT"))) { QString expectedGMTSpecifierBase("GMT"); if (diff >= 0) - expectedGMTSpecifierBase.append("+"); + expectedGMTSpecifierBase.append(QLatin1Char('+')); else - expectedGMTSpecifierBase.append("-"); + expectedGMTSpecifierBase.append(QLatin1Char('-')); QString expectedGMTSpecifier = expectedGMTSpecifierBase + QString("%1").arg(qAbs(diff)); QString expectedGMTSpecifierZeroExtended = expectedGMTSpecifierBase + QString("0%1").arg(qAbs(diff)); diff --git a/tests/auto/corelib/tools/qmap/qmap.pro b/tests/auto/corelib/tools/qmap/qmap.pro index 460b6654fb..27820a76c8 100644 --- a/tests/auto/corelib/tools/qmap/qmap.pro +++ b/tests/auto/corelib/tools/qmap/qmap.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmap QT = core testlib SOURCES = $$PWD/tst_qmap.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index bb6535b635..7cd7d7980f 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -413,24 +413,24 @@ void tst_QMap::key() QCOMPARE(map1.key(1, def), def); map1.insert("one", 1); - QCOMPARE(map1.key(1), QString("one")); - QCOMPARE(map1.key(1, def), QString("one")); + QCOMPARE(map1.key(1), QLatin1String("one")); + QCOMPARE(map1.key(1, def), QLatin1String("one")); QCOMPARE(map1.key(2), QString()); QCOMPARE(map1.key(2, def), def); map1.insert("two", 2); - QCOMPARE(map1.key(1), QString("one")); - QCOMPARE(map1.key(1, def), QString("one")); - QCOMPARE(map1.key(2), QString("two")); - QCOMPARE(map1.key(2, def), QString("two")); + QCOMPARE(map1.key(1), QLatin1String("one")); + QCOMPARE(map1.key(1, def), QLatin1String("one")); + QCOMPARE(map1.key(2), QLatin1String("two")); + QCOMPARE(map1.key(2, def), QLatin1String("two")); QCOMPARE(map1.key(3), QString()); QCOMPARE(map1.key(3, def), def); map1.insert("deux", 2); - QCOMPARE(map1.key(1), QString("one")); - QCOMPARE(map1.key(1, def), QString("one")); - QVERIFY(map1.key(2) == "deux" || map1.key(2) == "two"); - QVERIFY(map1.key(2, def) == "deux" || map1.key(2, def) == "two"); + QCOMPARE(map1.key(1), QLatin1String("one")); + QCOMPARE(map1.key(1, def), QLatin1String("one")); + QVERIFY(map1.key(2) == QLatin1String("deux") || map1.key(2) == QLatin1String("two")); + QVERIFY(map1.key(2, def) == QLatin1String("deux") || map1.key(2, def) == QLatin1String("two")); QCOMPARE(map1.key(3), QString()); QCOMPARE(map1.key(3, def), def); } @@ -608,8 +608,8 @@ void tst_QMap::find() map1.insert(1,"Mayer"); map1.insert(2,"Hej"); - QVERIFY(map1.find(1).value() == "Mayer"); - QVERIFY(map1.find(2).value() == "Hej"); + QCOMPARE(map1.find(1).value(), QLatin1String("Mayer")); + QCOMPARE(map1.find(2).value(), QLatin1String("Hej")); for(i = 3; i < 10; ++i) { compareString = testString.arg(i); @@ -643,8 +643,8 @@ void tst_QMap::constFind() QVERIFY(map1.constFind(4) == map1.constEnd()); - QVERIFY(map1.constFind(1).value() == "Mayer"); - QVERIFY(map1.constFind(2).value() == "Hej"); + QCOMPARE(map1.constFind(1).value(), QLatin1String("Mayer")); + QCOMPARE(map1.constFind(2).value(), QLatin1String("Hej")); for(i = 3; i < 10; ++i) { compareString = testString.arg(i); @@ -705,10 +705,10 @@ void tst_QMap::lowerUpperBound() QCOMPARE(map1.lowerBound(5).key(), 5); QCOMPARE(map1.lowerBound(6).key(), 7); QCOMPARE(map1.lowerBound(7).key(), 7); - QCOMPARE(map1.lowerBound(6).value(), QString("seven_2")); - QCOMPARE(map1.lowerBound(7).value(), QString("seven_2")); - QCOMPARE((++map1.lowerBound(6)).value(), QString("seven")); - QCOMPARE((++map1.lowerBound(7)).value(), QString("seven")); + QCOMPARE(map1.lowerBound(6).value(), QLatin1String("seven_2")); + QCOMPARE(map1.lowerBound(7).value(), QLatin1String("seven_2")); + QCOMPARE((++map1.lowerBound(6)).value(), QLatin1String("seven")); + QCOMPARE((++map1.lowerBound(7)).value(), QLatin1String("seven")); QCOMPARE(map1.lowerBound(10).key(), 10); QVERIFY(map1.lowerBound(999) == map1.end()); } @@ -733,11 +733,11 @@ void tst_QMap::mergeCompare() map1b.unite(map2b); sanityCheckTree(map1b, __LINE__); - QVERIFY(map1.value(1) == "ett"); - QVERIFY(map1.value(2) == "tvo"); - QVERIFY(map1.value(3) == "tre"); - QVERIFY(map1.value(4) == "fyra"); - QVERIFY(map1.value(5) == "fem"); + QCOMPARE(map1.value(1), QLatin1String("ett")); + QCOMPARE(map1.value(2), QLatin1String("tvo")); + QCOMPARE(map1.value(3), QLatin1String("tre")); + QCOMPARE(map1.value(4), QLatin1String("fyra")); + QCOMPARE(map1.value(5), QLatin1String("fem")); map3.insert(1, "ett"); map3.insert(2, "tvo"); @@ -755,7 +755,7 @@ void tst_QMap::take() map.insert(2, "zwei"); map.insert(3, "drei"); - QVERIFY(map.take(3) == "drei"); + QCOMPARE(map.take(3), QLatin1String("drei")); QVERIFY(!map.contains(3)); } @@ -771,19 +771,19 @@ void tst_QMap::iterators() //STL-Style iterators QMap<int, QString>::iterator stlIt = map.begin(); - QVERIFY(stlIt.value() == "Teststring 1"); + QCOMPARE(stlIt.value(), QLatin1String("Teststring 1")); stlIt+=5; - QVERIFY(stlIt.value() == "Teststring 6"); + QCOMPARE(stlIt.value(), QLatin1String("Teststring 6")); stlIt++; - QVERIFY(stlIt.value() == "Teststring 7"); + QCOMPARE(stlIt.value(), QLatin1String("Teststring 7")); stlIt-=3; - QVERIFY(stlIt.value() == "Teststring 4"); + QCOMPARE(stlIt.value(), QLatin1String("Teststring 4")); stlIt--; - QVERIFY(stlIt.value() == "Teststring 3"); + QCOMPARE(stlIt.value(), QLatin1String("Teststring 3")); for(stlIt = map.begin(), i = 1; stlIt != map.end(); ++stlIt, ++i) QVERIFY(stlIt.value() == testString.arg(i)); @@ -792,19 +792,19 @@ void tst_QMap::iterators() //STL-Style const-iterators QMap<int, QString>::const_iterator cstlIt = map.constBegin(); - QVERIFY(cstlIt.value() == "Teststring 1"); + QCOMPARE(cstlIt.value(), QLatin1String("Teststring 1")); cstlIt+=5; - QVERIFY(cstlIt.value() == "Teststring 6"); + QCOMPARE(cstlIt.value(), QLatin1String("Teststring 6")); cstlIt++; - QVERIFY(cstlIt.value() == "Teststring 7"); + QCOMPARE(cstlIt.value(), QLatin1String("Teststring 7")); cstlIt-=3; - QVERIFY(cstlIt.value() == "Teststring 4"); + QCOMPARE(cstlIt.value(), QLatin1String("Teststring 4")); cstlIt--; - QVERIFY(cstlIt.value() == "Teststring 3"); + QCOMPARE(cstlIt.value(), QLatin1String("Teststring 3")); for(cstlIt = map.constBegin(), i = 1; cstlIt != map.constEnd(); ++cstlIt, ++i) QVERIFY(cstlIt.value() == testString.arg(i)); diff --git a/tests/auto/corelib/tools/qmargins/qmargins.pro b/tests/auto/corelib/tools/qmargins/qmargins.pro index 25fe715edf..696f9374a2 100644 --- a/tests/auto/corelib/tools/qmargins/qmargins.pro +++ b/tests/auto/corelib/tools/qmargins/qmargins.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmargins QT = core testlib SOURCES = tst_qmargins.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro b/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro index afd0c1176d..a62b702f22 100644 --- a/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro +++ b/tests/auto/corelib/tools/qmessageauthenticationcode/qmessageauthenticationcode.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qmessageauthenticationcode QT = core testlib SOURCES = tst_qmessageauthenticationcode.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qpair/qpair.pro b/tests/auto/corelib/tools/qpair/qpair.pro index c49215cb1c..659be887d3 100644 --- a/tests/auto/corelib/tools/qpair/qpair.pro +++ b/tests/auto/corelib/tools/qpair/qpair.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qpair QT = core testlib SOURCES = tst_qpair.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qpoint/qpoint.pro b/tests/auto/corelib/tools/qpoint/qpoint.pro index 0923abbc88..8321d08fe0 100644 --- a/tests/auto/corelib/tools/qpoint/qpoint.pro +++ b/tests/auto/corelib/tools/qpoint/qpoint.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qpoint QT = core testlib SOURCES = tst_qpoint.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qpointf/qpointf.pro b/tests/auto/corelib/tools/qpointf/qpointf.pro index 1c594cd47c..5715b95d96 100644 --- a/tests/auto/corelib/tools/qpointf/qpointf.pro +++ b/tests/auto/corelib/tools/qpointf/qpointf.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qpointf QT = core testlib SOURCES = tst_qpointf.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qqueue/qqueue.pro b/tests/auto/corelib/tools/qqueue/qqueue.pro index 7b1e28baf3..55ceb65fbd 100644 --- a/tests/auto/corelib/tools/qqueue/qqueue.pro +++ b/tests/auto/corelib/tools/qqueue/qqueue.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qqueue QT = core testlib SOURCES = tst_qqueue.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qrect/qrect.pro b/tests/auto/corelib/tools/qrect/qrect.pro index 06fe15b0d6..8ec31db215 100644 --- a/tests/auto/corelib/tools/qrect/qrect.pro +++ b/tests/auto/corelib/tools/qrect/qrect.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qrect QT = core testlib SOURCES = tst_qrect.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qregexp/qregexp.pro b/tests/auto/corelib/tools/qregexp/qregexp.pro index d8f67eed25..5f6ff0a71c 100644 --- a/tests/auto/corelib/tools/qregexp/qregexp.pro +++ b/tests/auto/corelib/tools/qregexp/qregexp.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qregexp QT = core testlib SOURCES = tst_qregexp.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp index b9a3fc13c5..23259e520f 100644 --- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp +++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp @@ -880,19 +880,19 @@ void tst_QRegExp::caretAnchoredOptimization() { QString s = "---babnana----"; s.replace( QRegExp("^-*|(-*)$"), "" ); - QVERIFY(s == "babnana"); + QCOMPARE(s, QLatin1String("babnana")); s = "---babnana----"; s.replace( QRegExp("^-*|(-{0,})$"), "" ); - QVERIFY(s == "babnana"); + QCOMPARE(s, QLatin1String("babnana")); s = "---babnana----"; s.replace( QRegExp("^-*|(-{1,})$"), "" ); - QVERIFY(s == "babnana"); + QCOMPARE(s, QLatin1String("babnana")); s = "---babnana----"; s.replace( QRegExp("^-*|(-+)$"), "" ); - QVERIFY(s == "babnana"); + QCOMPARE(s, QLatin1String("babnana")); } void tst_QRegExp::isEmpty() diff --git a/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro b/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro index 3ecf16918c..a27286ff20 100644 --- a/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro +++ b/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro @@ -1,8 +1,7 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qregularexpression_alwaysoptimize QT = core testlib HEADERS = ../tst_qregularexpression.h SOURCES = \ tst_qregularexpression_alwaysoptimize.cpp \ ../tst_qregularexpression.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro b/tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro index 9e366c0f48..0b36c79c1b 100644 --- a/tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro +++ b/tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro @@ -1,8 +1,7 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qregularexpression_defaultoptimize QT = core testlib HEADERS = ../tst_qregularexpression.h SOURCES = \ tst_qregularexpression_defaultoptimize.cpp \ ../tst_qregularexpression.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro b/tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro index d34bc9b93d..1db77781dd 100644 --- a/tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro +++ b/tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qregularexpression_forceoptimize QT = core testlib HEADERS = ../tst_qregularexpression.h diff --git a/tests/auto/corelib/tools/qringbuffer/qringbuffer.pro b/tests/auto/corelib/tools/qringbuffer/qringbuffer.pro index 0618b03309..c63544035a 100644 --- a/tests/auto/corelib/tools/qringbuffer/qringbuffer.pro +++ b/tests/auto/corelib/tools/qringbuffer/qringbuffer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qringbuffer QT = core-private testlib SOURCES = tst_qringbuffer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp index 77fc6ad6ae..2695e6238c 100644 --- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp +++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp @@ -39,11 +39,11 @@ class tst_QRingBuffer : public QObject { Q_OBJECT private slots: + void constructing(); void readPointerAtPositionWriteRead(); void readPointerAtPositionEmptyRead(); void readPointerAtPositionWithHead(); void readPointerAtPositionReadTooMuch(); - void sizeWhenEmpty(); void sizeWhenReservedAndChopped(); void sizeWhenReserved(); void free(); @@ -57,6 +57,23 @@ private slots: void readLine(); }; +void tst_QRingBuffer::constructing() +{ + QRingBuffer ringBuffer; + + QCOMPARE(ringBuffer.size(), Q_INT64_C(0)); + QVERIFY(ringBuffer.isEmpty()); + QCOMPARE(ringBuffer.nextDataBlockSize(), Q_INT64_C(0)); + QVERIFY(ringBuffer.readPointer() == Q_NULLPTR); + QCOMPARE(ringBuffer.skip(5), Q_INT64_C(0)); + QCOMPARE(ringBuffer.read(), QByteArray()); + QCOMPARE(ringBuffer.getChar(), -1); + QVERIFY(!ringBuffer.canReadLine()); + + char buf[5]; + QCOMPARE(ringBuffer.peek(buf, sizeof(buf)), Q_INT64_C(0)); +} + void tst_QRingBuffer::sizeWhenReserved() { QRingBuffer ringBuffer; @@ -74,13 +91,6 @@ void tst_QRingBuffer::sizeWhenReservedAndChopped() QCOMPARE(ringBuffer.size(), Q_INT64_C(0)); } -void tst_QRingBuffer::sizeWhenEmpty() -{ - QRingBuffer ringBuffer; - - QCOMPARE(ringBuffer.size(), Q_INT64_C(0)); -} - void tst_QRingBuffer::readPointerAtPositionReadTooMuch() { QRingBuffer ringBuffer; @@ -284,7 +294,8 @@ void tst_QRingBuffer::indexOf() for (int i = 1; i < 256; ++i) { qint64 index = ringBuffer.indexOf(char(i)); QCOMPARE(index, qint64(i - 1)); - QCOMPARE(ringBuffer.indexOf(char(i), i), index); + QCOMPARE(ringBuffer.indexOf(char(i), i, i >> 1), index); + QCOMPARE(ringBuffer.indexOf(char(i), 256, i), Q_INT64_C(-1)); QCOMPARE(ringBuffer.indexOf(char(i), i - 1), -1); // test for absent char } } diff --git a/tests/auto/corelib/tools/qscopedpointer/qscopedpointer.pro b/tests/auto/corelib/tools/qscopedpointer/qscopedpointer.pro index 5fa529e175..5248ad5528 100644 --- a/tests/auto/corelib/tools/qscopedpointer/qscopedpointer.pro +++ b/tests/auto/corelib/tools/qscopedpointer/qscopedpointer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qscopedpointer QT = core testlib SOURCES = tst_qscopedpointer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qscopedvaluerollback/qscopedvaluerollback.pro b/tests/auto/corelib/tools/qscopedvaluerollback/qscopedvaluerollback.pro index f823e6284b..c9c0a029d3 100644 --- a/tests/auto/corelib/tools/qscopedvaluerollback/qscopedvaluerollback.pro +++ b/tests/auto/corelib/tools/qscopedvaluerollback/qscopedvaluerollback.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qscopedvaluerollback QT = core testlib SOURCES = tst_qscopedvaluerollback.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qset/qset.pro b/tests/auto/corelib/tools/qset/qset.pro index 8b5cdbc3f0..10ae3307d1 100644 --- a/tests/auto/corelib/tools/qset/qset.pro +++ b/tests/auto/corelib/tools/qset/qset.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qset QT = core testlib SOURCES = tst_qset.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp index fe4d81085c..f8f368f51c 100644 --- a/tests/auto/corelib/tools/qset/tst_qset.cpp +++ b/tests/auto/corelib/tools/qset/tst_qset.cpp @@ -753,7 +753,7 @@ void tst_QSet::stlMutableIterator() QSet<QString>::const_iterator k = set2.insert("foo"); i = reinterpret_cast<QSet<QString>::iterator &>(k); // #endif - QVERIFY(*i == "foo"); + QCOMPARE(*i, QLatin1String("foo")); } } diff --git a/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro b/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro index 2e8e335472..240137d563 100644 --- a/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro +++ b/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsharedpointer QT = core testlib diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 7741803224..d88a70c1e5 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -63,6 +63,7 @@ private slots: void basics(); void operators(); void swap(); + void moveSemantics(); void useOfForwardDeclared(); void memoryManagement(); void dropLastReferenceOfForwardDeclared(); @@ -411,6 +412,66 @@ void tst_QSharedPointer::swap() QVERIFY(w2.isNull()); } +void tst_QSharedPointer::moveSemantics() +{ +#ifdef Q_COMPILER_RVALUE_REFS + QSharedPointer<int> p1, p2(new int(42)), control = p2; + QVERIFY(p1 != control); + QVERIFY(p1.isNull()); + QVERIFY(p2 == control); + QVERIFY(!p2.isNull()); + QVERIFY(*p2 == 42); + + // move assignment + p1 = std::move(p2); + QVERIFY(p1 == control); + QVERIFY(!p1.isNull()); + QVERIFY(p2 != control); + QVERIFY(p2.isNull()); + QVERIFY(*p1 == 42); + + // move construction + QSharedPointer<int> p3 = std::move(p1); + QVERIFY(p1 != control); + QVERIFY(p1.isNull()); + QVERIFY(p3 == control); + QVERIFY(!p3.isNull()); + QVERIFY(*p3 == 42); + + QWeakPointer<int> w1, w2 = control; + + QVERIFY(w1.isNull()); + QVERIFY(!w2.isNull()); + QVERIFY(w2.lock() == control); + QVERIFY(!w1.lock()); + + // move assignment + w1 = std::move(w2); + QVERIFY(w2.isNull()); + QVERIFY(!w1.isNull()); + QVERIFY(w1.lock() == control); + QVERIFY(!w2.lock()); + + // move construction + QWeakPointer<int> w3 = std::move(w1); + QVERIFY(w1.isNull()); + QVERIFY(!w3.isNull()); + QVERIFY(w3.lock() == control); + QVERIFY(!w1.lock()); + + p1.reset(); + p2.reset(); + p3.reset(); + control.reset(); + + QVERIFY(w1.isNull()); + QVERIFY(w2.isNull()); + QVERIFY(w3.isNull()); +#else + QSKIP("This test requires C++11 rvalue/move semantics support in the compiler."); +#endif +} + void tst_QSharedPointer::useOfForwardDeclared() { // this just a compile test: use the forward-declared class diff --git a/tests/auto/corelib/tools/qsize/qsize.pro b/tests/auto/corelib/tools/qsize/qsize.pro index 310194ad12..9462e98e49 100644 --- a/tests/auto/corelib/tools/qsize/qsize.pro +++ b/tests/auto/corelib/tools/qsize/qsize.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qsize QT = core testlib SOURCES = tst_qsize.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qsizef/qsizef.pro b/tests/auto/corelib/tools/qsizef/qsizef.pro index c456e450fd..f5ba220b06 100644 --- a/tests/auto/corelib/tools/qsizef/qsizef.pro +++ b/tests/auto/corelib/tools/qsizef/qsizef.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qsizef QT = core testlib SOURCES = tst_qsizef.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstl/qstl.pro b/tests/auto/corelib/tools/qstl/qstl.pro index 88fb53c6c6..e57e62b828 100644 --- a/tests/auto/corelib/tools/qstl/qstl.pro +++ b/tests/auto/corelib/tools/qstl/qstl.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstl QT = core testlib SOURCES = tst_qstl.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstring/qstring.pro b/tests/auto/corelib/tools/qstring/qstring.pro index 1eda27e1ff..a3ac7bc867 100644 --- a/tests/auto/corelib/tools/qstring/qstring.pro +++ b/tests/auto/corelib/tools/qstring/qstring.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstring QT = core testlib SOURCES = tst_qstring.cpp diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 10747427c7..124829a11c 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -969,61 +969,61 @@ void tst_QString::acc_01() QString f; f = e; f[7]='F'; - QCOMPARE(e,(QString)"String E"); + QCOMPARE(e, QLatin1String("String E")); char text[]="String f"; f = text; text[7]='!'; - QCOMPARE(f,(QString)"String f"); + QCOMPARE(f, QLatin1String("String f")); f[7]='F'; QCOMPARE(text[7],'!'); a=""; a[0]='A'; - QCOMPARE(a,(QString)"A"); + QCOMPARE(a, QLatin1String("A")); QCOMPARE(a.length(),1); a[1]='B'; - QCOMPARE(a,(QString)"AB"); + QCOMPARE(a, QLatin1String("AB")); QCOMPARE(a.length(),2); a[2]='C'; - QCOMPARE(a,(QString)"ABC"); + QCOMPARE(a, QLatin1String("ABC")); QCOMPARE(a.length(),3); a = QString(); QVERIFY(a.isNull()); a[0]='A'; - QCOMPARE(a,(QString)"A"); + QCOMPARE(a, QLatin1String("A")); QCOMPARE(a.length(),1); a[1]='B'; - QCOMPARE(a,(QString)"AB"); + QCOMPARE(a, QLatin1String("AB")); QCOMPARE(a.length(),2); a[2]='C'; - QCOMPARE(a,(QString)"ABC"); + QCOMPARE(a, QLatin1String("ABC")); QCOMPARE(a.length(),3); a="123"; b="456"; a[0]=a[1]; - QCOMPARE(a,(QString)"223"); + QCOMPARE(a, QLatin1String("223")); a[1]=b[1]; - QCOMPARE(b,(QString)"456"); - QCOMPARE(a,(QString)"253"); + QCOMPARE(b, QLatin1String("456")); + QCOMPARE(a, QLatin1String("253")); char t[]="TEXT"; a="A"; a=t; - QCOMPARE(a,(QString)"TEXT"); + QCOMPARE(a, QLatin1String("TEXT")); QCOMPARE(a,(QString)t); a[0]='X'; - QCOMPARE(a,(QString)"XEXT"); + QCOMPARE(a, QLatin1String("XEXT")); QCOMPARE(t[0],'T'); t[0]='Z'; - QCOMPARE(a,(QString)"XEXT"); + QCOMPARE(a, QLatin1String("XEXT")); a="ABC"; QCOMPARE(char(a.toLatin1()[1]),'B'); - QCOMPARE(strcmp(a.toLatin1(),((QString)"ABC").toLatin1()),0); - QCOMPARE(a+="DEF",(QString)"ABCDEF"); - QCOMPARE(a+='G',(QString)"ABCDEFG"); - QCOMPARE(a+=((const char*)(0)),(QString)"ABCDEFG"); + QCOMPARE(strcmp(a.toLatin1(), QByteArrayLiteral("ABC")), 0); + QCOMPARE(a+="DEF", QLatin1String("ABCDEF")); + QCOMPARE(a+='G', QLatin1String("ABCDEFG")); + QCOMPARE(a+=((const char*)(0)), QLatin1String("ABCDEFG")); // non-member operators @@ -1045,11 +1045,11 @@ void tst_QString::acc_01() QVERIFY(a<=c); QVERIFY(!(c<=a)); QVERIFY(!(d<=a)); - QCOMPARE(QString(a+b),(QString)"ABCABC"); - QCOMPARE(QString(a+"XXXX"),(QString)"ABCXXXX"); - QCOMPARE(QString(a+'X'),(QString)"ABCX"); - QCOMPARE(QString("XXXX"+a),(QString)"XXXXABC"); - QCOMPARE(QString('X'+a),(QString)"XABC"); + QCOMPARE(QString(a+b), QLatin1String("ABCABC")); + QCOMPARE(QString(a+"XXXX"), QLatin1String("ABCXXXX")); + QCOMPARE(QString(a+'X'), QLatin1String("ABCX")); + QCOMPARE(QString("XXXX"+a), QLatin1String("XXXXABC")); + QCOMPARE(QString('X'+a), QLatin1String("XABC")); a = (const char*)0; QVERIFY(a.isNull()); QVERIFY(*a.toLatin1().constData() == '\0'); @@ -1115,7 +1115,7 @@ void tst_QString::constructor() QVERIFY(a == (QString)""); QCOMPARE(b,cb); QCOMPARE(c,cc); - QCOMPARE(d,(QString)"String D"); + QCOMPARE(d, QLatin1String("String D")); QString nullStr; QVERIFY( nullStr.isNull() ); @@ -1204,11 +1204,11 @@ void tst_QString::truncate() { QString e("String E"); e.truncate(4); - QCOMPARE(e,(QString)"Stri"); + QCOMPARE(e, QLatin1String("Stri")); e = "String E"; e.truncate(0); - QCOMPARE(e,(QString)""); + QCOMPARE(e, QLatin1String("")); QVERIFY(e.isEmpty()); QVERIFY(!e.isNull()); @@ -1218,25 +1218,25 @@ void tst_QString::fill() { QString e; e.fill('e',1); - QCOMPARE(e,(QString)"e"); + QCOMPARE(e, QLatin1String("e")); QString f; f.fill('f',3); - QCOMPARE(f,(QString)"fff"); + QCOMPARE(f, QLatin1String("fff")); f.fill('F'); - QCOMPARE(f,(QString)"FFF"); + QCOMPARE(f, QLatin1String("FFF")); } void tst_QString::sprintf() { QString a; a.sprintf("COMPARE"); - QCOMPARE(a,(QString)"COMPARE"); + QCOMPARE(a, QLatin1String("COMPARE")); a.sprintf("%%%d",1); - QCOMPARE(a,(QString)"%1"); - QCOMPARE(a.sprintf("X%dY",2),(QString)"X2Y"); - QCOMPARE(a.sprintf("X%9iY", 50000 ),(QString)"X 50000Y"); - QCOMPARE(a.sprintf("X%-9sY","hello"),(QString)"Xhello Y"); - QCOMPARE(a.sprintf("X%-9iY", 50000 ),(QString)"X50000 Y"); + QCOMPARE(a, QLatin1String("%1")); + QCOMPARE(a.sprintf("X%dY",2), QLatin1String("X2Y")); + QCOMPARE(a.sprintf("X%9iY", 50000 ), QLatin1String("X 50000Y")); + QCOMPARE(a.sprintf("X%-9sY","hello"), QLatin1String("Xhello Y")); + QCOMPARE(a.sprintf("X%-9iY", 50000 ), QLatin1String("X50000 Y")); QCOMPARE(a.sprintf("%lf", 1.23), QString("1.230000")); QCOMPARE(a.sprintf("%lf", 1.23456789), QString("1.234568")); QCOMPARE(a.sprintf("%p", (void *)0xbfffd350), QString("0xbfffd350")); @@ -1253,13 +1253,13 @@ void tst_QString::sprintf() S1.sprintf("%f",d); QCOMPARE(S1, QString("-514.256830")); - QCOMPARE(a.sprintf("%.3s", "Hello" ),(QString)"Hel"); - QCOMPARE(a.sprintf("%10.3s", "Hello" ),(QString)" Hel"); - QCOMPARE(a.sprintf("%.10s", "Hello" ),(QString)"Hello"); - QCOMPARE(a.sprintf("%10.10s", "Hello" ),(QString)" Hello"); - QCOMPARE(a.sprintf("%-10.10s", "Hello" ),(QString)"Hello "); - QCOMPARE(a.sprintf("%-10.3s", "Hello" ),(QString)"Hel "); - QCOMPARE(a.sprintf("%-5.5s", "Hello" ),(QString)"Hello"); + QCOMPARE(a.sprintf("%.3s", "Hello" ), QLatin1String("Hel")); + QCOMPARE(a.sprintf("%10.3s", "Hello" ), QLatin1String(" Hel")); + QCOMPARE(a.sprintf("%.10s", "Hello" ), QLatin1String("Hello")); + QCOMPARE(a.sprintf("%10.10s", "Hello" ), QLatin1String(" Hello")); + QCOMPARE(a.sprintf("%-10.10s", "Hello" ), QLatin1String("Hello ")); + QCOMPARE(a.sprintf("%-10.3s", "Hello" ), QLatin1String("Hel ")); + QCOMPARE(a.sprintf("%-5.5s", "Hello" ), QLatin1String("Hello")); // Check utf8 conversion for %s QCOMPARE(a.sprintf("%s", "\303\266\303\244\303\274\303\226\303\204\303\234\303\270\303\246\303\245\303\230\303\206\303\205"), QString::fromLatin1("\366\344\374\326\304\334\370\346\345\330\306\305")); @@ -1362,7 +1362,7 @@ void tst_QString::indexOf_data() QString s2; s2 += QChar(0x3bc); QTest::newRow( "data58" ) << s1 << s2 << 0 << false << 3; - s2.prepend("C"); + s2.prepend(QLatin1Char('C')); QTest::newRow( "data59" ) << s1 << s2 << 0 << false << 2; QString veryBigHaystack(500, 'a'); @@ -1809,9 +1809,9 @@ void tst_QString::left() { QString a; a="ABCDEFGHIEfGEFG"; // 15 chars - QCOMPARE(a.left(3),(QString)"ABC"); + QCOMPARE(a.left(3), QLatin1String("ABC")); QVERIFY(!a.left(0).isNull()); - QCOMPARE(a.left(0),(QString)""); + QCOMPARE(a.left(0), QLatin1String("")); QString n; QVERIFY(n.left(3).isNull()); @@ -1827,10 +1827,10 @@ void tst_QString::leftRef() { QString a; a="ABCDEFGHIEfGEFG"; // 15 chars - QCOMPARE(a.leftRef(3).toString(),(QString)"ABC"); + QCOMPARE(a.leftRef(3).toString(), QLatin1String("ABC")); QVERIFY(a.leftRef(0).toString().isEmpty()); - QCOMPARE(a.leftRef(0).toString(),(QString)""); + QCOMPARE(a.leftRef(0).toString(), QLatin1String("")); QString n; QVERIFY(n.leftRef(3).toString().isEmpty()); @@ -1846,8 +1846,8 @@ void tst_QString::right() { QString a; a="ABCDEFGHIEfGEFG"; // 15 chars - QCOMPARE(a.right(3),(QString)"EFG"); - QCOMPARE(a.right(0),(QString)""); + QCOMPARE(a.right(3), QLatin1String("EFG")); + QCOMPARE(a.right(0), QLatin1String("")); QString n; QVERIFY(n.right(3).isNull()); @@ -1862,8 +1862,8 @@ void tst_QString::rightRef() { QString a; a="ABCDEFGHIEfGEFG"; // 15 chars - QCOMPARE(a.rightRef(3).toString(),(QString)"EFG"); - QCOMPARE(a.rightRef(0).toString(),(QString)""); + QCOMPARE(a.rightRef(3).toString(), QLatin1String("EFG")); + QCOMPARE(a.rightRef(0).toString(), QLatin1String("")); QString n; QVERIFY(n.rightRef(3).toString().isEmpty()); @@ -1879,8 +1879,8 @@ void tst_QString::mid() QString a; a="ABCDEFGHIEfGEFG"; // 15 chars - QCOMPARE(a.mid(3,3),(QString)"DEF"); - QCOMPARE(a.mid(0,0),(QString)""); + QCOMPARE(a.mid(3,3), QLatin1String("DEF")); + QCOMPARE(a.mid(0,0), QLatin1String("")); QVERIFY(!a.mid(15,0).isNull()); QVERIFY(a.mid(15,0).isEmpty()); QVERIFY(!a.mid(15,1).isNull()); @@ -1958,8 +1958,8 @@ void tst_QString::midRef() QString a; a="ABCDEFGHIEfGEFG"; // 15 chars - QCOMPARE(a.midRef(3,3).toString(),(QString)"DEF"); - QCOMPARE(a.midRef(0,0).toString(),(QString)""); + QCOMPARE(a.midRef(3,3).toString(), QLatin1String("DEF")); + QCOMPARE(a.midRef(0,0).toString(), QLatin1String("")); QVERIFY(!a.midRef(15,0).toString().isNull()); QVERIFY(a.midRef(15,0).toString().isEmpty()); QVERIFY(!a.midRef(15,1).toString().isNull()); @@ -2083,44 +2083,44 @@ void tst_QString::leftJustified() { QString a; a="ABC"; - QCOMPARE(a.leftJustified(5,'-'),(QString)"ABC--"); - QCOMPARE(a.leftJustified(4,'-'),(QString)"ABC-"); - QCOMPARE(a.leftJustified(4),(QString)"ABC "); - QCOMPARE(a.leftJustified(3),(QString)"ABC"); - QCOMPARE(a.leftJustified(2),(QString)"ABC"); - QCOMPARE(a.leftJustified(1),(QString)"ABC"); - QCOMPARE(a.leftJustified(0),(QString)"ABC"); + QCOMPARE(a.leftJustified(5,'-'), QLatin1String("ABC--")); + QCOMPARE(a.leftJustified(4,'-'), QLatin1String("ABC-")); + QCOMPARE(a.leftJustified(4), QLatin1String("ABC ")); + QCOMPARE(a.leftJustified(3), QLatin1String("ABC")); + QCOMPARE(a.leftJustified(2), QLatin1String("ABC")); + QCOMPARE(a.leftJustified(1), QLatin1String("ABC")); + QCOMPARE(a.leftJustified(0), QLatin1String("ABC")); QString n; QVERIFY(!n.leftJustified(3).isNull()); - QCOMPARE(a.leftJustified(4,' ',true),(QString)"ABC "); - QCOMPARE(a.leftJustified(3,' ',true),(QString)"ABC"); - QCOMPARE(a.leftJustified(2,' ',true),(QString)"AB"); - QCOMPARE(a.leftJustified(1,' ',true),(QString)"A"); - QCOMPARE(a.leftJustified(0,' ',true),(QString)""); + QCOMPARE(a.leftJustified(4,' ',true), QLatin1String("ABC ")); + QCOMPARE(a.leftJustified(3,' ',true), QLatin1String("ABC")); + QCOMPARE(a.leftJustified(2,' ',true), QLatin1String("AB")); + QCOMPARE(a.leftJustified(1,' ',true), QLatin1String("A")); + QCOMPARE(a.leftJustified(0,' ',true), QLatin1String("")); } void tst_QString::rightJustified() { QString a; a="ABC"; - QCOMPARE(a.rightJustified(5,'-'),(QString)"--ABC"); - QCOMPARE(a.rightJustified(4,'-'),(QString)"-ABC"); - QCOMPARE(a.rightJustified(4),(QString)" ABC"); - QCOMPARE(a.rightJustified(3),(QString)"ABC"); - QCOMPARE(a.rightJustified(2),(QString)"ABC"); - QCOMPARE(a.rightJustified(1),(QString)"ABC"); - QCOMPARE(a.rightJustified(0),(QString)"ABC"); + QCOMPARE(a.rightJustified(5,'-'), QLatin1String("--ABC")); + QCOMPARE(a.rightJustified(4,'-'), QLatin1String("-ABC")); + QCOMPARE(a.rightJustified(4), QLatin1String(" ABC")); + QCOMPARE(a.rightJustified(3), QLatin1String("ABC")); + QCOMPARE(a.rightJustified(2), QLatin1String("ABC")); + QCOMPARE(a.rightJustified(1), QLatin1String("ABC")); + QCOMPARE(a.rightJustified(0), QLatin1String("ABC")); QString n; QVERIFY(!n.rightJustified(3).isNull()); - QCOMPARE(a.rightJustified(4,'-',true),(QString)"-ABC"); - QCOMPARE(a.rightJustified(4,' ',true),(QString)" ABC"); - QCOMPARE(a.rightJustified(3,' ',true),(QString)"ABC"); - QCOMPARE(a.rightJustified(2,' ',true),(QString)"AB"); - QCOMPARE(a.rightJustified(1,' ',true),(QString)"A"); - QCOMPARE(a.rightJustified(0,' ',true),(QString)""); - QCOMPARE(a,(QString)"ABC"); + QCOMPARE(a.rightJustified(4,'-',true), QLatin1String("-ABC")); + QCOMPARE(a.rightJustified(4,' ',true), QLatin1String(" ABC")); + QCOMPARE(a.rightJustified(3,' ',true), QLatin1String("ABC")); + QCOMPARE(a.rightJustified(2,' ',true), QLatin1String("AB")); + QCOMPARE(a.rightJustified(1,' ',true), QLatin1String("A")); + QCOMPARE(a.rightJustified(0,' ',true), QLatin1String("")); + QCOMPARE(a, QLatin1String("ABC")); } void tst_QString::toUpper() @@ -2302,21 +2302,21 @@ void tst_QString::trimmed() { QString a; a="Text"; - QCOMPARE(a,(QString)"Text"); - QCOMPARE(a.trimmed(),(QString)"Text"); - QCOMPARE(a,(QString)"Text"); + QCOMPARE(a, QLatin1String("Text")); + QCOMPARE(a.trimmed(), QLatin1String("Text")); + QCOMPARE(a, QLatin1String("Text")); a=" "; - QCOMPARE(a.trimmed(),(QString)""); - QCOMPARE(a,(QString)" "); + QCOMPARE(a.trimmed(), QLatin1String("")); + QCOMPARE(a, QLatin1String(" ")); a=" a "; - QCOMPARE(a.trimmed(),(QString)"a"); + QCOMPARE(a.trimmed(), QLatin1String("a")); a="Text"; - QCOMPARE(qMove(a).trimmed(),(QString)"Text"); + QCOMPARE(qMove(a).trimmed(), QLatin1String("Text")); a=" "; - QCOMPARE(qMove(a).trimmed(),(QString)""); + QCOMPARE(qMove(a).trimmed(), QLatin1String("")); a=" a "; - QCOMPARE(qMove(a).trimmed(),(QString)"a"); + QCOMPARE(qMove(a).trimmed(), QLatin1String("a")); } void tst_QString::simplified_data() @@ -2442,12 +2442,13 @@ void tst_QString::insert_special_cases() QCOMPARE(a.insert(1,'>'), QString("<>ABCABCABCABC")); a = "Meal"; - QCOMPARE(a.insert(1, QLatin1String("ontr")), QString("Montreal")); - QCOMPARE(a.insert(4, ""), QString("Montreal")); - QCOMPARE(a.insert(3, QLatin1String("")), QString("Montreal")); - QCOMPARE(a.insert(3, QLatin1String(0)), QString("Montreal")); - QCOMPARE(a.insert(3, static_cast<const char *>(0)), QString("Montreal")); - QCOMPARE(a.insert(0, QLatin1String("a")), QString("aMontreal")); + const QString montreal = QStringLiteral("Montreal"); + QCOMPARE(a.insert(1, QLatin1String("ontr")), montreal); + QCOMPARE(a.insert(4, ""), montreal); + QCOMPARE(a.insert(3, QLatin1String("")), montreal); + QCOMPARE(a.insert(3, QLatin1String(0)), montreal); + QCOMPARE(a.insert(3, static_cast<const char *>(0)), montreal); + QCOMPARE(a.insert(0, QLatin1String("a")), QLatin1String("aMontreal")); } void tst_QString::append_data(bool emptyIsNoop) @@ -3558,12 +3559,12 @@ void tst_QString::toDouble() void tst_QString::setNum() { QString a; - QCOMPARE(a.setNum(123),(QString)"123"); - QCOMPARE(a.setNum(-123),(QString)"-123"); - QCOMPARE(a.setNum(0x123,16),(QString)"123"); - QCOMPARE(a.setNum((short)123),(QString)"123"); - QCOMPARE(a.setNum(123L),(QString)"123"); - QCOMPARE(a.setNum(123UL),(QString)"123"); + QCOMPARE(a.setNum(123), QLatin1String("123")); + QCOMPARE(a.setNum(-123), QLatin1String("-123")); + QCOMPARE(a.setNum(0x123,16), QLatin1String("123")); + QCOMPARE(a.setNum((short)123), QLatin1String("123")); + QCOMPARE(a.setNum(123L), QLatin1String("123")); + QCOMPARE(a.setNum(123UL), QLatin1String("123")); QCOMPARE(a.setNum(2147483647L), QString("2147483647")); // 32 bit LONG_MAX QCOMPARE(a.setNum(-2147483647L), QString("-2147483647")); // LONG_MIN + 1 QCOMPARE(a.setNum(-2147483647L-1L), QString("-2147483648")); // LONG_MIN @@ -3820,7 +3821,7 @@ void tst_QString::check_QDataStream() { QDataStream in(&ar,QIODevice::ReadOnly); in >> a; - QCOMPARE(a,(QString)"COMPARE Text"); + QCOMPARE(a, QLatin1String("COMPARE Text")); } } @@ -3835,7 +3836,7 @@ void tst_QString::check_QTextStream() { QTextStream in(&ar,QIODevice::ReadOnly); in >> a; - QCOMPARE(a,(QString)"This"); + QCOMPARE(a, QLatin1String("This")); } } @@ -4528,100 +4529,100 @@ void tst_QString::arg() QString s13( "%1% %x%c%2 %d%2-%" ); QString s14( "%1%2%3" ); - QCOMPARE( s4.arg("foo"), QString("[foo]") ); - QCOMPARE( s5.arg("foo"), QString("[foo]") ); - QCOMPARE( s6.arg("foo"), QString("[foo]") ); - QCOMPARE( s7.arg("foo"), QString("[foo]") ); - QCOMPARE( s8.arg("foo"), QString("[foo %1]") ); - QCOMPARE( s8.arg("foo").arg("bar"), QString("[foo bar]") ); - QCOMPARE( s8.arg("foo", "bar"), QString("[foo bar]") ); - QCOMPARE( s9.arg("foo"), QString("[foo %3]") ); - QCOMPARE( s9.arg("foo").arg("bar"), QString("[foo bar]") ); - QCOMPARE( s9.arg("foo", "bar"), QString("[foo bar]") ); - QCOMPARE( s10.arg("foo"), QString("[foo %2 %3]") ); - QCOMPARE( s10.arg("foo").arg("bar"), QString("[foo bar %3]") ); - QCOMPARE( s10.arg("foo", "bar"), QString("[foo bar %3]") ); - QCOMPARE( s10.arg("foo").arg("bar").arg("baz"), QString("[foo bar baz]") ); - QCOMPARE( s10.arg("foo", "bar", "baz"), QString("[foo bar baz]") ); - QCOMPARE( s11.arg("foo"), QString("[%9 %3 foo]") ); - QCOMPARE( s11.arg("foo").arg("bar"), QString("[%9 bar foo]") ); - QCOMPARE( s11.arg("foo", "bar"), QString("[%9 bar foo]") ); - QCOMPARE( s11.arg("foo").arg("bar").arg("baz"), QString("[baz bar foo]") ); - QCOMPARE( s11.arg("foo", "bar", "baz"), QString("[baz bar foo]") ); + QCOMPARE( s4.arg("foo"), QLatin1String("[foo]") ); + QCOMPARE( s5.arg("foo"), QLatin1String("[foo]") ); + QCOMPARE( s6.arg("foo"), QLatin1String("[foo]") ); + QCOMPARE( s7.arg("foo"), QLatin1String("[foo]") ); + QCOMPARE( s8.arg("foo"), QLatin1String("[foo %1]") ); + QCOMPARE( s8.arg("foo").arg("bar"), QLatin1String("[foo bar]") ); + QCOMPARE( s8.arg("foo", "bar"), QLatin1String("[foo bar]") ); + QCOMPARE( s9.arg("foo"), QLatin1String("[foo %3]") ); + QCOMPARE( s9.arg("foo").arg("bar"), QLatin1String("[foo bar]") ); + QCOMPARE( s9.arg("foo", "bar"), QLatin1String("[foo bar]") ); + QCOMPARE( s10.arg("foo"), QLatin1String("[foo %2 %3]") ); + QCOMPARE( s10.arg("foo").arg("bar"), QLatin1String("[foo bar %3]") ); + QCOMPARE( s10.arg("foo", "bar"), QLatin1String("[foo bar %3]") ); + QCOMPARE( s10.arg("foo").arg("bar").arg("baz"), QLatin1String("[foo bar baz]") ); + QCOMPARE( s10.arg("foo", "bar", "baz"), QLatin1String("[foo bar baz]") ); + QCOMPARE( s11.arg("foo"), QLatin1String("[%9 %3 foo]") ); + QCOMPARE( s11.arg("foo").arg("bar"), QLatin1String("[%9 bar foo]") ); + QCOMPARE( s11.arg("foo", "bar"), QLatin1String("[%9 bar foo]") ); + QCOMPARE( s11.arg("foo").arg("bar").arg("baz"), QLatin1String("[baz bar foo]") ); + QCOMPARE( s11.arg("foo", "bar", "baz"), QLatin1String("[baz bar foo]") ); QCOMPARE( s12.arg("a").arg("b").arg("c").arg("d").arg("e"), - QString("[e b c e a d]") ); - QCOMPARE( s12.arg("a", "b", "c", "d").arg("e"), QString("[e b c e a d]") ); - QCOMPARE( s12.arg("a").arg("b", "c", "d", "e"), QString("[e b c e a d]") ); + QLatin1String("[e b c e a d]") ); + QCOMPARE( s12.arg("a", "b", "c", "d").arg("e"), QLatin1String("[e b c e a d]") ); + QCOMPARE( s12.arg("a").arg("b", "c", "d", "e"), QLatin1String("[e b c e a d]") ); QCOMPARE( s13.arg("alpha").arg("beta"), - QString("alpha% %x%cbeta %dbeta-%") ); - QCOMPARE( s13.arg("alpha", "beta"), QString("alpha% %x%cbeta %dbeta-%") ); - QCOMPARE( s14.arg("a", "b", "c"), QString("abc") ); - QCOMPARE( s8.arg("%1").arg("foo"), QString("[foo foo]") ); - QCOMPARE( s8.arg("%1", "foo"), QString("[%1 foo]") ); - QCOMPARE( s4.arg("foo", 2), QString("[foo]") ); - QCOMPARE( s4.arg("foo", -2), QString("[foo]") ); - QCOMPARE( s4.arg("foo", 10), QString("[ foo]") ); - QCOMPARE( s4.arg("foo", -10), QString("[foo ]") ); + QLatin1String("alpha% %x%cbeta %dbeta-%") ); + QCOMPARE( s13.arg("alpha", "beta"), QLatin1String("alpha% %x%cbeta %dbeta-%") ); + QCOMPARE( s14.arg("a", "b", "c"), QLatin1String("abc") ); + QCOMPARE( s8.arg("%1").arg("foo"), QLatin1String("[foo foo]") ); + QCOMPARE( s8.arg("%1", "foo"), QLatin1String("[%1 foo]") ); + QCOMPARE( s4.arg("foo", 2), QLatin1String("[foo]") ); + QCOMPARE( s4.arg("foo", -2), QLatin1String("[foo]") ); + QCOMPARE( s4.arg("foo", 10), QLatin1String("[ foo]") ); + QCOMPARE( s4.arg("foo", -10), QLatin1String("[foo ]") ); QString firstName( "James" ); QString lastName( "Bond" ); QString fullName = QString( "My name is %2, %1 %2" ) .arg( firstName ).arg( lastName ); - QCOMPARE( fullName, QString("My name is Bond, James Bond") ); + QCOMPARE( fullName, QLatin1String("My name is Bond, James Bond") ); // number overloads - QCOMPARE( s4.arg(0), QString("[0]") ); - QCOMPARE( s4.arg(-1), QString("[-1]") ); - QCOMPARE( s4.arg(4294967295UL), QString("[4294967295]") ); // ULONG_MAX 32 + QCOMPARE( s4.arg(0), QLatin1String("[0]") ); + QCOMPARE( s4.arg(-1), QLatin1String("[-1]") ); + QCOMPARE( s4.arg(4294967295UL), QLatin1String("[4294967295]") ); // ULONG_MAX 32 QCOMPARE( s4.arg(Q_INT64_C(9223372036854775807)), // LLONG_MAX - QString("[9223372036854775807]") ); + QLatin1String("[9223372036854775807]") ); QTest::ignoreMessage(QtWarningMsg, "QString::arg: Argument missing: \"\" , 0"); QCOMPARE( QString().arg(0), QString() ); QTest::ignoreMessage(QtWarningMsg, "QString::arg: Argument missing: \"\" , 0"); QCOMPARE( QString("").arg(0), QString("") ); QTest::ignoreMessage(QtWarningMsg, "QString::arg: Argument missing: \" \" , 0"); - QCOMPARE( QString(" ").arg(0), QString(" ") ); + QCOMPARE( QString(" ").arg(0), QLatin1String(" ") ); QTest::ignoreMessage(QtWarningMsg, "QString::arg: Argument missing: \"%\" , 0"); - QCOMPARE( QString("%").arg(0), QString("%") ); + QCOMPARE( QString("%").arg(0), QLatin1String("%") ); QTest::ignoreMessage(QtWarningMsg, "QString::arg: Argument missing: \"%%\" , 0"); - QCOMPARE( QString("%%").arg(0), QString("%%") ); + QCOMPARE( QString("%%").arg(0), QLatin1String("%%") ); QTest::ignoreMessage(QtWarningMsg, "QString::arg: Argument missing: \"%%%\" , 0"); - QCOMPARE( QString("%%%").arg(0), QString("%%%") ); - QCOMPARE( QString("%%%1%%%2").arg("foo").arg("bar"), QString("%%foo%%bar") ); - - QCOMPARE( QString("%1").arg("hello", -10), QString("hello ") ); - QCOMPARE( QString("%1").arg("hello", -5), QString("hello") ); - QCOMPARE( QString("%1").arg("hello", -2), QString("hello") ); - QCOMPARE( QString("%1").arg("hello", 0), QString("hello") ); - QCOMPARE( QString("%1").arg("hello", 2), QString("hello") ); - QCOMPARE( QString("%1").arg("hello", 5), QString("hello") ); - QCOMPARE( QString("%1").arg("hello", 10), QString(" hello") ); - QCOMPARE( QString("%1%1").arg("hello"), QString("hellohello") ); - QCOMPARE( QString("%2%1").arg("hello"), QString("%2hello") ); - QCOMPARE( QString("%1%1").arg(QString::null), QString("") ); - QCOMPARE( QString("%2%1").arg(""), QString("%2") ); + QCOMPARE( QString("%%%").arg(0), QLatin1String("%%%") ); + QCOMPARE( QString("%%%1%%%2").arg("foo").arg("bar"), QLatin1String("%%foo%%bar") ); + + QCOMPARE( QString("%1").arg("hello", -10), QLatin1String("hello ") ); + QCOMPARE( QString("%1").arg("hello", -5), QLatin1String("hello") ); + QCOMPARE( QString("%1").arg("hello", -2), QLatin1String("hello") ); + QCOMPARE( QString("%1").arg("hello", 0), QLatin1String("hello") ); + QCOMPARE( QString("%1").arg("hello", 2), QLatin1String("hello") ); + QCOMPARE( QString("%1").arg("hello", 5), QLatin1String("hello") ); + QCOMPARE( QString("%1").arg("hello", 10), QLatin1String(" hello") ); + QCOMPARE( QString("%1%1").arg("hello"), QLatin1String("hellohello") ); + QCOMPARE( QString("%2%1").arg("hello"), QLatin1String("%2hello") ); + QCOMPARE( QString("%1%1").arg(QString::null), QLatin1String("") ); + QCOMPARE( QString("%2%1").arg(""), QLatin1String("%2") ); QCOMPARE( QString("%2 %L1").arg(12345.6789).arg(12345.6789), - QString("12345.7 12.345,7") ); + QLatin1String("12345.7 12.345,7") ); QCOMPARE( QString("[%2] [%L1]").arg(12345.6789, 9).arg(12345.6789, 9), - QString("[ 12345.7] [ 12.345,7]") ); + QLatin1String("[ 12345.7] [ 12.345,7]") ); QCOMPARE( QString("[%2] [%L1]").arg(12345.6789, 9, 'g', 7).arg(12345.6789, 9, 'g', 7), - QString("[ 12345.68] [12.345,68]") ); + QLatin1String("[ 12345.68] [12.345,68]") ); QCOMPARE( QString("[%2] [%L1]").arg(12345.6789, 10, 'g', 7, QLatin1Char('0')).arg(12345.6789, 10, 'g', 7, QLatin1Char('0')), - QString("[0012345.68] [012.345,68]") ); + QLatin1String("[0012345.68] [012.345,68]") ); QCOMPARE( QString("%2 %L1").arg(123456789).arg(123456789), - QString("123456789 123.456.789") ); + QLatin1String("123456789 123.456.789") ); QCOMPARE( QString("[%2] [%L1]").arg(123456789, 12).arg(123456789, 12), - QString("[ 123456789] [ 123.456.789]") ); + QLatin1String("[ 123456789] [ 123.456.789]") ); QCOMPARE( QString("[%2] [%L1]").arg(123456789, 13, 10, QLatin1Char('0')).arg(123456789, 12, 10, QLatin1Char('0')), - QString("[000123456789] [00123.456.789]") ); + QLatin1String("[000123456789] [00123.456.789]") ); QCOMPARE( QString("[%2] [%L1]").arg(123456789, 13, 16, QLatin1Char('0')).arg(123456789, 12, 16, QLatin1Char('0')), - QString("[0000075bcd15] [00000075bcd15]") ); + QLatin1String("[0000075bcd15] [00000075bcd15]") ); QCOMPARE( QString("%L2 %L1 %3").arg(12345.7).arg(123456789).arg('c'), - QString("123.456.789 12.345,7 c") ); + QLatin1String("123.456.789 12.345,7 c") ); // multi-digit replacement QString input("%%%L0 %1 %02 %3 %4 %5 %L6 %7 %8 %%% %090 %10 %11 %L12 %14 %L9888 %9999 %%%%%%%L"); @@ -4631,36 +4632,36 @@ void tst_QString::arg() .arg("k").arg("l").arg("m") .arg("n").arg("o").arg("p"); - QCOMPARE(input, QString("%%A B C D E f g h i %%% j0 k l m n o88 p99 %%%%%%%L")); + QCOMPARE(input, QLatin1String("%%A B C D E f g h i %%% j0 k l m n o88 p99 %%%%%%%L")); QString str("%1 %2 %3 %4 %5 %6 %7 %8 %9 foo %10 %11 bar"); str = str.arg("one", "2", "3", "4", "5", "6", "7", "8", "9"); str = str.arg("ahoy", "there"); - QCOMPARE(str, QString("one 2 3 4 5 6 7 8 9 foo ahoy there bar")); + QCOMPARE(str, QLatin1String("one 2 3 4 5 6 7 8 9 foo ahoy there bar")); QString str2("%123 %234 %345 %456 %567 %999 %1000 %1230"); str2 = str2.arg("A", "B", "C", "D", "E", "F"); - QCOMPARE(str2, QString("A B C D E F %1000 %1230")); - - QCOMPARE(QString("%1").arg(-1, 3, 10, QChar('0')), QString("-01")); - QCOMPARE(QString("%1").arg(-100, 3, 10, QChar('0')), QString("-100")); - QCOMPARE(QString("%1").arg(-1, 3, 10, QChar(' ')), QString(" -1")); - QCOMPARE(QString("%1").arg(-100, 3, 10, QChar(' ')), QString("-100")); - QCOMPARE(QString("%1").arg(1U, 3, 10, QChar(' ')), QString(" 1")); - QCOMPARE(QString("%1").arg(1000U, 3, 10, QChar(' ')), QString("1000")); - QCOMPARE(QString("%1").arg(-1, 3, 10, QChar('x')), QString("x-1")); - QCOMPARE(QString("%1").arg(-100, 3, 10, QChar('x')), QString("-100")); - QCOMPARE(QString("%1").arg(1U, 3, 10, QChar('x')), QString("xx1")); - QCOMPARE(QString("%1").arg(1000U, 3, 10, QChar('x')), QString("1000")); - - QCOMPARE(QString("%1").arg(-1., 3, 'g', -1, QChar('0')), QString("-01")); - QCOMPARE(QString("%1").arg(-100., 3, 'g', -1, QChar('0')), QString("-100")); - QCOMPARE(QString("%1").arg(-1., 3, 'g', -1, QChar(' ')), QString(" -1")); - QCOMPARE(QString("%1").arg(-100., 3, 'g', -1, QChar(' ')), QString("-100")); - QCOMPARE(QString("%1").arg(1., 3, 'g', -1, QChar('x')), QString("xx1")); - QCOMPARE(QString("%1").arg(1000., 3, 'g', -1, QChar('x')), QString("1000")); - QCOMPARE(QString("%1").arg(-1., 3, 'g', -1, QChar('x')), QString("x-1")); - QCOMPARE(QString("%1").arg(-100., 3, 'g', -1, QChar('x')), QString("-100")); + QCOMPARE(str2, QLatin1String("A B C D E F %1000 %1230")); + + QCOMPARE(QString("%1").arg(-1, 3, 10, QChar('0')), QLatin1String("-01")); + QCOMPARE(QString("%1").arg(-100, 3, 10, QChar('0')), QLatin1String("-100")); + QCOMPARE(QString("%1").arg(-1, 3, 10, QChar(' ')), QLatin1String(" -1")); + QCOMPARE(QString("%1").arg(-100, 3, 10, QChar(' ')), QLatin1String("-100")); + QCOMPARE(QString("%1").arg(1U, 3, 10, QChar(' ')), QLatin1String(" 1")); + QCOMPARE(QString("%1").arg(1000U, 3, 10, QChar(' ')), QLatin1String("1000")); + QCOMPARE(QString("%1").arg(-1, 3, 10, QChar('x')), QLatin1String("x-1")); + QCOMPARE(QString("%1").arg(-100, 3, 10, QChar('x')), QLatin1String("-100")); + QCOMPARE(QString("%1").arg(1U, 3, 10, QChar('x')), QLatin1String("xx1")); + QCOMPARE(QString("%1").arg(1000U, 3, 10, QChar('x')), QLatin1String("1000")); + + QCOMPARE(QString("%1").arg(-1., 3, 'g', -1, QChar('0')), QLatin1String("-01")); + QCOMPARE(QString("%1").arg(-100., 3, 'g', -1, QChar('0')), QLatin1String("-100")); + QCOMPARE(QString("%1").arg(-1., 3, 'g', -1, QChar(' ')), QLatin1String(" -1")); + QCOMPARE(QString("%1").arg(-100., 3, 'g', -1, QChar(' ')), QLatin1String("-100")); + QCOMPARE(QString("%1").arg(1., 3, 'g', -1, QChar('x')), QLatin1String("xx1")); + QCOMPARE(QString("%1").arg(1000., 3, 'g', -1, QChar('x')), QLatin1String("1000")); + QCOMPARE(QString("%1").arg(-1., 3, 'g', -1, QChar('x')), QLatin1String("x-1")); + QCOMPARE(QString("%1").arg(-100., 3, 'g', -1, QChar('x')), QLatin1String("-100")); QLocale::setDefault(QString("ar")); QCOMPARE( QString("%L1").arg(12345.6789, 10, 'g', 7, QLatin1Char('0')), @@ -4673,13 +4674,13 @@ void tst_QString::arg() void tst_QString::number() { - QCOMPARE( QString::number(int(0)), QString("0") ); - QCOMPARE( QString::number((unsigned int)(11)), QString("11") ); - QCOMPARE( QString::number(-22L), QString("-22") ); - QCOMPARE( QString::number(333UL), QString("333") ); - QCOMPARE( QString::number(4.4), QString("4.4") ); - QCOMPARE( QString::number(Q_INT64_C(-555)), QString("-555") ); - QCOMPARE( QString::number(Q_UINT64_C(6666)), QString("6666") ); + QCOMPARE( QString::number(int(0)), QLatin1String("0") ); + QCOMPARE( QString::number((unsigned int)(11)), QLatin1String("11") ); + QCOMPARE( QString::number(-22L), QLatin1String("-22") ); + QCOMPARE( QString::number(333UL), QLatin1String("333") ); + QCOMPARE( QString::number(4.4), QLatin1String("4.4") ); + QCOMPARE( QString::number(Q_INT64_C(-555)), QLatin1String("-555") ); + QCOMPARE( QString::number(Q_UINT64_C(6666)), QLatin1String("6666") ); } void tst_QString::capacity_data() diff --git a/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro b/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro index 1719af631d..14dbe779db 100644 --- a/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro +++ b/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro @@ -1,7 +1,6 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstring_no_cast_from_bytearray QT = core testlib SOURCES = tst_qstring_no_cast_from_bytearray.cpp DEFINES += QT_NO_CAST_FROM_BYTEARRAY -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/qstringbuilder1.pro b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/qstringbuilder1.pro index 64ce377c29..d9cdad1bf5 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/qstringbuilder1.pro +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/qstringbuilder1.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringbuilder1 QT = core testlib SOURCES = tst_qstringbuilder1.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/qstringbuilder2.pro b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/qstringbuilder2.pro index 56ed7707d0..e134c5d934 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/qstringbuilder2.pro +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/qstringbuilder2.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringbuilder2 QT = core testlib SOURCES = tst_qstringbuilder2.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/qstringbuilder3.pro b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/qstringbuilder3.pro index 2be2c24de4..29607551c3 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/qstringbuilder3.pro +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/qstringbuilder3.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringbuilder3 QT = core testlib SOURCES = tst_qstringbuilder3.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/qstringbuilder4.pro b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/qstringbuilder4.pro index 3a97d49483..e55848e4bd 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/qstringbuilder4.pro +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/qstringbuilder4.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringbuilder4 QT = core testlib SOURCES = tst_qstringbuilder4.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringiterator/qstringiterator.pro b/tests/auto/corelib/tools/qstringiterator/qstringiterator.pro index e5e625d520..3a1678b5f3 100644 --- a/tests/auto/corelib/tools/qstringiterator/qstringiterator.pro +++ b/tests/auto/corelib/tools/qstringiterator/qstringiterator.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringiterator QT = core core-private testlib SOURCES = tst_qstringiterator.cpp diff --git a/tests/auto/corelib/tools/qstringlist/qstringlist.pro b/tests/auto/corelib/tools/qstringlist/qstringlist.pro index c3b2fe07c0..a87257decb 100644 --- a/tests/auto/corelib/tools/qstringlist/qstringlist.pro +++ b/tests/auto/corelib/tools/qstringlist/qstringlist.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringlist QT = core testlib SOURCES = tst_qstringlist.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringmatcher/qstringmatcher.pro b/tests/auto/corelib/tools/qstringmatcher/qstringmatcher.pro index 3a6e22b469..e34928776f 100644 --- a/tests/auto/corelib/tools/qstringmatcher/qstringmatcher.pro +++ b/tests/auto/corelib/tools/qstringmatcher/qstringmatcher.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringmatcher QT = core testlib SOURCES = tst_qstringmatcher.cpp DEFINES += QT_NO_CAST_TO_ASCII -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringref/qstringref.pro b/tests/auto/corelib/tools/qstringref/qstringref.pro index edb5ef995c..04f3ba6a92 100644 --- a/tests/auto/corelib/tools/qstringref/qstringref.pro +++ b/tests/auto/corelib/tools/qstringref/qstringref.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qstringref QT = core testlib SOURCES = tst_qstringref.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp index 82d103c460..15bcb1ee2b 100644 --- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp +++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp @@ -292,7 +292,7 @@ void tst_QStringRef::indexOf_data() QString s2; s2 += QChar(0x3bc); QTest::newRow("data58") << QString(s1) << QString(s2) << 0 << false << 3; - s2.prepend("C"); + s2.prepend(QLatin1Char('C')); QTest::newRow("data59") << QString(s1) << QString(s2) << 0 << false << 2; QString veryBigHaystack(500, 'a'); diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro index 29b9854ebb..9d26ec1fd5 100644 --- a/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro +++ b/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro @@ -1,10 +1,9 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtextboundaryfinder QT = core testlib SOURCES = tst_qtextboundaryfinder.cpp TESTDATA += data -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/corelib/tools/qtime/qtime.pro b/tests/auto/corelib/tools/qtime/qtime.pro index 48db4c6664..0973b7a9ef 100644 --- a/tests/auto/corelib/tools/qtime/qtime.pro +++ b/tests/auto/corelib/tools/qtime/qtime.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtime QT = core testlib SOURCES = tst_qtime.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qtimeline/qtimeline.pro b/tests/auto/corelib/tools/qtimeline/qtimeline.pro index ca8eba41fb..9424cf8fd2 100644 --- a/tests/auto/corelib/tools/qtimeline/qtimeline.pro +++ b/tests/auto/corelib/tools/qtimeline/qtimeline.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtimeline QT = core testlib SOURCES = tst_qtimeline.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qtimezone/qtimezone.pro b/tests/auto/corelib/tools/qtimezone/qtimezone.pro index fa2397a6bb..4459ed6020 100644 --- a/tests/auto/corelib/tools/qtimezone/qtimezone.pro +++ b/tests/auto/corelib/tools/qtimezone/qtimezone.pro @@ -1,8 +1,7 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qtimezone QT = core-private testlib SOURCES = tst_qtimezone.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 contains(QT_CONFIG,icu) { DEFINES += QT_USE_ICU } diff --git a/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro b/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro index 4fb8a1cf30..108fb33db5 100644 --- a/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro +++ b/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qvarlengtharray QT = core testlib SOURCES = tst_qvarlengtharray.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp index 82f78b2b0b..1c736fba65 100644 --- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp +++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp @@ -148,14 +148,14 @@ void tst_QVarLengthArray::oldTests() QVarLengthArray<QString> sa(10); sa[0] = "Hello"; sa[9] = "World"; - QVERIFY(*sa.data() == "Hello"); - QVERIFY(sa[9] == "World"); + QCOMPARE(*sa.data(), QLatin1String("Hello")); + QCOMPARE(sa[9], QLatin1String("World")); sa.reserve(512); - QVERIFY(*sa.data() == "Hello"); - QVERIFY(sa[9] == "World"); + QCOMPARE(*sa.data(), QLatin1String("Hello")); + QCOMPARE(sa[9], QLatin1String("World")); sa.resize(512); - QVERIFY(*sa.data() == "Hello"); - QVERIFY(sa[9] == "World"); + QCOMPARE(*sa.data(), QLatin1String("Hello")); + QCOMPARE(sa[9], QLatin1String("World")); } { int arr[2] = {1, 2}; diff --git a/tests/auto/corelib/tools/qvector/qvector.pro b/tests/auto/corelib/tools/qvector/qvector.pro index c1e0564915..d49516923f 100644 --- a/tests/auto/corelib/tools/qvector/qvector.pro +++ b/tests/auto/corelib/tools/qvector/qvector.pro @@ -1,6 +1,5 @@ -CONFIG += testcase parallel_test +CONFIG += testcase contains(QT_CONFIG, c++11):CONFIG += c++11 TARGET = tst_qvector QT = core testlib SOURCES = $$PWD/tst_qvector.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro index ba4b2b40cb..e3a231060c 100644 --- a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro +++ b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase contains(QT_CONFIG, c++11):CONFIG += c++11 c++14 TARGET = tst_qversionnumber QT = core testlib diff --git a/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro b/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro index 0a9580da62..0a739f0a0e 100644 --- a/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro +++ b/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro @@ -1,8 +1,6 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qxmlstream QT = core xml network testlib SOURCES = tst_qxmlstream.cpp TESTDATA += data XML-Test-Suite -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp index 341b169113..94b785ae1d 100644 --- a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp +++ b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp @@ -119,7 +119,7 @@ static QByteArray makeCanonical(const QString &filename, if (notation.publicId().isEmpty()) { writeDtd << " SYSTEM \'"; writeDtd << notation.systemId().toString(); - writeDtd << "\'"; + writeDtd << '\''; } else { writeDtd << " PUBLIC \'"; writeDtd << notation.publicId().toString(); @@ -127,10 +127,10 @@ static QByteArray makeCanonical(const QString &filename, if (!notation.systemId().isEmpty() ) { writeDtd << " \'"; writeDtd << notation.systemId().toString(); - writeDtd << "\'"; + writeDtd << '\''; } } - writeDtd << ">"; + writeDtd << '>'; writeDtd << endl; } @@ -687,7 +687,7 @@ QByteArray tst_QXmlStream::readFile(const QString &filename) while (!reader.atEnd()) { reader.readNext(); - writer << reader.tokenString() << "("; + writer << reader.tokenString() << '('; if (reader.isWhitespace()) writer << " whitespace"; if (reader.isCDATA()) @@ -695,42 +695,42 @@ QByteArray tst_QXmlStream::readFile(const QString &filename) if (reader.isStartDocument() && reader.isStandaloneDocument()) writer << " standalone"; if (!reader.text().isEmpty()) - writer << " text=\"" << reader.text().toString() << "\""; + writer << " text=\"" << reader.text().toString() << '"'; if (!reader.processingInstructionTarget().isEmpty()) - writer << " processingInstructionTarget=\"" << reader.processingInstructionTarget().toString() << "\""; + writer << " processingInstructionTarget=\"" << reader.processingInstructionTarget().toString() << '"'; if (!reader.processingInstructionData().isEmpty()) - writer << " processingInstructionData=\"" << reader.processingInstructionData().toString() << "\""; + writer << " processingInstructionData=\"" << reader.processingInstructionData().toString() << '"'; if (!reader.dtdName().isEmpty()) - writer << " dtdName=\"" << reader.dtdName().toString() << "\""; + writer << " dtdName=\"" << reader.dtdName().toString() << '"'; if (!reader.dtdPublicId().isEmpty()) - writer << " dtdPublicId=\"" << reader.dtdPublicId().toString() << "\""; + writer << " dtdPublicId=\"" << reader.dtdPublicId().toString() << '"'; if (!reader.dtdSystemId().isEmpty()) - writer << " dtdSystemId=\"" << reader.dtdSystemId().toString() << "\""; + writer << " dtdSystemId=\"" << reader.dtdSystemId().toString() << '"'; if (!reader.documentVersion().isEmpty()) - writer << " documentVersion=\"" << reader.documentVersion().toString() << "\""; + writer << " documentVersion=\"" << reader.documentVersion().toString() << '"'; if (!reader.documentEncoding().isEmpty()) - writer << " documentEncoding=\"" << reader.documentEncoding().toString() << "\""; + writer << " documentEncoding=\"" << reader.documentEncoding().toString() << '"'; if (!reader.name().isEmpty()) - writer << " name=\"" << reader.name().toString() << "\""; + writer << " name=\"" << reader.name().toString() << '"'; if (!reader.namespaceUri().isEmpty()) - writer << " namespaceUri=\"" << reader.namespaceUri().toString() << "\""; + writer << " namespaceUri=\"" << reader.namespaceUri().toString() << '"'; if (!reader.qualifiedName().isEmpty()) - writer << " qualifiedName=\"" << reader.qualifiedName().toString() << "\""; + writer << " qualifiedName=\"" << reader.qualifiedName().toString() << '"'; if (!reader.prefix().isEmpty()) - writer << " prefix=\"" << reader.prefix().toString() << "\""; + writer << " prefix=\"" << reader.prefix().toString() << '"'; if (reader.attributes().size()) { foreach(QXmlStreamAttribute attribute, reader.attributes()) { writer << endl << " Attribute("; if (!attribute.name().isEmpty()) - writer << " name=\"" << attribute.name().toString() << "\""; + writer << " name=\"" << attribute.name().toString() << '"'; if (!attribute.namespaceUri().isEmpty()) - writer << " namespaceUri=\"" << attribute.namespaceUri().toString() << "\""; + writer << " namespaceUri=\"" << attribute.namespaceUri().toString() << '"'; if (!attribute.qualifiedName().isEmpty()) - writer << " qualifiedName=\"" << attribute.qualifiedName().toString() << "\""; + writer << " qualifiedName=\"" << attribute.qualifiedName().toString() << '"'; if (!attribute.prefix().isEmpty()) - writer << " prefix=\"" << attribute.prefix().toString() << "\""; + writer << " prefix=\"" << attribute.prefix().toString() << '"'; if (!attribute.value().isEmpty()) - writer << " value=\"" << attribute.value().toString() << "\""; + writer << " value=\"" << attribute.value().toString() << '"'; writer << " )" << endl; } } @@ -738,9 +738,9 @@ QByteArray tst_QXmlStream::readFile(const QString &filename) foreach(QXmlStreamNamespaceDeclaration namespaceDeclaration, reader.namespaceDeclarations()) { writer << endl << " NamespaceDeclaration("; if (!namespaceDeclaration.prefix().isEmpty()) - writer << " prefix=\"" << namespaceDeclaration.prefix().toString() << "\""; + writer << " prefix=\"" << namespaceDeclaration.prefix().toString() << '"'; if (!namespaceDeclaration.namespaceUri().isEmpty()) - writer << " namespaceUri=\"" << namespaceDeclaration.namespaceUri().toString() << "\""; + writer << " namespaceUri=\"" << namespaceDeclaration.namespaceUri().toString() << '"'; writer << " )" << endl; } } @@ -748,11 +748,11 @@ QByteArray tst_QXmlStream::readFile(const QString &filename) foreach(QXmlStreamNotationDeclaration notationDeclaration, reader.notationDeclarations()) { writer << endl << " NotationDeclaration("; if (!notationDeclaration.name().isEmpty()) - writer << " name=\"" << notationDeclaration.name().toString() << "\""; + writer << " name=\"" << notationDeclaration.name().toString() << '"'; if (!notationDeclaration.systemId().isEmpty()) - writer << " systemId=\"" << notationDeclaration.systemId().toString() << "\""; + writer << " systemId=\"" << notationDeclaration.systemId().toString() << '"'; if (!notationDeclaration.publicId().isEmpty()) - writer << " publicId=\"" << notationDeclaration.publicId().toString() << "\""; + writer << " publicId=\"" << notationDeclaration.publicId().toString() << '"'; writer << " )" << endl; } } @@ -760,15 +760,15 @@ QByteArray tst_QXmlStream::readFile(const QString &filename) foreach(QXmlStreamEntityDeclaration entityDeclaration, reader.entityDeclarations()) { writer << endl << " EntityDeclaration("; if (!entityDeclaration.name().isEmpty()) - writer << " name=\"" << entityDeclaration.name().toString() << "\""; + writer << " name=\"" << entityDeclaration.name().toString() << '"'; if (!entityDeclaration.notationName().isEmpty()) - writer << " notationName=\"" << entityDeclaration.notationName().toString() << "\""; + writer << " notationName=\"" << entityDeclaration.notationName().toString() << '"'; if (!entityDeclaration.systemId().isEmpty()) - writer << " systemId=\"" << entityDeclaration.systemId().toString() << "\""; + writer << " systemId=\"" << entityDeclaration.systemId().toString() << '"'; if (!entityDeclaration.publicId().isEmpty()) - writer << " publicId=\"" << entityDeclaration.publicId().toString() << "\""; + writer << " publicId=\"" << entityDeclaration.publicId().toString() << '"'; if (!entityDeclaration.value().isEmpty()) - writer << " value=\"" << entityDeclaration.value().toString() << "\""; + writer << " value=\"" << entityDeclaration.value().toString() << '"'; writer << " )" << endl; } } @@ -877,13 +877,13 @@ void tst_QXmlStream::testFalsePrematureError() const while (!xml.atEnd()) { xml.readNext(); } - QVERIFY(xml.error() == QXmlStreamReader::PrematureEndOfDocumentError); + QCOMPARE(xml.error(), QXmlStreamReader::PrematureEndOfDocumentError); QCOMPARE(xml.errorString(), QLatin1String("Premature end of document.")); xml.addData(legal_start); while (!xml.atEnd()) { xml.readNext(); } - QVERIFY(xml.error() == QXmlStreamReader::PrematureEndOfDocumentError); + QCOMPARE(xml.error(), QXmlStreamReader::PrematureEndOfDocumentError); QCOMPARE(xml.errorString(), QLatin1String("Premature end of document.")); xml.addData(end); while (!xml.atEnd()) { @@ -898,7 +898,7 @@ void tst_QXmlStream::testFalsePrematureError() const } QVERIFY(xml.hasError()); QCOMPARE(xml.errorString(), QLatin1String("Start tag expected.")); - QVERIFY(xml.error() == QXmlStreamReader::NotWellFormedError); + QCOMPARE(xml.error(), QXmlStreamReader::NotWellFormedError); } } @@ -1051,11 +1051,11 @@ void tst_QXmlStream::readNextStartElement() const QXmlStreamReader reader(in); QVERIFY(reader.readNextStartElement()); - QVERIFY(reader.isStartElement() && reader.name() == "A"); + QVERIFY(reader.isStartElement() && reader.name() == QLatin1String("A")); int amountOfB = 0; while (reader.readNextStartElement()) { - QVERIFY(reader.isStartElement() && reader.name() == "B"); + QVERIFY(reader.isStartElement() && reader.name() == QLatin1String("B")); ++amountOfB; reader.skipCurrentElement(); } diff --git a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/qdbusabstractadaptor.pro b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/qdbusabstractadaptor.pro index d95fa941f0..c05a575acf 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/qdbusabstractadaptor.pro +++ b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/qdbusabstractadaptor.pro @@ -5,4 +5,3 @@ TARGET = ../tst_qdbusabstractadaptor DESTDIR = ./ QT = core core-private dbus testlib -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.pro b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.pro index ddafd528ee..8f2d261899 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.pro +++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.pro @@ -4,4 +4,3 @@ TARGET = qmyserver DESTDIR = ./ QT = core dbus CONFIG -= app_bundle -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp index d26af847cf..7a73dddfe3 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp +++ b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp @@ -507,7 +507,7 @@ void tst_QDBusAbstractAdaptor::initTestCase() // get peer server address QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "address"); QDBusMessage rpl = QDBusConnection::sessionBus().call(req); - QVERIFY(rpl.type() == QDBusMessage::ReplyMessage); + QCOMPARE(rpl.type(), QDBusMessage::ReplyMessage); QString address = rpl.arguments().at(0).toString(); // connect to peer server @@ -1870,7 +1870,7 @@ void tst_QDBusAbstractAdaptor::methodWithMoreThanOneReturnValue() QDBusInterface remote(con.baseService(), "/", "local.Interface3", con); QDBusMessage reply = remote.call(QDBus::BlockWithGui, "methodStringString", testString); - QVERIFY(reply.arguments().count() == 2); + QCOMPARE(reply.arguments().count(), 2); QDBusReply<int> intreply = reply; QVERIFY(intreply.isValid()); @@ -1892,7 +1892,7 @@ void tst_QDBusAbstractAdaptor::methodWithMoreThanOneReturnValuePeer() QDBusInterface remote(QString(), "/", "local.Interface3", con); QDBusMessage reply = remote.call(QDBus::BlockWithGui, "methodStringString", testString); - QVERIFY(reply.arguments().count() == 2); + QCOMPARE(reply.arguments().count(), 2); QDBusReply<int> intreply = reply; QVERIFY(intreply.isValid()); diff --git a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/qdbusabstractinterface.pro b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/qdbusabstractinterface.pro index a8cc4c2b38..702c81ff54 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/qdbusabstractinterface.pro +++ b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/qdbusabstractinterface.pro @@ -7,7 +7,6 @@ DESTDIR = ./ QT = core testlib QT += dbus -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 DBUS_INTERFACES = ../org.qtproject.QtDBus.Pinger.xml QDBUSXML2CPP_INTERFACE_HEADER_FLAGS += -i ../interface.h diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro index 957b47e413..206522b557 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro @@ -5,4 +5,3 @@ DESTDIR = ./ CONFIG -= app_bundle CONFIG += console QT = core dbus -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index cd23f2cb47..2db687e21b 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -247,7 +247,7 @@ void tst_QDBusAbstractInterface::initTestCase() // get peer server address QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "address"); QDBusMessage rpl = con.call(req); - QVERIFY(rpl.type() == QDBusMessage::ReplyMessage); + QCOMPARE(rpl.type(), QDBusMessage::ReplyMessage); peerAddress = rpl.arguments().at(0).toString(); } @@ -283,7 +283,7 @@ void tst_QDBusAbstractInterface::cleanup() targetObj.m_complexProp = RegisteredType(); QDBusMessage resetCall = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "reset"); - QVERIFY(QDBusConnection::sessionBus().call(resetCall).type() == QDBusMessage::ReplyMessage); + QCOMPARE(QDBusConnection::sessionBus().call(resetCall).type(), QDBusMessage::ReplyMessage); } void tst_QDBusAbstractInterface::makeVoidCall() @@ -441,7 +441,7 @@ void tst_QDBusAbstractInterface::makeAsyncStringCallPeer() QVERIFY2(p, "Not connected to D-Bus"); QDBusMessage reply = p->call(QDBus::BlockWithGui, QLatin1String("voidMethod")); - QVERIFY(reply.type() == QDBusMessage::ReplyMessage); + QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); QDBusPendingReply<QString> r = p->stringMethod(); r.waitForFinished(); @@ -622,7 +622,7 @@ void tst_QDBusAbstractInterface::complexPropRead() RegisteredType expectedValue = targetObj.m_complexProp = RegisteredType("This is a test"); QVariant v = p->property("complexProp"); - QVERIFY(v.userType() == qMetaTypeId<RegisteredType>()); + QCOMPARE(v.userType(), qMetaTypeId<RegisteredType>()); QCOMPARE(v.value<RegisteredType>(), targetObj.m_complexProp); } @@ -694,7 +694,7 @@ void tst_QDBusAbstractInterface::complexPropReadPeer() RegisteredType expectedValue = RegisteredType("This is a test"); QVariant v = p->property("complexProp"); - QVERIFY(v.userType() == qMetaTypeId<RegisteredType>()); + QCOMPARE(v.userType(), qMetaTypeId<RegisteredType>()); QCOMPARE(v.value<RegisteredType>(), expectedValue); } @@ -861,8 +861,8 @@ void tst_QDBusAbstractInterface::getVoidSignal() QTestEventLoop::instance().enterLoop(2); QVERIFY(!QTestEventLoop::instance().timeout()); - QVERIFY(s.size() == 1); - QVERIFY(s.at(0).size() == 0); + QCOMPARE(s.size(), 1); + QCOMPARE(s.at(0).size(), 0); } void tst_QDBusAbstractInterface::getStringSignal_data() @@ -886,8 +886,8 @@ void tst_QDBusAbstractInterface::getStringSignal() QTestEventLoop::instance().enterLoop(2); QVERIFY(!QTestEventLoop::instance().timeout()); - QVERIFY(s.size() == 1); - QVERIFY(s[0].size() == 1); + QCOMPARE(s.size(), 1); + QCOMPARE(s[0].size(), 1); QCOMPARE(s[0][0].userType(), int(QVariant::String)); QCOMPARE(s[0][0].toString(), expectedValue); } @@ -913,8 +913,8 @@ void tst_QDBusAbstractInterface::getComplexSignal() QTestEventLoop::instance().enterLoop(2); QVERIFY(!QTestEventLoop::instance().timeout()); - QVERIFY(s.size() == 1); - QVERIFY(s[0].size() == 1); + QCOMPARE(s.size(), 1); + QCOMPARE(s[0].size(), 1); QCOMPARE(s[0][0].userType(), qMetaTypeId<RegisteredType>()); QCOMPARE(s[0][0].value<RegisteredType>(), expectedValue); } @@ -942,8 +942,8 @@ void tst_QDBusAbstractInterface::getVoidSignalPeer() QTestEventLoop::instance().enterLoop(2); QVERIFY(!QTestEventLoop::instance().timeout()); - QVERIFY(s.size() == 1); - QVERIFY(s.at(0).size() == 0); + QCOMPARE(s.size(), 1); + QCOMPARE(s.at(0).size(), 0); } void tst_QDBusAbstractInterface::getStringSignalPeer_data() @@ -968,8 +968,8 @@ void tst_QDBusAbstractInterface::getStringSignalPeer() QTestEventLoop::instance().enterLoop(2); QVERIFY(!QTestEventLoop::instance().timeout()); - QVERIFY(s.size() == 1); - QVERIFY(s[0].size() == 1); + QCOMPARE(s.size(), 1); + QCOMPARE(s[0].size(), 1); QCOMPARE(s[0][0].userType(), int(QVariant::String)); QCOMPARE(s[0][0].toString(), expectedValue); } @@ -996,8 +996,8 @@ void tst_QDBusAbstractInterface::getComplexSignalPeer() QTestEventLoop::instance().enterLoop(2); QVERIFY(!QTestEventLoop::instance().timeout()); - QVERIFY(s.size() == 1); - QVERIFY(s[0].size() == 1); + QCOMPARE(s.size(), 1); + QCOMPARE(s[0].size(), 1); QCOMPARE(s[0][0].userType(), qMetaTypeId<RegisteredType>()); QCOMPARE(s[0][0].value<RegisteredType>(), expectedValue); } @@ -1045,7 +1045,7 @@ void tst_QDBusAbstractInterface::followSignal() // now the signal must have been received: QCOMPARE(s.size(), 1); - QVERIFY(s.at(0).size() == 0); + QCOMPARE(s.at(0).size(), 0); // cleanup: con.interface()->unregisterService(serviceToFollow); diff --git a/tests/auto/dbus/qdbusconnection/qdbusconnection.pro b/tests/auto/dbus/qdbusconnection/qdbusconnection.pro index 83ae29de0a..3fcf3e076b 100644 --- a/tests/auto/dbus/qdbusconnection/qdbusconnection.pro +++ b/tests/auto/dbus/qdbusconnection/qdbusconnection.pro @@ -3,4 +3,3 @@ TARGET = tst_qdbusconnection QT = core dbus testlib SOURCES += tst_qdbusconnection.cpp HEADERS += tst_qdbusconnection.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp index e91f87d6c8..7cd8c875ec 100644 --- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp @@ -71,7 +71,7 @@ void tst_QDBusConnection::noConnection() QVERIFY(con.callWithCallback(msg, &spy, SLOT(asyncReply)) == 0); QDBusMessage reply = con.call(msg); - QVERIFY(reply.type() == QDBusMessage::ErrorMessage); + QCOMPARE(reply.type(), QDBusMessage::ErrorMessage); QDBusReply<void> voidreply(reply); QVERIFY(!voidreply.isValid()); @@ -877,14 +877,14 @@ void tst_QDBusConnection::callSelfByAnotherName() break; case 1: - QVERIFY(con.interface()->registerService(sname).value() == QDBusConnectionInterface::ServiceRegistered); + QCOMPARE(con.interface()->registerService(sname).value(), QDBusConnectionInterface::ServiceRegistered); break; case 2: { // flag is DBUS_NAME_FLAG_DO_NOT_QUEUE = 0x04 // reply is DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER = 1 QDBusReply<uint> reply = con.interface()->call("RequestName", sname, 4u); - QVERIFY(reply.value() == 1); + QCOMPARE(reply.value(), uint(1)); } } @@ -907,7 +907,7 @@ void tst_QDBusConnection::callSelfByAnotherName() QString(), "test0"); QDBusMessage reply = con.call(msg, QDBus::Block, 1000); - QVERIFY(reply.type() == QDBusMessage::ReplyMessage); + QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); } void tst_QDBusConnection::multipleInterfacesInQObject() @@ -923,7 +923,7 @@ void tst_QDBusConnection::multipleInterfacesInQObject() "local.BaseObject", "anotherMethod"); QDBusMessage reply = con.call(msg, QDBus::Block); QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); - QVERIFY(reply.arguments().count() == 0); + QCOMPARE(reply.arguments().count(), 0); } void tst_QDBusConnection::slotsWithLessParameters() diff --git a/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro b/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro index 7b15a4fb81..97d3c0ebf4 100644 --- a/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro +++ b/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbusconnection_no_bus QT = core dbus testlib SOURCES += tst_qdbusconnection_no_bus.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbuscontext/qdbuscontext.pro b/tests/auto/dbus/qdbuscontext/qdbuscontext.pro index a426c4cfd1..42cf425d52 100644 --- a/tests/auto/dbus/qdbuscontext/qdbuscontext.pro +++ b/tests/auto/dbus/qdbuscontext/qdbuscontext.pro @@ -2,5 +2,4 @@ CONFIG += testcase TARGET = tst_qdbuscontext QT = core dbus testlib SOURCES += tst_qdbuscontext.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro b/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro index 170b555ee7..b7dedad133 100644 --- a/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro +++ b/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro @@ -5,4 +5,3 @@ TARGET = ../tst_qdbusinterface DESTDIR = ./ QT = core core-private dbus testlib -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.pro b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.pro index ddafd528ee..8f2d261899 100644 --- a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.pro +++ b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.pro @@ -4,4 +4,3 @@ TARGET = qmyserver DESTDIR = ./ QT = core dbus CONFIG -= app_bundle -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp index 93d3eacb08..47364e9217 100644 --- a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp +++ b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp @@ -283,7 +283,7 @@ void tst_QDBusInterface::initTestCase() // get peer server address QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "address"); QDBusMessage rpl = con.call(req); - QVERIFY(rpl.type() == QDBusMessage::ReplyMessage); + QCOMPARE(rpl.type(), QDBusMessage::ReplyMessage); QString address = rpl.arguments().at(0).toString(); // connect to peer server @@ -292,7 +292,7 @@ void tst_QDBusInterface::initTestCase() QDBusMessage req2 = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "waitForConnected"); QDBusMessage rpl2 = con.call(req2); - QVERIFY(rpl2.type() == QDBusMessage::ReplyMessage); + QCOMPARE(rpl2.type(), QDBusMessage::ReplyMessage); QVERIFY2(rpl2.type() == QDBusMessage::ReplyMessage, rpl2.errorMessage().toLatin1()); } @@ -348,7 +348,7 @@ void tst_QDBusInterface::invalidAfterServiceOwnerChanged() QTestEventLoop::instance().connect(connIface, SIGNAL(serviceOwnerChanged(QString,QString,QString)), SLOT(exitLoop())); - QVERIFY(connIface->registerService("com.example.Test") == QDBusConnectionInterface::ServiceRegistered); + QCOMPARE(connIface->registerService("com.example.Test").value(), QDBusConnectionInterface::ServiceRegistered); QTestEventLoop::instance().enterLoop(5); diff --git a/tests/auto/dbus/qdbuslocalcalls/qdbuslocalcalls.pro b/tests/auto/dbus/qdbuslocalcalls/qdbuslocalcalls.pro index cbe3e89a16..3577210b86 100644 --- a/tests/auto/dbus/qdbuslocalcalls/qdbuslocalcalls.pro +++ b/tests/auto/dbus/qdbuslocalcalls/qdbuslocalcalls.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbuslocalcalls QT = core dbus testlib SOURCES += tst_qdbuslocalcalls.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro index b0656231d2..b0442a0ee4 100644 --- a/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro +++ b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro @@ -12,4 +12,3 @@ contains(QT_CONFIG, dbus-linked) { } else { SOURCES += ../../../../../src/dbus/qdbus_symbols.cpp } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro b/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro index a4c5efba85..57f8b2a598 100644 --- a/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro +++ b/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro @@ -5,4 +5,3 @@ QT = core dbus CONFIG -= app_bundle CONFIG += console -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro b/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro index c0b38cf478..12f801613d 100644 --- a/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro +++ b/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbusmetaobject QT = core dbus-private testlib SOURCES += tst_qdbusmetaobject.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro b/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro index aef9bc73cb..38d7370667 100644 --- a/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro +++ b/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbusmetatype QT = core dbus testlib SOURCES += tst_qdbusmetatype.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbuspendingcall/qdbuspendingcall.pro b/tests/auto/dbus/qdbuspendingcall/qdbuspendingcall.pro index 7b5f867798..ddfe3008a5 100644 --- a/tests/auto/dbus/qdbuspendingcall/qdbuspendingcall.pro +++ b/tests/auto/dbus/qdbuspendingcall/qdbuspendingcall.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbuspendingcall QT = core dbus testlib SOURCES += tst_qdbuspendingcall.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp index cc12ef8bcc..8cb9aa70e9 100644 --- a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp +++ b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp @@ -178,7 +178,7 @@ void tst_QDBusPendingCall::waitForFinished() QVERIFY(!ac.isError()); const QDBusMessage reply = ac.reply(); - QVERIFY(reply.type() == QDBusMessage::ReplyMessage); + QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); QCOMPARE(reply.signature(), QString("as")); const QVariantList args = ac.reply().arguments(); @@ -334,7 +334,7 @@ void tst_QDBusPendingCall::watcher_waitForFinished_threaded() QDBusPendingCall ac = tst->sendMessage(); // QVERIFY(!ac.isFinished()); // QVERIFY(!ac.isError()); -// QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage); +// QCOMPARE(ac.reply().type(), QDBusMessage::InvalidMessage); QDBusPendingCallWatcher watch(ac); tst->connect(&watch, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -344,7 +344,7 @@ void tst_QDBusPendingCall::watcher_waitForFinished_threaded() // QVERIFY(!ac.isFinished()); // QVERIFY(!ac.isError()); -// QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage); +// QCOMPARE(ac.reply().type(), QDBusMessage::InvalidMessage); QCOMPARE(tst->callCount, 0); QCOMPARE(tst->slotCalled, 0); diff --git a/tests/auto/dbus/qdbuspendingreply/qdbuspendingreply.pro b/tests/auto/dbus/qdbuspendingreply/qdbuspendingreply.pro index d6b9e71084..814e40decc 100644 --- a/tests/auto/dbus/qdbuspendingreply/qdbuspendingreply.pro +++ b/tests/auto/dbus/qdbuspendingreply/qdbuspendingreply.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbuspendingreply QT = core dbus testlib SOURCES += tst_qdbuspendingreply.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusreply/qdbusreply.pro b/tests/auto/dbus/qdbusreply/qdbusreply.pro index 0ffb35e461..42e9e6dddc 100644 --- a/tests/auto/dbus/qdbusreply/qdbusreply.pro +++ b/tests/auto/dbus/qdbusreply/qdbusreply.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbusreply QT = core dbus testlib SOURCES += tst_qdbusreply.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusservicewatcher/qdbusservicewatcher.pro b/tests/auto/dbus/qdbusservicewatcher/qdbusservicewatcher.pro index 82a0f3bb7e..e689a5cfa3 100644 --- a/tests/auto/dbus/qdbusservicewatcher/qdbusservicewatcher.pro +++ b/tests/auto/dbus/qdbusservicewatcher/qdbusservicewatcher.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbusservicewatcher QT = core dbus testlib SOURCES += tst_qdbusservicewatcher.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbusthreading/qdbusthreading.pro b/tests/auto/dbus/qdbusthreading/qdbusthreading.pro index e50804336b..95358b2003 100644 --- a/tests/auto/dbus/qdbusthreading/qdbusthreading.pro +++ b/tests/auto/dbus/qdbusthreading/qdbusthreading.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbusthreading QT = core dbus testlib SOURCES += tst_qdbusthreading.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbustype/qdbustype.pro b/tests/auto/dbus/qdbustype/qdbustype.pro index 21df33d2c7..1b3e0f8008 100644 --- a/tests/auto/dbus/qdbustype/qdbustype.pro +++ b/tests/auto/dbus/qdbustype/qdbustype.pro @@ -9,4 +9,3 @@ contains(QT_CONFIG, dbus-linked) { } else { SOURCES += ../../../../src/dbus/qdbus_symbols.cpp } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp index 4408729e7c..5634bc20f8 100644 --- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp +++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp @@ -260,11 +260,11 @@ void tst_QDBusType::isValidArray() QFETCH(QString, data); QFETCH(bool, result); - data.prepend("a"); + data.prepend(QLatin1Char('a')); QCOMPARE(bool(q_dbus_signature_validate_single(data.toLatin1(), 0)), result); QCOMPARE(QDBusUtil::isValidSingleSignature(data), result); - data.prepend("a"); + data.prepend(QLatin1Char('a')); QCOMPARE(bool(q_dbus_signature_validate_single(data.toLatin1(), 0)), result); QCOMPARE(QDBusUtil::isValidSingleSignature(data), result); } diff --git a/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro b/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro index a7186c341b..3e47b00814 100644 --- a/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro +++ b/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qdbusxmlparser QT = core-private dbus-private xml testlib SOURCES += tst_qdbusxmlparser.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro index 7ed69ce1d1..485472c70c 100644 --- a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro +++ b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qicoimageformat SOURCES+= tst_qicoimageformat.cpp QT += testlib diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp index bff762fd04..ffe3dcfb75 100644 --- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp +++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp @@ -141,7 +141,7 @@ void tst_QIcoImageFormat::canRead() QFETCH(QString, fileName); QFETCH(int, isValid); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QCOMPARE(reader.canRead(), (isValid == 0 ? false : true)); } @@ -175,7 +175,7 @@ void tst_QIcoImageFormat::SequentialFile() QFETCH(QString, fileName); QFETCH(int, isValid); - QSequentialFile *file = new QSequentialFile(m_IconPath + "/" + fileName); + QSequentialFile *file = new QSequentialFile(m_IconPath + QLatin1Char('/') + fileName); QVERIFY(file); QVERIFY(file->open(QFile::ReadOnly)); QImageReader reader(file); @@ -212,7 +212,7 @@ void tst_QIcoImageFormat::imageCount() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QCOMPARE(reader.imageCount(), count); } @@ -240,7 +240,7 @@ void tst_QIcoImageFormat::jumpToNextImage() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); bool bJumped = reader.jumpToImage(0); while (bJumped) { count--; @@ -263,7 +263,7 @@ void tst_QIcoImageFormat::loopCount() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QCOMPARE(reader.loopCount(), count); } @@ -291,7 +291,7 @@ void tst_QIcoImageFormat::nextImageDelay() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); if (count == -1) { QCOMPARE(reader.nextImageDelay(), 0); } else { @@ -320,7 +320,7 @@ void tst_QIcoImageFormat::pngCompression() QFETCH(int, width); QFETCH(int, height); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QImage image; reader.jumpToImage(index); diff --git a/tests/auto/gui/image/qicon/icons/themeparent/icon-theme.cache b/tests/auto/gui/image/qicon/icons/themeparent/icon-theme.cache Binary files differnew file mode 100644 index 0000000000..a323875989 --- /dev/null +++ b/tests/auto/gui/image/qicon/icons/themeparent/icon-theme.cache diff --git a/tests/auto/gui/image/qicon/qicon.pro b/tests/auto/gui/image/qicon/qicon.pro index 6ff20ec8fa..f5570c2497 100644 --- a/tests/auto/gui/image/qicon/qicon.pro +++ b/tests/auto/gui/image/qicon/qicon.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qicon QT += testlib diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 9ed3873682..afa72f6922 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -63,6 +63,7 @@ private slots: void streamAvailableSizes_data(); void streamAvailableSizes(); void fromTheme(); + void fromThemeCache(); #ifndef QT_NO_WIDGETS void task184901_badCache(); @@ -633,6 +634,69 @@ void tst_QIcon::fromTheme() QVERIFY(abIcon.isNull()); } +void tst_QIcon::fromThemeCache() +{ + QTemporaryDir dir; + QVERIFY(QDir().mkpath(dir.path() + QLatin1String("/testcache/16x16/actions"))); + QVERIFY(QFile(QStringLiteral(":/styles/commonstyle/images/standardbutton-open-16.png")) + .copy( dir.path() + QLatin1String("/testcache/16x16/actions/button-open.png"))); + + { + QFile index(dir.path() + QLatin1String("/testcache/index.theme")); + QVERIFY(index.open(QFile::WriteOnly)); + index.write("[Icon Theme]\nDirectories=16x16/actions\n[16x16/actions]\nSize=16\nContext=Actions\nType=Fixed\n"); + } + QIcon::setThemeSearchPaths(QStringList() << dir.path()); + QIcon::setThemeName("testcache"); + + // We just created a theme with that icon, it must exist + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + + QString cacheName = dir.path() + QLatin1String("/testcache/icon-theme.cache"); + + // An invalid cache should not prevent lookup + { + QFile cacheFile(cacheName); + QVERIFY(cacheFile.open(QFile::WriteOnly)); + QDataStream(&cacheFile) << quint16(1) << quint16(0) << "invalid corrupted stuff in there\n"; + } + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + + // An empty cache should prevent the lookup + { + QFile cacheFile(cacheName); + QVERIFY(cacheFile.open(QFile::WriteOnly)); + QDataStream ds(&cacheFile); + ds << quint16(1) << quint16(0); // 0: version + ds << quint32(12) << quint32(20); // 4: hash offset / dir list offset + ds << quint32(1) << quint32(0xffffffff); // 12: one empty bucket + ds << quint32(1) << quint32(28); // 20: list with one element + ds.writeRawData("16x16/actions", sizeof("16x16/actions")); // 28 + } + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(QIcon::fromTheme("button-open").isNull()); // The icon was not in the cache, it should not be found + + // Adding an icon should be changing the modification date of one sub directory which should make the cache ignored + QTest::qWait(1000); // wait enough to have a different modification time in seconds + QVERIFY(QFile(QStringLiteral(":/styles/commonstyle/images/standardbutton-save-16.png")) + .copy(dir.path() + QLatin1String("/testcache/16x16/actions/button-save.png"))); + QVERIFY(QFileInfo(cacheName).lastModified() < QFileInfo(dir.path() + QLatin1String("/testcache/16x16/actions")).lastModified()); + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + + // Try to run the actual gtk-update-icon-cache and make sure that icons are still found + QProcess process; + process.start(QStringLiteral("gtk-update-icon-cache"), + QStringList() << QStringLiteral("-f") << QStringLiteral("-t") << (dir.path() + QLatin1String("/testcache"))); + if (!process.waitForFinished()) + QSKIP("gtk-update-icon-cache not run"); + QVERIFY(QFileInfo(cacheName).lastModified() >= QFileInfo(dir.path() + QLatin1String("/testcache/16x16/actions")).lastModified()); + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + QVERIFY(!QIcon::fromTheme("button-open-fallback").isNull()); + QVERIFY(QIcon::fromTheme("notexist-fallback").isNull()); +} void tst_QIcon::task223279_inconsistentAddFile() { diff --git a/tests/auto/gui/image/qicon/tst_qicon.qrc b/tests/auto/gui/image/qicon/tst_qicon.qrc index 1505ca925b..3c8fbba7c2 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.qrc +++ b/tests/auto/gui/image/qicon/tst_qicon.qrc @@ -15,6 +15,7 @@ <file>./icons/themeparent/32x32/actions/address-book-new.png</file> <file>./icons/themeparent/32x32/actions/appointment-new.png</file> <file>./icons/themeparent/index.theme</file> +<file>./icons/themeparent/icon-theme.cache</file> <file>./icons/themeparent/scalable/actions/address-book-new.svg</file> <file>./icons/themeparent/scalable/actions/appointment-new.svg</file> <file>./styles/commonstyle/images/standardbutton-open-16.png</file> diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro index 42280d3bd4..d32e84c0d7 100644 --- a/tests/auto/gui/image/qimage/qimage.pro +++ b/tests/auto/gui/image/qimage/qimage.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qimage SOURCES += tst_qimage.cpp diff --git a/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro b/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro index bbcf8d23c9..428ff62959 100644 --- a/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro +++ b/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qimageiohandler QT += testlib diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 16fe959b11..fbe9669cbb 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -158,7 +158,7 @@ private: // helper to skip an autotest when the given image format is not supported #define SKIP_IF_UNSUPPORTED(format) do { \ if (!QByteArray(format).isEmpty() && !QImageReader::supportedImageFormats().contains(format)) \ - QSKIP("\"" + QByteArray(format) + "\" images are not supported"); \ + QSKIP('"' + QByteArray(format) + "\" images are not supported"); \ } while (0) // Testing get/set functions diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index 06c775dded..51dfe66090 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -96,7 +96,7 @@ private: // helper to skip an autotest when the given image format is not supported #define SKIP_IF_UNSUPPORTED(format) do { \ if (!QByteArray(format).isEmpty() && !QImageReader::supportedImageFormats().contains(format)) \ - QSKIP("\"" + QByteArray(format) + "\" images are not supported"); \ + QSKIP('"' + QByteArray(format) + "\" images are not supported"); \ } while (0) static void initializePadding(QImage *image) diff --git a/tests/auto/gui/image/qmovie/qmovie.pro b/tests/auto/gui/image/qmovie/qmovie.pro index 4e7030b1f7..a04ad73b80 100644 --- a/tests/auto/gui/image/qmovie/qmovie.pro +++ b/tests/auto/gui/image/qmovie/qmovie.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmovie QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/image/qpicture/qpicture.pro b/tests/auto/gui/image/qpicture/qpicture.pro index a24b8ec481..0fc851ce11 100644 --- a/tests/auto/gui/image/qpicture/qpicture.pro +++ b/tests/auto/gui/image/qpicture/qpicture.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpicture QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro b/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro index a81712ba23..fe3b5a2db3 100644 --- a/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro +++ b/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpixmapcache QT += gui-private testlib SOURCES += tst_qpixmapcache.cpp diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp index a3cf66da18..d1f76e8742 100644 --- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp @@ -147,7 +147,7 @@ void tst_QPixmapCache::setCacheLimit() QVERIFY(QPixmapCache::find(key, p1) == 0); QPixmapCache::setCacheLimit(1000); key = QPixmapCache::insert(*p1); - QCOMPARE(getPrivate(key)->isValid, true); + QVERIFY(key.isValid()); QCOMPARE(getPrivate(key)->key, 1); delete p1; @@ -189,7 +189,7 @@ void tst_QPixmapCache::setCacheLimit() key2 = QPixmapCache::insert(*p1); QCOMPARE(getPrivate(key2)->key, 1); //This old key is not valid anymore after the flush - QCOMPARE(getPrivate(key)->isValid, false); + QVERIFY(!key.isValid()); QVERIFY(QPixmapCache::find(key, &p2) == 0); delete p1; } @@ -233,7 +233,7 @@ void tst_QPixmapCache::find() //at that time the first key has been erase because no more place in the cache QVERIFY(QPixmapCache::find(key, &p1) == 0); - QCOMPARE(getPrivate(key)->isValid, false); + QVERIFY(!key.isValid()); } void tst_QPixmapCache::insert() @@ -313,7 +313,7 @@ void tst_QPixmapCache::replace() p2.fill(Qt::yellow); QPixmapCache::Key key = QPixmapCache::insert(p1); - QCOMPARE(getPrivate(key)->isValid, true); + QVERIFY(key.isValid()); QPixmap p3; QVERIFY(QPixmapCache::find(key, &p3) == 1); @@ -321,7 +321,7 @@ void tst_QPixmapCache::replace() QPixmapCache::replace(key, p2); QVERIFY(QPixmapCache::find(key, &p3) == 1); - QCOMPARE(getPrivate(key)->isValid, true); + QVERIFY(key.isValid()); QCOMPARE(getPrivate(key)->key, 1); QCOMPARE(p3.width(), 10); @@ -438,7 +438,7 @@ void tst_QPixmapCache::clear() for (int k = 0; k < numberOfKeys; ++k) { QVERIFY(QPixmapCache::find(keys.at(k), &p1) == 0); - QCOMPARE(getPrivate(keys[k])->isValid, false); + QVERIFY(!keys[k].isValid()); } } diff --git a/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro b/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro index b85d475e97..50426612dc 100644 --- a/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro +++ b/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstandarditem QT += testlib SOURCES += tst_qstandarditem.cpp diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro b/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro index 71ef4acb88..eef165d9f7 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstandarditemmodel QT += widgets widgets-private testlib diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index ae47b2053b..de7054f2ba 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -256,7 +256,7 @@ void tst_QStandardItemModel::insertRow() QCOMPARE(rcLast[RowsInserted], expectedRow); //check that the inserted item has different DisplayRole than initial items - QVERIFY(m_model->data(m_model->index(expectedRow, 0), Qt::DisplayRole).toString() != "initialitem"); + QVERIFY(m_model->data(m_model->index(expectedRow, 0), Qt::DisplayRole).toString() != QLatin1String("initialitem")); } else { // We inserted something outside the bounds, do nothing QCOMPARE(m_model->rowCount(), defaultSize); @@ -365,7 +365,7 @@ void tst_QStandardItemModel::insertColumn() QCOMPARE(rcLast[ColumnsInserted], expectedColumn); //check that the inserted item has different DisplayRole than initial items - QVERIFY(m_model->data(m_model->index(0, expectedColumn), Qt::DisplayRole).toString() != "initialitem"); + QVERIFY(m_model->data(m_model->index(0, expectedColumn), Qt::DisplayRole).toString() != QLatin1String("initialitem")); } else { // We inserted something outside the bounds, do nothing QCOMPARE(m_model->columnCount(), defaultSize); @@ -729,8 +729,8 @@ void tst_QStandardItemModel::data() } } - QVERIFY(m_model->data(m_model->index(0, 0), Qt::DisplayRole).toString() == "initialitem"); - QVERIFY(m_model->data(m_model->index(0, 0), Qt::ToolTipRole).toString() == "tooltip"); + QCOMPARE(m_model->data(m_model->index(0, 0), Qt::DisplayRole).toString(), QLatin1String("initialitem")); + QCOMPARE(m_model->data(m_model->index(0, 0), Qt::ToolTipRole).toString(), QLatin1String("tooltip")); } @@ -1613,14 +1613,14 @@ void tst_QStandardItemModel::removeRowsAndColumns() #define VERIFY_MODEL \ for (int c = 0; c < col_list.count(); c++) \ for (int r = 0; r < row_list.count(); r++) \ - QCOMPARE(model.item(r,c)->text() , row_list[r] + "x" + col_list[c]); + QCOMPARE(model.item(r,c)->text() , row_list[r] + QLatin1Char('x') + col_list[c]); QVector<QString> row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',').toVector(); QVector<QString> col_list = row_list; QStandardItemModel model; for (int c = 0; c < col_list.count(); c++) for (int r = 0; r < row_list.count(); r++) - model.setItem(r, c, new QStandardItem(row_list[r] + "x" + col_list[c])); + model.setItem(r, c, new QStandardItem(row_list[r] + QLatin1Char('x') + col_list[c])); VERIFY_MODEL row_list.remove(3); @@ -1642,14 +1642,14 @@ void tst_QStandardItemModel::removeRowsAndColumns() QList<QStandardItem *> row_taken = model.takeRow(6); QCOMPARE(row_taken.count(), col_list.count()); for (int c = 0; c < col_list.count(); c++) - QCOMPARE(row_taken[c]->text() , row_list[6] + "x" + col_list[c]); + QCOMPARE(row_taken[c]->text() , row_list[6] + QLatin1Char('x') + col_list[c]); row_list.remove(6); VERIFY_MODEL QList<QStandardItem *> col_taken = model.takeColumn(10); QCOMPARE(col_taken.count(), row_list.count()); for (int r = 0; r < row_list.count(); r++) - QCOMPARE(col_taken[r]->text() , row_list[r] + "x" + col_list[10]); + QCOMPARE(col_taken[r]->text() , row_list[r] + QLatin1Char('x') + col_list[10]); col_list.remove(10); VERIFY_MODEL } @@ -1661,7 +1661,7 @@ void tst_QStandardItemModel::itemRoleNames() QStandardItemModel model; for (int c = 0; c < col_list.count(); c++) for (int r = 0; r < row_list.count(); r++) - model.setItem(r, c, new QStandardItem(row_list[r] + "x" + col_list[c])); + model.setItem(r, c, new QStandardItem(row_list[r] + QLatin1Char('x') + col_list[c])); VERIFY_MODEL QHash<int, QByteArray> newRoleNames; diff --git a/tests/auto/gui/kernel/qdrag/qdrag.pro b/tests/auto/gui/kernel/qdrag/qdrag.pro index d4a7bc2705..ac3fde8028 100644 --- a/tests/auto/gui/kernel/qdrag/qdrag.pro +++ b/tests/auto/gui/kernel/qdrag/qdrag.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdrag QT += testlib SOURCES += tst_qdrag.cpp diff --git a/tests/auto/gui/kernel/qevent/qevent.pro b/tests/auto/gui/kernel/qevent/qevent.pro index 09d4395f4d..2959089ce3 100644 --- a/tests/auto/gui/kernel/qevent/qevent.pro +++ b/tests/auto/gui/kernel/qevent/qevent.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qevent SOURCES += tst_qevent.cpp QT = core testlib -CONFIG += parallel_test diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index d18f9664fc..ea8f594f9c 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -63,6 +63,7 @@ private slots: void initTestCase(); void cleanup(); void displayName(); + void desktopFileName(); void firstWindowTitle(); void windowIcon(); void focusObject(); @@ -117,6 +118,21 @@ void tst_QGuiApplication::displayName() QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("The GUI Application")); } +void tst_QGuiApplication::desktopFileName() +{ + int argc = 1; + char *argv[] = { const_cast<char*>("tst_qguiapplication") }; + QGuiApplication app(argc, argv); + + QCOMPARE(QGuiApplication::desktopFileName(), QString()); + + QGuiApplication::setDesktopFileName("io.qt.QGuiApplication.desktop"); + QCOMPARE(QGuiApplication::desktopFileName(), QString::fromLatin1("io.qt.QGuiApplication.desktop")); + + QGuiApplication::setDesktopFileName(QString()); + QCOMPARE(QGuiApplication::desktopFileName(), QString()); +} + void tst_QGuiApplication::firstWindowTitle() { int argc = 3; diff --git a/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro b/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro index 914142404b..331295bab9 100644 --- a/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro +++ b/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qguimetatype SOURCES += tst_qguimetatype.cpp QT = core gui testlib -CONFIG += parallel_test diff --git a/tests/auto/gui/kernel/qguitimer/qguitimer.pro b/tests/auto/gui/kernel/qguitimer/qguitimer.pro index 15793d6e70..8a71e48007 100644 --- a/tests/auto/gui/kernel/qguitimer/qguitimer.pro +++ b/tests/auto/gui/kernel/qguitimer/qguitimer.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qguitimer QT = core gui testlib SOURCES += ../../../corelib/kernel/qtimer/tst_qtimer.cpp diff --git a/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro b/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro index cc72c225a3..ada3817e55 100644 --- a/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro +++ b/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = no_application SOURCES += main.cpp QT += testlib diff --git a/tests/auto/gui/kernel/qguivariant/test/test.pro b/tests/auto/gui/kernel/qguivariant/test/test.pro index c4123797d2..39e4b3b71f 100644 --- a/tests/auto/gui/kernel/qguivariant/test/test.pro +++ b/tests/auto/gui/kernel/qguivariant/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qguivariant SOURCES += tst_qguivariant.cpp RESOURCES = tst_qguivariant.qrc diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 0e822ced5b..84fdd81f6c 100644 --- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp +++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp @@ -380,7 +380,7 @@ void tst_QGuiVariant::toString_data() #ifndef Q_OS_MAC << QString( "Ctrl+A" ); #else - << QString(QChar(0x2318)) + "A"; + << QString(QChar(0x2318)) + QLatin1Char('A'); #endif QFont font( "times", 12 ); diff --git a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro index 7c1e8d52de..9f79fe9ab7 100644 --- a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro +++ b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qkeysequence QT += testlib @@ -8,4 +7,3 @@ QT += core-private gui-private SOURCES += tst_qkeysequence.cpp RESOURCES += qkeysequence.qrc -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index 3fcbd0a16f..84680fb7a6 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -250,7 +250,7 @@ void tst_QKeySequence::operatorQString() seq = QKeySequence( modifiers | keycode ); - QCOMPARE( (QString)seq, keystring ); + QCOMPARE( seq.toString(QKeySequence::NativeText), keystring ); } // this verifies that the constructors can handle the same strings in and out @@ -260,7 +260,7 @@ void tst_QKeySequence::symetricConstructors() QFETCH( int, keycode ); QKeySequence seq1( modifiers | keycode ); - QKeySequence seq2( (QString)seq1 ); + QKeySequence seq2( seq1.toString(QKeySequence::NativeText) ); QVERIFY( seq1 == seq2 ); } diff --git a/tests/auto/gui/kernel/qpalette/qpalette.pro b/tests/auto/gui/kernel/qpalette/qpalette.pro index de87e8fafe..9dd3f3e715 100644 --- a/tests/auto/gui/kernel/qpalette/qpalette.pro +++ b/tests/auto/gui/kernel/qpalette/qpalette.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpalette QT += testlib SOURCES += tst_qpalette.cpp diff --git a/tests/auto/gui/kernel/qscreen/qscreen.pro b/tests/auto/gui/kernel/qscreen/qscreen.pro index b2c98a9dfd..b631f4cf37 100644 --- a/tests/auto/gui/kernel/qscreen/qscreen.pro +++ b/tests/auto/gui/kernel/qscreen/qscreen.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qscreen QT += core-private gui-private testlib diff --git a/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro b/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro index 9a705f443e..97d9d69fb7 100644 --- a/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro +++ b/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsurfaceformat QT += core-private gui-private testlib diff --git a/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro b/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro index 3302535dda..1401619cd0 100644 --- a/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro +++ b/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmatrixnxn SOURCES += tst_qmatrixnxn.cpp QT += testlib diff --git a/tests/auto/gui/math3d/qquaternion/qquaternion.pro b/tests/auto/gui/math3d/qquaternion/qquaternion.pro index d20719fd11..f578a38580 100644 --- a/tests/auto/gui/math3d/qquaternion/qquaternion.pro +++ b/tests/auto/gui/math3d/qquaternion/qquaternion.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qquaternion SOURCES += tst_qquaternion.cpp QT += testlib diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp index 1fbad5b829..53d9a987a6 100644 --- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp +++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp @@ -999,16 +999,16 @@ static QByteArray testnameForAxis(const QVector3D &axis) testname = "null"; } else { if (axis.x()) { - testname += axis.x() < 0 ? "-" : "+"; - testname += "X"; + testname += axis.x() < 0 ? '-' : '+'; + testname += 'X'; } if (axis.y()) { - testname += axis.y() < 0 ? "-" : "+"; - testname += "Y"; + testname += axis.y() < 0 ? '-' : '+'; + testname += 'Y'; } if (axis.z()) { - testname += axis.z() < 0 ? "-" : "+"; - testname += "Z"; + testname += axis.z() < 0 ? '-' : '+'; + testname += 'Z'; } } return testname; diff --git a/tests/auto/gui/math3d/qvectornd/qvectornd.pro b/tests/auto/gui/math3d/qvectornd/qvectornd.pro index 9504b4a02b..9e5155aa6f 100644 --- a/tests/auto/gui/math3d/qvectornd/qvectornd.pro +++ b/tests/auto/gui/math3d/qvectornd/qvectornd.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qvectornd SOURCES += tst_qvectornd.cpp QT += testlib diff --git a/tests/auto/gui/painting/qbrush/qbrush.pro b/tests/auto/gui/painting/qbrush/qbrush.pro index 0cb11398dc..5016267e66 100644 --- a/tests/auto/gui/painting/qbrush/qbrush.pro +++ b/tests/auto/gui/painting/qbrush/qbrush.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qbrush QT += testlib gui-private SOURCES += tst_qbrush.cpp diff --git a/tests/auto/gui/painting/qcolor/qcolor.pro b/tests/auto/gui/painting/qcolor/qcolor.pro index 44d65bb50b..c8aab4ab75 100644 --- a/tests/auto/gui/painting/qcolor/qcolor.pro +++ b/tests/auto/gui/painting/qcolor/qcolor.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qcolor SOURCES += tst_qcolor.cpp QT += testlib gui-private core-private diff --git a/tests/auto/gui/painting/qpagelayout/qpagelayout.pro b/tests/auto/gui/painting/qpagelayout/qpagelayout.pro index 38a1064357..21fc8e0bb7 100644 --- a/tests/auto/gui/painting/qpagelayout/qpagelayout.pro +++ b/tests/auto/gui/painting/qpagelayout/qpagelayout.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpagelayout SOURCES += tst_qpagelayout.cpp QT += gui-private testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/painting/qpagesize/qpagesize.pro b/tests/auto/gui/painting/qpagesize/qpagesize.pro index 5836dc9ba0..5e1cdb64eb 100644 --- a/tests/auto/gui/painting/qpagesize/qpagesize.pro +++ b/tests/auto/gui/painting/qpagesize/qpagesize.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpagesize SOURCES += tst_qpagesize.cpp QT += testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/painting/qpaintengine/qpaintengine.pro b/tests/auto/gui/painting/qpaintengine/qpaintengine.pro index 1cf79af0a7..810dd81311 100644 --- a/tests/auto/gui/painting/qpaintengine/qpaintengine.pro +++ b/tests/auto/gui/painting/qpaintengine/qpaintengine.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpaintengine SOURCES += tst_qpaintengine.cpp QT += testlib diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro index e90b516ef2..d4f1d43a74 100644 --- a/tests/auto/gui/painting/qpainter/qpainter.pro +++ b/tests/auto/gui/painting/qpainter/qpainter.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpainter QT += testlib gui-private core-private @@ -9,7 +8,6 @@ SOURCES += tst_qpainter.cpp TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \ task217400.png -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 1ed78fa0ef..1e7e858bed 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -4487,7 +4487,7 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate() TestWidget *widget = new TestWidget(); proxy->setWidget(widget); scene->addItem(proxy); - proxy->rotate(45); + proxy->setTransform(QTransform().rotate(45)); w->resize(scene->sceneRect().size().toSize()); w->show(); diff --git a/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro b/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro index 8ad476b498..218183da3d 100644 --- a/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro +++ b/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpainterpathstroker SOURCES += tst_qpainterpathstroker.cpp QT += testlib diff --git a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro index b90bca8df3..2536cb24c0 100644 --- a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro +++ b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpathclipper INCLUDEPATH += . HEADERS += paths.h diff --git a/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro b/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro index fda0fad3b5..4d2dd70e26 100644 --- a/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro +++ b/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpdfwriter SOURCES += tst_qpdfwriter.cpp QT += gui-private testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/painting/qpen/qpen.pro b/tests/auto/gui/painting/qpen/qpen.pro index cafec29947..762b8f47d4 100644 --- a/tests/auto/gui/painting/qpen/qpen.pro +++ b/tests/auto/gui/painting/qpen/qpen.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpen SOURCES += tst_qpen.cpp QT += testlib diff --git a/tests/auto/gui/painting/qpolygon/qpolygon.pro b/tests/auto/gui/painting/qpolygon/qpolygon.pro index 4783e4b5d4..9385b6458d 100644 --- a/tests/auto/gui/painting/qpolygon/qpolygon.pro +++ b/tests/auto/gui/painting/qpolygon/qpolygon.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpolygon QT += testlib SOURCES += tst_qpolygon.cpp diff --git a/tests/auto/gui/painting/qregion/qregion.pro b/tests/auto/gui/painting/qregion/qregion.pro index 01eb9dd937..e9dff9a32e 100644 --- a/tests/auto/gui/painting/qregion/qregion.pro +++ b/tests/auto/gui/painting/qregion/qregion.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qregion QT += gui-private testlib diff --git a/tests/auto/gui/painting/qtransform/qtransform.pro b/tests/auto/gui/painting/qtransform/qtransform.pro index d59c040fb8..62c7518da0 100644 --- a/tests/auto/gui/painting/qtransform/qtransform.pro +++ b/tests/auto/gui/painting/qtransform/qtransform.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtransform SOURCES += tst_qtransform.cpp QT += testlib diff --git a/tests/auto/gui/painting/qwmatrix/qwmatrix.pro b/tests/auto/gui/painting/qwmatrix/qwmatrix.pro index b3bec3d4ff..efa2963091 100644 --- a/tests/auto/gui/painting/qwmatrix/qwmatrix.pro +++ b/tests/auto/gui/painting/qwmatrix/qwmatrix.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qwmatrix SOURCES += tst_qwmatrix.cpp QT += testlib diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index bddccac747..2ca2fe4fb6 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qopengl QT += gui-private core-private testlib diff --git a/tests/auto/gui/qopenglconfig/qopenglconfig.pro b/tests/auto/gui/qopenglconfig/qopenglconfig.pro index bcf7215eea..9b0175acea 100644 --- a/tests/auto/gui/qopenglconfig/qopenglconfig.pro +++ b/tests/auto/gui/qopenglconfig/qopenglconfig.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qopenglconfig QT += gui-private core-private testlib diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro b/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro index 866638f154..ec71130350 100644 --- a/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro +++ b/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstracttextdocumentlayout QT += testlib SOURCES += tst_qabstracttextdocumentlayout.cpp diff --git a/tests/auto/gui/text/qcssparser/qcssparser.pro b/tests/auto/gui/text/qcssparser/qcssparser.pro index bb0c8c4f40..88d1fcfd2d 100644 --- a/tests/auto/gui/text/qcssparser/qcssparser.pro +++ b/tests/auto/gui/text/qcssparser/qcssparser.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qcssparser SOURCES += tst_qcssparser.cpp QT += xml gui-private testlib diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index b1beb0ffd0..878c03e563 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -185,7 +185,7 @@ static void debug(const QVector<QCss::Symbol> &symbols, int index = -1) { qDebug() << "all symbols:"; for (int i = 0; i < symbols.count(); ++i) - qDebug() << "(" << i << "); Token:" << tokenName(symbols.at(i).token) << "; Lexem:" << symbols.at(i).lexem(); + qDebug() << '(' << i << "); Token:" << tokenName(symbols.at(i).token) << "; Lexem:" << symbols.at(i).lexem(); if (index != -1) qDebug() << "failure at index" << index; } @@ -1340,7 +1340,7 @@ void tst_QCssParser::shorthandBackgroundProperty() QVERIFY(doc.setContent(QLatin1String("<!DOCTYPE test><test> <dummy/> </test>"))); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; @@ -1500,7 +1500,7 @@ void tst_QCssParser::gradient() QVERIFY(doc.setContent(QLatin1String("<!DOCTYPE test><test> <dummy/> </test>"))); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; @@ -1560,7 +1560,7 @@ void tst_QCssParser::extractFontFamily() { QFETCH(QString, css); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; @@ -1618,7 +1618,7 @@ void tst_QCssParser::extractBorder() QFETCH(QColor, expectedTopColor); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro index ced66c226c..048d952faf 100644 --- a/tests/auto/gui/text/qfont/qfont.pro +++ b/tests/auto/gui/text/qfont/qfont.pro @@ -1,10 +1,6 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfont QT += testlib QT += core-private gui-private qtHaveModule(widgets): QT += widgets SOURCES += tst_qfont.cpp - - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 93e308b96a..70d2842a93 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -504,7 +504,7 @@ void tst_QFont::isCopyOf() void tst_QFont::insertAndRemoveSubstitutions() { - QFont::removeSubstitution("BogusFontFamily"); + QFont::removeSubstitutions("BogusFontFamily"); // make sure it is empty before we start QVERIFY(QFont::substitutes("BogusFontFamily").isEmpty()); QVERIFY(QFont::substitutes("bogusfontfamily").isEmpty()); @@ -521,7 +521,7 @@ void tst_QFont::insertAndRemoveSubstitutions() QCOMPARE(QFont::substitutes("BogusFontFamily").count(), 3); QCOMPARE(QFont::substitutes("bogusfontfamily").count(), 3); - QFont::removeSubstitution("BogusFontFamily"); + QFont::removeSubstitutions("BogusFontFamily"); // make sure it is empty again QVERIFY(QFont::substitutes("BogusFontFamily").isEmpty()); QVERIFY(QFont::substitutes("bogusfontfamily").isEmpty()); diff --git a/tests/auto/gui/text/qfontcache/qfontcache.pro b/tests/auto/gui/text/qfontcache/qfontcache.pro index 5068c12cd6..bc1042a91b 100644 --- a/tests/auto/gui/text/qfontcache/qfontcache.pro +++ b/tests/auto/gui/text/qfontcache/qfontcache.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontcache QT += testlib QT += core-private gui-private diff --git a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro index 831ed1f572..5dba2fc06a 100644 --- a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontdatabase SOURCES += tst_qfontdatabase.cpp QT += testlib core-private gui-private diff --git a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro index 7286c53d74..5dfabadd1a 100644 --- a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro +++ b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontmetrics QT += testlib core-private gui-private SOURCES += tst_qfontmetrics.cpp diff --git a/tests/auto/gui/text/qglyphrun/qglyphrun.pro b/tests/auto/gui/text/qglyphrun/qglyphrun.pro index b7d9f164c9..39f641a3b2 100644 --- a/tests/auto/gui/text/qglyphrun/qglyphrun.pro +++ b/tests/auto/gui/text/qglyphrun/qglyphrun.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qglyphrun QT = core gui testlib diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro index 20da2e9a22..47e760e1da 100644 --- a/tests/auto/gui/text/qrawfont/qrawfont.pro +++ b/tests/auto/gui/text/qrawfont/qrawfont.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qrawfont QT = core core-private gui gui-private testlib diff --git a/tests/auto/gui/text/qstatictext/qstatictext.pro b/tests/auto/gui/text/qstatictext/qstatictext.pro index 435b132ffd..55146c4482 100644 --- a/tests/auto/gui/text/qstatictext/qstatictext.pro +++ b/tests/auto/gui/text/qstatictext/qstatictext.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test linux: CONFIG += insignificant_test TARGET = tst_qstatictext QT += testlib diff --git a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro index a8dd6437ba..a78c429433 100644 --- a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro +++ b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsyntaxhighlighter SOURCES += tst_qsyntaxhighlighter.cpp QT += testlib diff --git a/tests/auto/gui/text/qtextblock/qtextblock.pro b/tests/auto/gui/text/qtextblock/qtextblock.pro index 6048361f7a..cf3456bbf6 100644 --- a/tests/auto/gui/text/qtextblock/qtextblock.pro +++ b/tests/auto/gui/text/qtextblock/qtextblock.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextblock QT += testlib diff --git a/tests/auto/gui/text/qtextcursor/qtextcursor.pro b/tests/auto/gui/text/qtextcursor/qtextcursor.pro index 5e045404f1..bae85d9c37 100644 --- a/tests/auto/gui/text/qtextcursor/qtextcursor.pro +++ b/tests/auto/gui/text/qtextcursor/qtextcursor.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextcursor SOURCES += tst_qtextcursor.cpp QT += testlib diff --git a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp index 9396cd678b..1ecc3f2eae 100644 --- a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp +++ b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp @@ -175,7 +175,7 @@ void tst_QTextCursor::navigation1() { cursor.insertText("Hello World"); - QVERIFY(doc->toPlainText() == "Hello World"); + QCOMPARE(doc->toPlainText(), QLatin1String("Hello World")); cursor.movePosition(QTextCursor::End); QCOMPARE(cursor.position(), 11); @@ -205,7 +205,7 @@ void tst_QTextCursor::navigation1() doc->undo(); doc->undo(); - QVERIFY(doc->toPlainText() == "Hello World"); + QCOMPARE(doc->toPlainText(), QLatin1String("Hello World")); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, 6); diff --git a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro index 42c6406fdb..5d31ee3930 100644 --- a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro +++ b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextdocumentlayout QT += testlib qtHaveModule(widgets) QT += widgets diff --git a/tests/auto/gui/text/qtextformat/qtextformat.pro b/tests/auto/gui/text/qtextformat/qtextformat.pro index c64d266916..bf909bafd2 100644 --- a/tests/auto/gui/text/qtextformat/qtextformat.pro +++ b/tests/auto/gui/text/qtextformat/qtextformat.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextformat QT += testlib core-private gui-private SOURCES += tst_qtextformat.cpp diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index de0c2d6dbe..60ad5d32f5 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -1123,10 +1123,10 @@ void tst_QTextLayout::boundingRectTopLeft() void tst_QTextLayout::graphemeBoundaryForSurrogatePairs() { QString txt; - txt.append("a"); + txt.append(QLatin1Char('a')); txt.append(0xd87e); txt.append(0xdc25); - txt.append("b"); + txt.append(QLatin1Char('b')); QTextLayout layout(txt); QTextEngine *engine = layout.engine(); const QCharAttributes *attrs = engine->attributes(); diff --git a/tests/auto/gui/text/qtextlist/qtextlist.pro b/tests/auto/gui/text/qtextlist/qtextlist.pro index b837f1f81b..e9ca3ad0a0 100644 --- a/tests/auto/gui/text/qtextlist/qtextlist.pro +++ b/tests/auto/gui/text/qtextlist/qtextlist.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextlist QT += core-private gui-private testlib diff --git a/tests/auto/gui/text/qtextobject/qtextobject.pro b/tests/auto/gui/text/qtextobject/qtextobject.pro index b2bf793e8e..3c69757410 100644 --- a/tests/auto/gui/text/qtextobject/qtextobject.pro +++ b/tests/auto/gui/text/qtextobject/qtextobject.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextobject QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro b/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro index 2179fcbdf8..756073e171 100644 --- a/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro +++ b/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextscriptengine QT += core-private gui-private testlib diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 2595bba2a9..37b815c2e3 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -130,7 +130,7 @@ struct ShapeTable { static void prepareShapingTest(const QFont &font, const ShapeTable *shape_table) { for (const ShapeTable *s = shape_table; s->unicode[0]; ++s) { - QByteArray testName = font.family().toLatin1() + ":"; + QByteArray testName = font.family().toLatin1() + ':'; QString string; for (const ushort *u = s->unicode; *u; ++u) { string.append(QChar(*u)); diff --git a/tests/auto/gui/text/qtexttable/qtexttable.pro b/tests/auto/gui/text/qtexttable/qtexttable.pro index 1e7249090a..2faadfcb0d 100644 --- a/tests/auto/gui/text/qtexttable/qtexttable.pro +++ b/tests/auto/gui/text/qtexttable/qtexttable.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtexttable QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro b/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro index 162cc796e5..f5fb11effd 100644 --- a/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test QT += testlib SOURCES += tst_qdesktopservices.cpp diff --git a/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro b/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro index 9f04bdbb60..955369527f 100644 --- a/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro +++ b/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdoublevalidator QT += testlib SOURCES += tst_qdoublevalidator.cpp diff --git a/tests/auto/gui/util/qintvalidator/qintvalidator.pro b/tests/auto/gui/util/qintvalidator/qintvalidator.pro index 4bc35416b5..52e0b85735 100644 --- a/tests/auto/gui/util/qintvalidator/qintvalidator.pro +++ b/tests/auto/gui/util/qintvalidator/qintvalidator.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qintvalidator SOURCES += tst_qintvalidator.cpp QT += testlib diff --git a/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro b/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro index 5b70d7b11d..8f1de5b747 100644 --- a/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro +++ b/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qregexpvalidator SOURCES += tst_qregexpvalidator.cpp QT += testlib diff --git a/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro b/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro index 1e8e50563e..ab76cef3d1 100644 --- a/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro +++ b/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qregularexpressionvalidator SOURCES += tst_qregularexpressionvalidator.cpp QT += testlib diff --git a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro index 4772af9af9..1874f001ab 100644 --- a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstractnetworkcache QT = core network testlib SOURCES += tst_qabstractnetworkcache.cpp diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index 795548ccc8..8b5dd40d3e 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -2048,10 +2048,10 @@ bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user addCommand( QFtp::ConnectToHost, ftp->connectToHost( host, port ) ); addCommand( QFtp::Login, ftp->login( user, password ) ); - if ( dirToCreate.startsWith( "/" ) ) + if ( dirToCreate.startsWith( QLatin1Char('/') ) ) addCommand( QFtp::Cd, ftp->cd( dirToCreate ) ); else - addCommand( QFtp::Cd, ftp->cd( cdDir + "/" + dirToCreate ) ); + addCommand( QFtp::Cd, ftp->cd( cdDir + QLatin1Char('/') + dirToCreate ) ); addCommand( QFtp::Close, ftp->close() ); inFileDirExistsFunction = true; diff --git a/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro index fa19fa7ac9..bd20fd33dd 100644 --- a/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qhttpnetworkconnection SOURCES += tst_qhttpnetworkconnection.cpp requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro index f5dbc7f010..1810a38f6e 100644 --- a/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro +++ b/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qhttpnetworkreply SOURCES += tst_qhttpnetworkreply.cpp requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/network/access/qnetworkaccessmanager/qnetworkaccessmanager.pro b/tests/auto/network/access/qnetworkaccessmanager/qnetworkaccessmanager.pro index 8b3de90f54..e84f9f7dba 100644 --- a/tests/auto/network/access/qnetworkaccessmanager/qnetworkaccessmanager.pro +++ b/tests/auto/network/access/qnetworkaccessmanager/qnetworkaccessmanager.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkaccessmanager SOURCES += tst_qnetworkaccessmanager.cpp QT = core network testlib diff --git a/tests/auto/network/access/qnetworkcachemetadata/qnetworkcachemetadata.pro b/tests/auto/network/access/qnetworkcachemetadata/qnetworkcachemetadata.pro index d308c286fb..0e942cd4f4 100644 --- a/tests/auto/network/access/qnetworkcachemetadata/qnetworkcachemetadata.pro +++ b/tests/auto/network/access/qnetworkcachemetadata/qnetworkcachemetadata.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkcachemetadata QT = core network testlib SOURCES += tst_qnetworkcachemetadata.cpp diff --git a/tests/auto/network/access/qnetworkcookie/qnetworkcookie.pro b/tests/auto/network/access/qnetworkcookie/qnetworkcookie.pro index ba3ece8576..320e3a81c5 100644 --- a/tests/auto/network/access/qnetworkcookie/qnetworkcookie.pro +++ b/tests/auto/network/access/qnetworkcookie/qnetworkcookie.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkcookie SOURCES += tst_qnetworkcookie.cpp diff --git a/tests/auto/network/access/qnetworkcookiejar/qnetworkcookiejar.pro b/tests/auto/network/access/qnetworkcookiejar/qnetworkcookiejar.pro index bb39f83af6..4c955f38f0 100644 --- a/tests/auto/network/access/qnetworkcookiejar/qnetworkcookiejar.pro +++ b/tests/auto/network/access/qnetworkcookiejar/qnetworkcookiejar.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkcookiejar SOURCES += tst_qnetworkcookiejar.cpp diff --git a/tests/auto/network/access/qnetworkdiskcache/qnetworkdiskcache.pro b/tests/auto/network/access/qnetworkdiskcache/qnetworkdiskcache.pro index 7e26abbe08..4a78544bf8 100644 --- a/tests/auto/network/access/qnetworkdiskcache/qnetworkdiskcache.pro +++ b/tests/auto/network/access/qnetworkdiskcache/qnetworkdiskcache.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkdiskcache QT = core network testlib SOURCES += tst_qnetworkdiskcache.cpp diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index fbeeec2ec4..55e17b142a 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -2780,7 +2780,7 @@ void tst_QNetworkReply::postToHttpsMultipart() // hack for testing the setting of the content-type header by hand: if (contentType == "custom") { - QByteArray contentType("multipart/custom; boundary=\"" + multiPart->boundary() + "\""); + QByteArray contentType("multipart/custom; boundary=\"" + multiPart->boundary() + '"'); request.setHeader(QNetworkRequest::ContentTypeHeader, contentType); } @@ -2932,7 +2932,7 @@ void tst_QNetworkReply::connectToIPv6Address() QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply)); QByteArray content = reply->readAll(); //qDebug() << server.receivedData; - QByteArray hostinfo = "\r\nHost: " + hostfield + ":" + QByteArray::number(server.serverPort()) + "\r\n"; + QByteArray hostinfo = "\r\nHost: " + hostfield + ':' + QByteArray::number(server.serverPort()) + "\r\n"; QVERIFY(server.receivedData.contains(hostinfo)); QCOMPARE(content, dataToSend); QCOMPARE(reply->url(), request.url()); @@ -4943,7 +4943,7 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp() const int allowedDeviation = 16; // TODO find out why the send rate is 13% faster currently const int minRate = rate * 1024 * (100-allowedDeviation) / 100; const int maxRate = rate * 1024 * (100+allowedDeviation) / 100; - qDebug() << minRate << "<="<< server.transferRate << "<=" << maxRate << "?"; + qDebug() << minRate << "<="<< server.transferRate << "<=" << maxRate << '?'; // The test takes too long to run if sending enough data to overwhelm the // reciever's kernel buffers. //QEXPECT_FAIL("http+limited", "Limiting is broken right now, check QTBUG-15065", Continue); @@ -5519,7 +5519,7 @@ void tst_QNetworkReply::sendCookies_data() list.clear(); cookie = QNetworkCookie("a", "b"); cookie.setPath("/"); - cookie.setDomain("." + QtNetworkSettings::serverDomainName()); + cookie.setDomain(QLatin1Char('.') + QtNetworkSettings::serverDomainName()); list << cookie; QTest::newRow("domain-match") << list << "a=b"; @@ -5852,7 +5852,7 @@ void tst_QNetworkReply::httpConnectionCount() QCoreApplication::instance()->processEvents(); for (int i = 0; i < 10; i++) { - QNetworkRequest request (QUrl("http://127.0.0.1:" + QString::number(server.serverPort()) + "/" + QString::number(i))); + QNetworkRequest request (QUrl("http://127.0.0.1:" + QString::number(server.serverPort()) + QLatin1Char('/') + QString::number(i))); QNetworkReply* reply = manager.get(request); reply->setParent(&server); } diff --git a/tests/auto/network/access/qnetworkrequest/qnetworkrequest.pro b/tests/auto/network/access/qnetworkrequest/qnetworkrequest.pro index 0470d96b8c..c00c2c30a2 100644 --- a/tests/auto/network/access/qnetworkrequest/qnetworkrequest.pro +++ b/tests/auto/network/access/qnetworkrequest/qnetworkrequest.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkrequest SOURCES += tst_qnetworkrequest.cpp diff --git a/tests/auto/network/access/spdy/spdy.pro b/tests/auto/network/access/spdy/spdy.pro index 23efa85b47..cdbe60a19b 100644 --- a/tests/auto/network/access/spdy/spdy.pro +++ b/tests/auto/network/access/spdy/spdy.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_spdy SOURCES += tst_spdy.cpp QT = core core-private network network-private testlib -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 win32:CONFIG += insignificant_test # QTBUG-47128 diff --git a/tests/auto/network/kernel/qdnslookup/qdnslookup.pro b/tests/auto/network/kernel/qdnslookup/qdnslookup.pro index 3727736fad..f14ffd003e 100644 --- a/tests/auto/network/kernel/qdnslookup/qdnslookup.pro +++ b/tests/auto/network/kernel/qdnslookup/qdnslookup.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdnslookup diff --git a/tests/auto/network/kernel/qdnslookup_appless/qdnslookup_appless.pro b/tests/auto/network/kernel/qdnslookup_appless/qdnslookup_appless.pro index 0515bbad3b..25d76b5739 100644 --- a/tests/auto/network/kernel/qdnslookup_appless/qdnslookup_appless.pro +++ b/tests/auto/network/kernel/qdnslookup_appless/qdnslookup_appless.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdnslookup_appless diff --git a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro index f349cab976..19d74dfd9b 100644 --- a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro +++ b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qhostaddress SOURCES += tst_qhostaddress.cpp diff --git a/tests/auto/network/kernel/qnetworkaddressentry/qnetworkaddressentry.pro b/tests/auto/network/kernel/qnetworkaddressentry/qnetworkaddressentry.pro index ae207e9c79..427f2e0f19 100644 --- a/tests/auto/network/kernel/qnetworkaddressentry/qnetworkaddressentry.pro +++ b/tests/auto/network/kernel/qnetworkaddressentry/qnetworkaddressentry.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkaddressentry SOURCES += tst_qnetworkaddressentry.cpp diff --git a/tests/auto/network/kernel/qnetworkinterface/qnetworkinterface.pro b/tests/auto/network/kernel/qnetworkinterface/qnetworkinterface.pro index 79279514d1..694dec2ed7 100644 --- a/tests/auto/network/kernel/qnetworkinterface/qnetworkinterface.pro +++ b/tests/auto/network/kernel/qnetworkinterface/qnetworkinterface.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkinterface SOURCES += tst_qnetworkinterface.cpp diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp index f7798bbb70..64623df960 100644 --- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp +++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp @@ -141,7 +141,7 @@ void tst_QNetworkInterface::dump() s.nospace() << ": " << qPrintable(e.ip().toString()); if (!e.netmask().isNull()) s.nospace() << '/' << e.prefixLength() - << " (" << qPrintable(e.netmask().toString()) << ")"; + << " (" << qPrintable(e.netmask().toString()) << ')'; if (!e.broadcast().isNull()) s.nospace() << " broadcast " << qPrintable(e.broadcast().toString()); } diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro b/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro index c63c7742a1..ed73e3e10e 100644 --- a/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro +++ b/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkproxyfactory QT = core network testlib diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 847e065aa8..8d6bfc1f1b 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -189,7 +189,7 @@ private slots: } void slotError(QLocalSocket::LocalSocketError newError) { - QVERIFY(errorString() != "Unknown error"); + QVERIFY(errorString() != QLatin1String("Unknown error")); QCOMPARE(error(), newError); } void slotStateChanged(QLocalSocket::LocalSocketState newState) @@ -534,7 +534,7 @@ void tst_QLocalSocket::sendData() if (server.hasPendingConnections()) { QString testLine = "test"; for (int i = 0; i < 50000; ++i) - testLine += "a"; + testLine += QLatin1Char('a'); QLocalSocket *serverSocket = server.nextPendingConnection(); QVERIFY(serverSocket); QCOMPARE(serverSocket->state(), QLocalSocket::ConnectedState); @@ -1205,7 +1205,7 @@ void tst_QLocalSocket::verifyListenWithDescriptor() QVERIFY2(server.fullServerName().at(0) == at, "abstract sockets should start with a '@'"); } else { QCOMPARE(server.fullServerName(), path); - if (path.contains(QLatin1String("/"))) { + if (path.contains(QLatin1Char('/'))) { QVERIFY2(server.serverName() == path.mid(path.lastIndexOf(QLatin1Char('/'))+1), "server name invalid short name"); } else { QVERIFY2(server.serverName() == path, "servier name doesn't match the path provided"); diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp index 8da656aab7..bd43961ea2 100644 --- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -613,8 +613,8 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest() // Read greeting QVERIFY(socket.waitForReadyRead(5000)); - QString s = socket.readLine(); - QVERIFY2(QtNetworkSettings::compareReplyIMAP(s.toLatin1()), s.toLatin1().constData()); + QByteArray s = socket.readLine(); + QVERIFY2(QtNetworkSettings::compareReplyIMAP(s), s.constData()); // Write NOOP QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); @@ -624,7 +624,7 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest() // Read response s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), "1 OK Completed\r\n"); + QCOMPARE(s, QByteArrayLiteral("1 OK Completed\r\n")); // Write LOGOUT QCOMPARE((int) socket.write("2 LOGOUT\r\n", 10), 10); @@ -634,13 +634,13 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest() // Read two lines of respose s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), "* BYE LOGOUT received\r\n"); + QCOMPARE(s, QByteArrayLiteral("* BYE LOGOUT received\r\n")); if (!socket.canReadLine()) QVERIFY(socket.waitForReadyRead(5000)); s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), "2 OK Completed\r\n"); + QCOMPARE(s, QByteArrayLiteral("2 OK Completed\r\n")); // Close the socket socket.close(); @@ -715,7 +715,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest() // Read response QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); - QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), "1 OK Completed\r\n"); + QCOMPARE(tcpSocketNonBlocking_data.at(0), QLatin1String("1 OK Completed\r\n")); tcpSocketNonBlocking_data.clear(); diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index abbc560414..a5ba405dd4 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -201,6 +201,7 @@ private slots: void setSocketOption(); void clientSendDataOnDelayedDisconnect(); void serverDisconnectWithBuffered(); + void socketDiscardDataInWriteMode(); protected slots: void nonBlockingIMAP_hostFound(); @@ -1775,7 +1776,7 @@ void tst_QTcpSocket::atEnd() // Test server must use some vsFTPd 2.x.x version QVERIFY2(greeting.length() == sizeof("220 (vsFTPd 2.x.x)")-1, qPrintable(greeting)); QVERIFY2(greeting.startsWith("220 (vsFTPd 2."), qPrintable(greeting)); - QVERIFY2(greeting.endsWith(")"), qPrintable(greeting)); + QVERIFY2(greeting.endsWith(QLatin1Char(')')), qPrintable(greeting)); delete socket; } @@ -3028,5 +3029,36 @@ void tst_QTcpSocket::serverDisconnectWithBuffered() delete socket; } +// Test buffered sockets discard input when opened in WriteOnly mode +void tst_QTcpSocket::socketDiscardDataInWriteMode() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + QTcpServer tcpServer; + QTcpSocket *socket = newSocket(); + + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + socket->connectToHost(tcpServer.serverAddress(), tcpServer.serverPort(), + QIODevice::WriteOnly); + QVERIFY(socket->waitForConnected(5000)); // ready for write + QCOMPARE(socket->state(), QAbstractSocket::ConnectedState); + + // Accept connection on server side + QVERIFY2(tcpServer.waitForNewConnection(5000), "Network timeout"); + QTcpSocket *newConnection = tcpServer.nextPendingConnection(); + // Send one char and drop link + QVERIFY(newConnection != NULL); + QVERIFY(newConnection->putChar(0)); + QVERIFY(newConnection->flush()); + delete newConnection; + + QVERIFY(socket->waitForReadyRead(5000)); // discard input + QVERIFY(socket->atEnd()); + + delete socket; +} + QTEST_MAIN(tst_QTcpSocket) #include "tst_qtcpsocket.moc" diff --git a/tests/auto/network/ssl/qasn1element/qasn1element.pro b/tests/auto/network/ssl/qasn1element/qasn1element.pro index 524c772443..006ac3428c 100644 --- a/tests/auto/network/ssl/qasn1element/qasn1element.pro +++ b/tests/auto/network/ssl/qasn1element/qasn1element.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qasn1element.cpp QT = core network network-private testlib diff --git a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro index 26d6424a97..87a210c051 100644 --- a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qsslcertificate.cpp !wince:win32:LIBS += -lws2_32 diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index 4c288fffaf..0c217195a0 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -844,7 +844,7 @@ void tst_QSslCertificate::nulInCN() QVERIFY(!cert.isNull()); QString cn = cert.subjectInfo(QSslCertificate::CommonName)[0]; - QVERIFY(cn != "www.bank.com"); + QVERIFY(cn != QLatin1String("www.bank.com")); static const char realCN[] = "www.bank.com\0.badguy.com"; QCOMPARE(cn, QString::fromLatin1(realCN, sizeof realCN - 1)); @@ -1064,7 +1064,7 @@ QString tst_QSslCertificate::toString(const QList<QSslError>& errors) QStringList errorStrings; foreach (const QSslError& error, errors) { - errorStrings.append(QLatin1String("\"") + error.errorString() + QLatin1String("\"")); + errorStrings.append(QLatin1Char('"') + error.errorString() + QLatin1Char('"')); } return QLatin1String("[ ") + errorStrings.join(QLatin1String(", ")) + QLatin1String(" ]"); diff --git a/tests/auto/network/ssl/qsslcipher/qsslcipher.pro b/tests/auto/network/ssl/qsslcipher/qsslcipher.pro index 36e3c29b31..4cb2dfebab 100644 --- a/tests/auto/network/ssl/qsslcipher/qsslcipher.pro +++ b/tests/auto/network/ssl/qsslcipher/qsslcipher.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qsslcipher.cpp win32:!wince: LIBS += -lws2_32 diff --git a/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro b/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro index 747bb55ade..e67b64b2b7 100644 --- a/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro +++ b/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qsslellipticcurve.cpp win32:!wince: LIBS += -lws2_32 diff --git a/tests/auto/network/ssl/qsslerror/qsslerror.pro b/tests/auto/network/ssl/qsslerror/qsslerror.pro index 6b7090db99..7737aae3f1 100644 --- a/tests/auto/network/ssl/qsslerror/qsslerror.pro +++ b/tests/auto/network/ssl/qsslerror/qsslerror.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qsslerror.cpp win32:!wince: LIBS += -lws2_32 diff --git a/tests/auto/network/ssl/qsslkey/qsslkey.pro b/tests/auto/network/ssl/qsslkey/qsslkey.pro index a74f432890..7eb04793f3 100644 --- a/tests/auto/network/ssl/qsslkey/qsslkey.pro +++ b/tests/auto/network/ssl/qsslkey/qsslkey.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qsslkey.cpp win32:!wince: LIBS += -lws2_32 diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro index 4f216ebb37..ae911e43ed 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test testcase.timeout = 300 # this test is slow SOURCES += tst_qsslsocket_onDemandCertificates_member.cpp diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro index 96a6162ce6..25e5a5d5c7 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qsslsocket_onDemandCertificates_static.cpp win32:!wince: LIBS += -lws2_32 diff --git a/tests/auto/opengl/qgl/qgl.pro b/tests/auto/opengl/qgl/qgl.pro index 35b5c6888b..14c34c9ef0 100644 --- a/tests/auto/opengl/qgl/qgl.pro +++ b/tests/auto/opengl/qgl/qgl.pro @@ -11,5 +11,4 @@ SOURCES += tst_qgl.cpp RESOURCES = qgl.qrc linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = lucid ]"): CONFIG+=insignificant_test # QTBUG-25293 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 win32-msvc2010:contains(QT_CONFIG, angle):CONFIG += insignificant_test # QTQAINFRA-711 diff --git a/tests/auto/opengl/qglbuffer/qglbuffer.pro b/tests/auto/opengl/qglbuffer/qglbuffer.pro index 72117322da..f12a191f79 100644 --- a/tests/auto/opengl/qglbuffer/qglbuffer.pro +++ b/tests/auto/opengl/qglbuffer/qglbuffer.pro @@ -3,10 +3,8 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qglbuffer requires(qtHaveModule(opengl)) QT += opengl widgets testlib SOURCES += tst_qglbuffer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/opengl/qglfunctions/qglfunctions.pro b/tests/auto/opengl/qglfunctions/qglfunctions.pro index a512ea0dd9..3873efbbc5 100644 --- a/tests/auto/opengl/qglfunctions/qglfunctions.pro +++ b/tests/auto/opengl/qglfunctions/qglfunctions.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qglfunctions requires(qtHaveModule(opengl)) QT += opengl widgets testlib @@ -7,4 +6,3 @@ QT += opengl widgets testlib SOURCES += tst_qglfunctions.cpp win32:CONFIG+=insignificant_test # QTBUG-26390 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/opengl/qglthreads/qglthreads.pro b/tests/auto/opengl/qglthreads/qglthreads.pro index 3502c41c87..ab8bda741e 100644 --- a/tests/auto/opengl/qglthreads/qglthreads.pro +++ b/tests/auto/opengl/qglthreads/qglthreads.pro @@ -10,6 +10,5 @@ x11 { LIBS += $$QMAKE_LIBS_X11 } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -win32:CONFIG+=insignificant_test # QTBUG-28264 + diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index ff5a18dedb..7b7064529f 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -702,6 +702,9 @@ private: */ void tst_QGLThreads::painterOnGLWidgetInThread() { + //QTBUG-46446 tst_qglthreads is unstable on windows 7 + if (QGuiApplication::platformName().compare("windows 7", Qt::CaseInsensitive)) + QSKIP("Doesn't work on this platform. QTBUG-46446"); if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) QSKIP("No platformsupport for ThreadedOpenGL"); if (!((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) || @@ -746,6 +749,9 @@ void tst_QGLThreads::painterOnPixmapInThread() */ void tst_QGLThreads::painterOnPboInThread() { + //QTBUG-46446 tst_qglthreads is unstable on windows 7 + if (QGuiApplication::platformName().compare("windows 7", Qt::CaseInsensitive)) + QSKIP("Doesn't work on this platform. QTBUG-46446"); if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) QSKIP("No platformsupport for ThreadedOpenGL"); if (!((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) || @@ -773,6 +779,9 @@ void tst_QGLThreads::painterOnPboInThread() */ void tst_QGLThreads::painterOnFboInThread() { + //QTBUG-46446 tst_qglthreads is unstable on windows 7 + if (QGuiApplication::platformName().compare("windows 7", Qt::CaseInsensitive)) + QSKIP("Doesn't work on this platform. QTBUG-46446"); if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) QSKIP("No platformsupport for ThreadedOpenGL"); if (!((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) || diff --git a/tests/auto/other/atwrapper/atWrapper.cpp b/tests/auto/other/atwrapper/atWrapper.cpp index 4260ca18b8..a75a7b91bf 100644 --- a/tests/auto/other/atwrapper/atWrapper.cpp +++ b/tests/auto/other/atwrapper/atWrapper.cpp @@ -149,9 +149,10 @@ void atWrapper::ftpMgetDone( bool error) if ( mgetDirList.size() > 1 ) for ( int i = 1; i < mgetDirList.size(); ++i ) { - file = new QFile( QString( output ) + "/" + mgetDirList.at( 0 ) + "/" + mgetDirList.at( i ) ); + file = new QFile( QString( output ) + QLatin1Char('/') + mgetDirList.at( 0 ) + + QLatin1Char('/') + mgetDirList.at( i ) ); if (file->open(QIODevice::WriteOnly)) { - ftp.get( ftpBaseDir + "/" + mgetDirList.at( 0 ) + "/" + mgetDirList.at( i ), file ); + ftp.get( ftpBaseDir + QLatin1Char('/') + mgetDirList.at( 0 ) + QLatin1Char('/') + mgetDirList.at( i ), file ); ftp.list(); //Only there to fill up a slot in the pendingCommands queue. while ( ftp.hasPendingCommands() ) QCoreApplication::instance()->processEvents(); @@ -192,11 +193,11 @@ bool atWrapper::setupFTP() QString dir = ""; ftpMkDir( ftpBaseDir ); - ftpBaseDir += "/" + QLibraryInfo::buildKey(); + ftpBaseDir += QLatin1Char('/') + QLibraryInfo::buildKey(); ftpMkDir( ftpBaseDir ); - ftpBaseDir += "/" + QString( qVersion() ); + ftpBaseDir += QLatin1Char('/') + QString( qVersion() ); ftpMkDir( ftpBaseDir ); @@ -209,9 +210,9 @@ bool atWrapper::setupFTP() { i.next(); //qDebug() << "Creating dir with key:" << i.key(); - ftpMkDir( ftpBaseDir + "/" + QString( i.key() ) + ".failed" ); - ftpMkDir( ftpBaseDir + "/" + QString( i.key() ) + ".diff" ); - if (!ftpMkDir( ftpBaseDir + "/" + QString( i.key() ) + ".baseline" )) + ftpMkDir( ftpBaseDir + QLatin1Char('/') + QString( i.key() ) + ".failed" ); + ftpMkDir( ftpBaseDir + QLatin1Char('/') + QString( i.key() ) + ".diff" ); + if (!ftpMkDir( ftpBaseDir + QLatin1Char('/') + QString( i.key() ) + ".baseline" )) haveBaseline = false; } @@ -226,7 +227,7 @@ bool atWrapper::setupFTP() { j.next(); rmDirList.clear(); - rmDirList << ftpBaseDir + "/" + j.key() + ".failed" + "/"; + rmDirList << ftpBaseDir + QLatin1Char('/') + j.key() + ".failed/"; ftpRmDir( j.key() + ".failed" ); ftp.rmdir( j.key() + ".failed" ); ftp.mkdir( j.key() + ".failed" ); @@ -236,7 +237,7 @@ bool atWrapper::setupFTP() QCoreApplication::instance()->processEvents(); rmDirList.clear(); - rmDirList << ftpBaseDir + "/" + j.key() + ".diff" + "/"; + rmDirList << ftpBaseDir + QLatin1Char('/') + j.key() + ".diff/"; ftpRmDir( j.key() + ".diff" ); ftp.rmdir( j.key() + ".diff" ); ftp.mkdir( j.key() + ".diff" ); @@ -396,7 +397,7 @@ void atWrapper::createBaseline() for (int n = 0; n < list.size(); n++) { QFileInfo fileInfo = list.at( n ); - QFile file( QString( output ) + "/" + i.key() + "/" + fileInfo.fileName() ); + QFile file( QString( output ) + QLatin1Char('/') + i.key() + QLatin1Char('/') + fileInfo.fileName() ); file.open( QIODevice::ReadOnly ); QByteArray fileData = file.readAll(); //qDebug() << "Sending up:" << fileInfo.fileName() << "with file size" << fileData.size(); @@ -470,9 +471,9 @@ bool atWrapper::diff( QString basedir, QString dir, QString target ) //Comparing the two specified files, and then uploading them to //the ftp server if they differ - basedir += "/" + dir; + basedir += QLatin1Char('/') + dir; QString one = basedir + ".baseline/" + target; - QString two = basedir + "/" + target; + QString two = basedir + QLatin1Char('/') + target; QFile file( one ); @@ -517,7 +518,7 @@ void atWrapper::uploadDiff( QString basedir, QString dir, QString filename ) qDebug() << basedir; QImage im1( basedir + ".baseline/" + filename ); - QImage im2( basedir + "/" + filename ); + QImage im2( basedir + QLatin1Char('/') + filename ); QImage im3(im1.size(), QImage::Format_ARGB32); @@ -591,16 +592,16 @@ bool atWrapper::loadConfig( QString path ) QDir::current().mkdir( output ); - output += "/" + QLibraryInfo::buildKey(); + output += QLatin1Char('/') + QLibraryInfo::buildKey(); QDir::current().mkdir( output ); - output += "/" + QString( qVersion() ); + output += QLatin1Char('/') + QString( qVersion() ); QDir::current().mkdir( output ); - ftpBaseDir += "/" + QHostInfo::localHostName().split( "." ).first(); + ftpBaseDir += QLatin1Char('/') + QHostInfo::localHostName().split( QLatin1Char('.') ).first(); /* diff --git a/tests/auto/other/compiler/compiler.pro b/tests/auto/other/compiler/compiler.pro index 213429050f..57871429d2 100644 --- a/tests/auto/other/compiler/compiler.pro +++ b/tests/auto/other/compiler/compiler.pro @@ -6,4 +6,3 @@ QT = core testlib contains(QT_CONFIG, c++11): CONFIG += c++14 c++11 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/gestures/gestures.pro b/tests/auto/other/gestures/gestures.pro index fa87dbddfb..3d0ef7c745 100644 --- a/tests/auto/other/gestures/gestures.pro +++ b/tests/auto/other/gestures/gestures.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_gestures QT += widgets testlib gui-private SOURCES += tst_gestures.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp index 2a4f88c627..851edaeb19 100644 --- a/tests/auto/other/gestures/tst_gestures.cpp +++ b/tests/auto/other/gestures/tst_gestures.cpp @@ -36,6 +36,7 @@ #include <QtTest/qtesttouch.h> #include <qevent.h> +#include <qtouchdevice.h> #include <qwidget.h> #include <qlayout.h> #include <qgesture.h> diff --git a/tests/auto/other/lancelot/lancelot.pro b/tests/auto/other/lancelot/lancelot.pro index ef557691e3..6e79566649 100644 --- a/tests/auto/other/lancelot/lancelot.pro +++ b/tests/auto/other/lancelot/lancelot.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle TARGET = tst_lancelot QT += xml widgets testlib @@ -12,4 +11,3 @@ RESOURCES += images.qrc include($$PWD/../../../baselineserver/shared/qbaselinetest.pri) TESTDATA += scripts/* -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/languagechange/languagechange.pro b/tests/auto/other/languagechange/languagechange.pro index 0b9c04d2ed..7dbd47f63d 100644 --- a/tests/auto/other/languagechange/languagechange.pro +++ b/tests/auto/other/languagechange/languagechange.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test win32:testcase.timeout = 1800 # test runtime varies greatly on Windows, QTBUG-26006 TARGET = tst_languagechange QT += widgets core-private gui-private testlib SOURCES += tst_languagechange.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp index 68d604547d..493e279e18 100644 --- a/tests/auto/other/languagechange/tst_languagechange.cpp +++ b/tests/auto/other/languagechange/tst_languagechange.cpp @@ -253,7 +253,7 @@ void tst_languageChange::retranslatability() switch (dialogType) { case InputDialog: stateMachine.start(); - QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label")); + QInputDialog::getInt(0, QLatin1String("title"), QLatin1String("label")); break; case ColorDialog: diff --git a/tests/auto/other/macgui/macgui.pro b/tests/auto/other/macgui/macgui.pro index bf805ccd75..b557806555 100644 --- a/tests/auto/other/macgui/macgui.pro +++ b/tests/auto/other/macgui/macgui.pro @@ -7,4 +7,3 @@ HEADERS += guitest.h QT = core-private widgets-private testlib requires(mac) -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/macnativeevents/qnativeevents.cpp b/tests/auto/other/macnativeevents/qnativeevents.cpp index 1402182042..db8f2bd193 100644 --- a/tests/auto/other/macnativeevents/qnativeevents.cpp +++ b/tests/auto/other/macnativeevents/qnativeevents.cpp @@ -222,46 +222,46 @@ QDebug operator<<(QDebug d, const QNativeEvent &e) QTextStream &operator<<(QTextStream &s, QNativeEvent *e) { - return s << e->eventId << " " << e->modifiers << " QNativeEvent"; + return s << e->eventId << ' ' << e->modifiers << " QNativeEvent"; } QTextStream &operator<<(QTextStream &s, QNativeMouseEvent *e) { - return s << e->eventId << " " << e->globalPos.x() << " " << e->globalPos.y() << " " << e->modifiers << " " << e->toString(); + return s << e->eventId << ' ' << e->globalPos.x() << ' ' << e->globalPos.y() << ' ' << e->modifiers << ' ' << e->toString(); } QTextStream &operator<<(QTextStream &s, QNativeMouseMoveEvent *e) { - return s << e->eventId << " " << e->globalPos.x() << " " << e->globalPos.y() << " " << e->modifiers << " " << e->toString(); + return s << e->eventId << ' ' << e->globalPos.x() << ' ' << e->globalPos.y() << ' ' << e->modifiers << ' ' << e->toString(); } QTextStream &operator<<(QTextStream &s, QNativeMouseButtonEvent *e) { - return s << e->eventId << " " << e->globalPos.x() << " " << e->globalPos.y() << " " << e->button - << " " << e->clickCount << " " << e->modifiers << " " << e->toString(); + return s << e->eventId << ' ' << e->globalPos.x() << ' ' << e->globalPos.y() << ' ' << e->button + << ' ' << e->clickCount << ' ' << e->modifiers << ' ' << e->toString(); } QTextStream &operator<<(QTextStream &s, QNativeMouseDragEvent *e) { - return s << e->eventId << " " << e->globalPos.x() << " " << e->globalPos.y() << " " << e->button << " " << e->clickCount - << " " << e->modifiers << " " << e->toString(); + return s << e->eventId << ' ' << e->globalPos.x() << ' ' << e->globalPos.y() << ' ' << e->button << ' ' << e->clickCount + << ' ' << e->modifiers << ' ' << e->toString(); } QTextStream &operator<<(QTextStream &s, QNativeMouseWheelEvent *e) { - return s << e->eventId << " " << e->globalPos.x() << " " << e->globalPos.y() << " " << e->delta - << " " << e->modifiers << " " << e->toString(); + return s << e->eventId << ' ' << e->globalPos.x() << ' ' << e->globalPos.y() << ' ' << e->delta + << ' ' << e->modifiers << ' ' << e->toString(); } QTextStream &operator<<(QTextStream &s, QNativeKeyEvent *e) { - return s << e->eventId << " " << e->press << " " << e->nativeKeyCode << " " << e->character - << " " << e->modifiers << " " << e->toString(); + return s << e->eventId << ' ' << e->press << ' ' << e->nativeKeyCode << ' ' << e->character + << ' ' << e->modifiers << ' ' << e->toString(); } QTextStream &operator<<(QTextStream &s, QNativeModifierEvent *e) { - return s << e->eventId << " " << e->modifiers << " " << e->nativeKeyCode << " " << e->toString(); + return s << e->eventId << ' ' << e->modifiers << ' ' << e->nativeKeyCode << ' ' << e->toString(); } diff --git a/tests/auto/other/macplist/app/app.pro b/tests/auto/other/macplist/app/app.pro index c4dfedb104..9ccac831d0 100644 --- a/tests/auto/other/macplist/app/app.pro +++ b/tests/auto/other/macplist/app/app.pro @@ -1,4 +1,3 @@ QT += widgets SOURCES += main.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/macplist/test/test.pro b/tests/auto/other/macplist/test/test.pro index 6dad17ab67..5018abeca9 100644 --- a/tests/auto/other/macplist/test/test.pro +++ b/tests/auto/other/macplist/test/test.pro @@ -10,4 +10,3 @@ win32 { TARGET = ../../release/tst_macplist } } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/modeltest/dynamictreemodel.cpp b/tests/auto/other/modeltest/dynamictreemodel.cpp index c7cf04231f..bdf2b604fd 100644 --- a/tests/auto/other/modeltest/dynamictreemodel.cpp +++ b/tests/auto/other/modeltest/dynamictreemodel.cpp @@ -299,7 +299,8 @@ bool ModelResetCommand::emitPreSignal(const QModelIndex &srcParent, int srcStart void ModelResetCommand::emitPostSignal() { - m_model->reset(); + m_model->beginResetModel(); + m_model->endResetModel(); } ModelResetCommandFixed::ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent) diff --git a/tests/auto/other/modeltest/modeltest.pro b/tests/auto/other/modeltest/modeltest.pro index 045299e095..8e96058449 100644 --- a/tests/auto/other/modeltest/modeltest.pro +++ b/tests/auto/other/modeltest/modeltest.pro @@ -3,7 +3,3 @@ TARGET = tst_modeltest QT += widgets testlib SOURCES += tst_modeltest.cpp modeltest.cpp dynamictreemodel.cpp HEADERS += modeltest.h dynamictreemodel.h - - - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/networkselftest/networkselftest.pro b/tests/auto/other/networkselftest/networkselftest.pro index 22208e02fb..c387ca2e84 100644 --- a/tests/auto/other/networkselftest/networkselftest.pro +++ b/tests/auto/other/networkselftest/networkselftest.pro @@ -5,4 +5,3 @@ SOURCES += tst_networkselftest.cpp QT = core core-private network testlib win32:CONFIG += insignificant_test # QTBUG-27571 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro index 1d6fc6bcd1..ef3b469ba1 100644 --- a/tests/auto/other/qaccessibility/qaccessibility.pro +++ b/tests/auto/other/qaccessibility/qaccessibility.pro @@ -21,4 +21,3 @@ win32 { LIBS += -luuid !winphone: LIBS += -loleacc -loleaut32 -lole32 } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 62c2c0a916..142b62ac68 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1763,7 +1763,7 @@ void tst_QAccessibility::textEditTest() } edit.show(); - QTest::qWaitForWindowShown(&edit); + QTest::qWaitForWindowExposed(&edit); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&edit); QCOMPARE(iface->text(QAccessible::Value), edit.toPlainText()); QVERIFY(iface->state().focusable); @@ -2175,7 +2175,7 @@ void tst_QAccessibility::lineEditTest() QLineEdit le(QStringLiteral("My characters have geometries."), toplevel); // characterRect() le.show(); - QTest::qWaitForWindowShown(&le); + QTest::qWaitForWindowExposed(&le); QAccessibleInterface *iface(QAccessible::queryAccessibleInterface(&le)); QAccessibleTextInterface* textIface = iface->textInterface(); QVERIFY(textIface); @@ -3576,7 +3576,7 @@ void tst_QAccessibility::comboBoxTest() // Fully decorated windows have a minimum width of 160 on Windows. combo.setMinimumWidth(200); combo.show(); - QVERIFY(QTest::qWaitForWindowShown(&combo)); + QVERIFY(QTest::qWaitForWindowExposed(&combo)); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&combo); QCOMPARE(verifyHierarchy(iface), 0); diff --git a/tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro b/tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro index 5d81567f45..ceed81c914 100644 --- a/tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro +++ b/tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro @@ -13,4 +13,3 @@ mac { requires(mac) -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm index 3056904dcf..5f6826e7f7 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -42,7 +42,7 @@ #include <QtTest> #include <unistd.h> -#import <Cocoa/Cocoa.h> +#import <AppKit/AppKit.h> #import <ApplicationServices/ApplicationServices.h> QT_USE_NAMESPACE diff --git a/tests/auto/other/qcomplextext/qcomplextext.pro b/tests/auto/other/qcomplextext/qcomplextext.pro index 28acc397bf..98dbd3b214 100644 --- a/tests/auto/other/qcomplextext/qcomplextext.pro +++ b/tests/auto/other/qcomplextext/qcomplextext.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qcomplextext QT += testlib QT += core-private gui-private SOURCES += tst_qcomplextext.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qfocusevent/qfocusevent.pro b/tests/auto/other/qfocusevent/qfocusevent.pro index c6e31d2e50..5f799291c6 100644 --- a/tests/auto/other/qfocusevent/qfocusevent.pro +++ b/tests/auto/other/qfocusevent/qfocusevent.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qfocusevent QT += widgets testlib SOURCES += tst_qfocusevent.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro index e34990d513..b03a448dfb 100644 --- a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro +++ b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro @@ -1,6 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qnetworkaccessmanager_and_qprogressdialog SOURCES += tst_qnetworkaccessmanager_and_qprogressdialog.cpp QT += network widgets testlib -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qobjectperformance/qobjectperformance.pro b/tests/auto/other/qobjectperformance/qobjectperformance.pro index 78423bee9c..189f8eeb2a 100644 --- a/tests/auto/other/qobjectperformance/qobjectperformance.pro +++ b/tests/auto/other/qobjectperformance/qobjectperformance.pro @@ -5,4 +5,3 @@ SOURCES += tst_qobjectperformance.cpp QT = core network testlib -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qobjectrace/qobjectrace.pro b/tests/auto/other/qobjectrace/qobjectrace.pro index b5848edb01..94e7928585 100644 --- a/tests/auto/other/qobjectrace/qobjectrace.pro +++ b/tests/auto/other/qobjectrace/qobjectrace.pro @@ -2,6 +2,3 @@ CONFIG += testcase SOURCES += tst_qobjectrace.cpp QT = core testlib -TARGET.EPOCHEAPSIZE = 20000000 40000000 -CONFIG += parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qprocess_and_guieventloop/test.pro b/tests/auto/other/qprocess_and_guieventloop/test.pro index 54d6f194b0..50c4e1d72b 100644 --- a/tests/auto/other/qprocess_and_guieventloop/test.pro +++ b/tests/auto/other/qprocess_and_guieventloop/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test QT = core gui testlib SOURCES = tst_qprocess_and_guieventloop.cpp TARGET = tst_qprocess_and_guieventloop diff --git a/tests/auto/other/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro b/tests/auto/other/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro index c7a4f3e216..722f575f80 100644 --- a/tests/auto/other/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro +++ b/tests/auto/other/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsharedpointer_and_qwidget QT += widgets testlib SOURCES += tst_qsharedpointer_and_qwidget.cpp DEFINES += SRCDIR=\\\"$$PWD/\\\" -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qtokenautomaton/qtokenautomaton.pro b/tests/auto/other/qtokenautomaton/qtokenautomaton.pro index 2c0b3dae9b..e4d0160f80 100644 --- a/tests/auto/other/qtokenautomaton/qtokenautomaton.pro +++ b/tests/auto/other/qtokenautomaton/qtokenautomaton.pro @@ -16,5 +16,3 @@ HEADERS += tokenizers/basic/basic.h \ tokenizers/withNamespace/withNamespace.h QT = core testlib -CONFIG += parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qvariant_common/tst_qvariant_common.h b/tests/auto/other/qvariant_common/tst_qvariant_common.h index 79a5707de8..6a7c125089 100644 --- a/tests/auto/other/qvariant_common/tst_qvariant_common.h +++ b/tests/auto/other/qvariant_common/tst_qvariant_common.h @@ -72,7 +72,7 @@ protected: currentName.chop(1); ok &= (msg.contains(", " + currentName) || msg.contains(", 0x0")); } - ok &= msg.endsWith(")"); + ok &= msg.endsWith(QLatin1Char(')')); QVERIFY2(ok, (QString::fromLatin1("Message is not correctly finished: '") + msg + '\'').toLatin1().constData()); } diff --git a/tests/auto/other/toolsupport/toolsupport.pro b/tests/auto/other/toolsupport/toolsupport.pro index 274ead2c35..7603dea79e 100644 --- a/tests/auto/other/toolsupport/toolsupport.pro +++ b/tests/auto/other/toolsupport/toolsupport.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_toolsupport QT = testlib core-private SOURCES = $$PWD/tst_toolsupport.cpp diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp index bbd787bf38..a5b85ef221 100644 --- a/tests/auto/other/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp @@ -29,6 +29,16 @@ #include <QtTest> +// +// Note: +// +// When this test here fails and the change leading to the failure +// intentionally changed a private class, adjust the test here and bump +// the TypeInformationVersion field in src/corelib/global/qhooks.cpp +// in the same commit as the modification to the private class. +// + + // Don't do this at home. This is test code, not production. #define protected public #define private public diff --git a/tests/auto/other/windowsmobile/test/test.pro b/tests/auto/other/windowsmobile/test/test.pro index 5f744c2acb..36dd15f60e 100644 --- a/tests/auto/other/windowsmobile/test/test.pro +++ b/tests/auto/other/windowsmobile/test/test.pro @@ -1,6 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test QT += widgets testlib HEADERS += ddhelper.h SOURCES += tst_windowsmobile.cpp ddhelper.cpp @@ -22,4 +21,3 @@ wincewm*: { -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/printsupport/dialogs/qabstractprintdialog/qabstractprintdialog.pro b/tests/auto/printsupport/dialogs/qabstractprintdialog/qabstractprintdialog.pro index 2e9ae33592..b867610009 100644 --- a/tests/auto/printsupport/dialogs/qabstractprintdialog/qabstractprintdialog.pro +++ b/tests/auto/printsupport/dialogs/qabstractprintdialog/qabstractprintdialog.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstractprintdialog QT += widgets printsupport testlib SOURCES += tst_qabstractprintdialog.cpp diff --git a/tests/auto/printsupport/kernel/qprintdevice/qprintdevice.pro b/tests/auto/printsupport/kernel/qprintdevice/qprintdevice.pro index fb11b0361e..56c1b60d94 100644 --- a/tests/auto/printsupport/kernel/qprintdevice/qprintdevice.pro +++ b/tests/auto/printsupport/kernel/qprintdevice/qprintdevice.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qprintdevice SOURCES += tst_qprintdevice.cpp QT += printsupport-private network testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/printsupport/kernel/qprinter/qprinter.pro b/tests/auto/printsupport/kernel/qprinter/qprinter.pro index 9fc6ed13fc..462929c153 100644 --- a/tests/auto/printsupport/kernel/qprinter/qprinter.pro +++ b/tests/auto/printsupport/kernel/qprinter/qprinter.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qprinter QT += printsupport widgets testlib SOURCES += tst_qprinter.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/printsupport/kernel/qprinterinfo/qprinterinfo.pro b/tests/auto/printsupport/kernel/qprinterinfo/qprinterinfo.pro index 6dcf50a838..f397f48bb8 100644 --- a/tests/auto/printsupport/kernel/qprinterinfo/qprinterinfo.pro +++ b/tests/auto/printsupport/kernel/qprinterinfo/qprinterinfo.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qprinterinfo SOURCES += tst_qprinterinfo.cpp QT += printsupport network testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/sql/kernel/qsql/qsql.pro b/tests/auto/sql/kernel/qsql/qsql.pro index 03918f5d3d..71e2989572 100644 --- a/tests/auto/sql/kernel/qsql/qsql.pro +++ b/tests/auto/sql/kernel/qsql/qsql.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsql SOURCES += tst_qsql.cpp diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h index fe8a3689b0..3ba4833dd5 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h +++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h @@ -119,7 +119,7 @@ inline static QString qTableName(const QString& prefix, QSqlDatabase db) QString tableStr; if (db.driverName().toLower().contains("ODBC")) tableStr += QLatin1String("_odbc"); - return fixupTableName(QString(db.driver()->escapeIdentifier(prefix + tableStr + "_" + + return fixupTableName(QString(db.driver()->escapeIdentifier(prefix + tableStr + QLatin1Char('_') + qGetHostName(), QSqlDriver::TableName)),db); } @@ -219,12 +219,12 @@ public: } // construct a stupid unique name - QString cName = QString::number( counter++ ) + "_" + driver + "@"; + QString cName = QString::number( counter++ ) + QLatin1Char('_') + driver + QLatin1Char('@'); cName += host.isEmpty() ? dbName : host; if ( port > 0 ) - cName += ":" + QString::number( port ); + cName += QLatin1Char(':') + QString::number( port ); db = QSqlDatabase::addDatabase( driver, cName ); @@ -364,7 +364,7 @@ public: // for debugging only: outputs the connection as string static QString dbToString( const QSqlDatabase db ) { - QString res = db.driverName() + "@"; + QString res = db.driverName() + QLatin1Char('@'); if ( db.driverName().startsWith( "QODBC" ) || db.driverName().startsWith( "QOCI" ) ) { res += db.databaseName(); @@ -373,7 +373,7 @@ public: } if ( db.port() > 0 ) { - res += ":" + QString::number( db.port() ); + res += QLatin1Char(':') + QString::number( db.port() ); } return res; @@ -522,7 +522,7 @@ public: result += '\''; if(!err.driverText().isEmpty()) result += err.driverText() + "' || '"; - result += err.databaseText() + "'"; + result += err.databaseText() + QLatin1Char('\''); return result.toLocal8Bit(); } @@ -534,7 +534,7 @@ public: result += '\''; if(!err.driverText().isEmpty()) result += err.driverText() + "' || '"; - result += err.databaseText() + "'"; + result += err.databaseText() + QLatin1Char('\''); return result.toLocal8Bit(); } diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 83cf0394f9..5738f20f15 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -217,7 +217,7 @@ struct FieldDef { { QString rt = typeName; rt.replace(QRegExp("\\s"), QString("_")); - int i = rt.indexOf("("); + int i = rt.indexOf(QLatin1Char('(')); if (i == -1) i = rt.length(); if (i > 20) diff --git a/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro b/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro index 5633840635..8bfe1da1ce 100644 --- a/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro +++ b/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsqldriver SOURCES += tst_qsqldriver.cpp diff --git a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp index 2f48b65e74..5273632138 100644 --- a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp +++ b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp @@ -79,7 +79,7 @@ void tst_QSqlDriver::recreateTestTables(QSqlDatabase db) tst_Databases::safeDropTable( db, relTEST1 ); QString doubleField = (dbType == QSqlDriver::SQLite) ? "more_data double" : "more_data double(8,7)"; QVERIFY_SQL( q, exec("create table " + relTEST1 + - " (id int not null primary key, name varchar(20), title_key int, another_title_key int, " + doubleField + ")")); + " (id int not null primary key, name varchar(20), title_key int, another_title_key int, " + doubleField + QLatin1Char(')'))); QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(1, 'harry', 1, 2, 1.234567)")); QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(2, 'trond', 2, 1, 8.901234)")); QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(3, 'vohi', 1, 2, 5.678901)")); diff --git a/tests/auto/sql/kernel/qsqlerror/qsqlerror.pro b/tests/auto/sql/kernel/qsqlerror/qsqlerror.pro index c217e27645..ef0d213dba 100644 --- a/tests/auto/sql/kernel/qsqlerror/qsqlerror.pro +++ b/tests/auto/sql/kernel/qsqlerror/qsqlerror.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsqlerror QT = core sql testlib diff --git a/tests/auto/sql/kernel/qsqlfield/qsqlfield.pro b/tests/auto/sql/kernel/qsqlfield/qsqlfield.pro index 6b74041a17..5e0f4afe4c 100644 --- a/tests/auto/sql/kernel/qsqlfield/qsqlfield.pro +++ b/tests/auto/sql/kernel/qsqlfield/qsqlfield.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsqlfield SOURCES += tst_qsqlfield.cpp diff --git a/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp b/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp index b77e1fe9ef..1d31f921f0 100644 --- a/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp +++ b/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp @@ -201,9 +201,9 @@ void tst_QSqlField::name() { QSqlField field( "test", QVariant::String ); QFETCH( QString, val ); - QVERIFY( field.name() == "test" ); + QCOMPARE(field.name(), QLatin1String("test")); field.setName( val ); - QVERIFY( field.name() == val ); + QCOMPARE(field.name(), val); } void tst_QSqlField::operator_Assign() @@ -253,9 +253,9 @@ void tst_QSqlField::setName() { QSqlField field( "test", QVariant::String ); QFETCH( QString, val ); - QVERIFY( field.name() == "test" ); + QCOMPARE(field.name(), QLatin1String("test")); field.setName( val ); - QVERIFY( field.name() == val ); + QCOMPARE(field.name(), val); } void tst_QSqlField::setNull() @@ -273,16 +273,16 @@ void tst_QSqlField::setReadOnly() field.setValue( "test" ); field.setReadOnly( true ); field.setValue( "Harry" ); - QVERIFY( field.value() == "test" ); + QCOMPARE(field.value().toString(), QLatin1String("test")); field.clear(); - QVERIFY( field.value() == "test" ); + QCOMPARE(field.value().toString(), QLatin1String("test")); QVERIFY( !field.isNull() ); field.clear(); - QVERIFY( field.value() == "test" ); + QCOMPARE(field.value().toString(), QLatin1String("test")); QVERIFY( !field.isNull() ); field.setReadOnly( false ); field.setValue( "Harry" ); - QVERIFY( field.value() == "Harry" ); + QCOMPARE(field.value().toString(), QLatin1String("Harry")); field.clear(); QVERIFY( field.value() == QVariant().toString() ); QVERIFY( field.isNull() ); diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index b98ab68ae9..6311e4c480 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -959,14 +959,14 @@ void tst_QSqlQuery::value() if (dbType == QSqlDriver::Interbase) QVERIFY( q.value( 1 ).toString().startsWith( "VarChar" + QString::number( i ) ) ); - else if ( q.value( 1 ).toString().right( 1 ) == " " ) + else if ( q.value( 1 ).toString().endsWith(QLatin1Char(' '))) QCOMPARE( q.value( 1 ).toString(), ( "VarChar" + QString::number( i ) + " " ) ); else QCOMPARE( q.value( 1 ).toString(), ( "VarChar" + QString::number( i ) ) ); if (dbType == QSqlDriver::Interbase) QVERIFY( q.value( 2 ).toString().startsWith( "Char" + QString::number( i ) ) ); - else if ( q.value( 2 ).toString().right( 1 ) != " " ) + else if (!q.value( 2 ).toString().endsWith(QLatin1Char(' '))) QCOMPARE( q.value( 2 ).toString(), ( "Char" + QString::number( i ) ) ); else QCOMPARE( q.value( 2 ).toString(), ( "Char" + QString::number( i ) + " " ) ); @@ -3145,7 +3145,7 @@ void tst_QSqlQuery::sqlServerReturn0() "SELECT * FROM "+tableName+" WHERE ID = 2 " "RETURN 0")); - QVERIFY_SQL(q, exec("{CALL "+procName+"}")); + QVERIFY_SQL(q, exec("{CALL " + procName + QLatin1Char('}'))); QVERIFY_SQL(q, next()); } @@ -3162,7 +3162,7 @@ void tst_QSqlQuery::QTBUG_551() TYPE IntType IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;\n\ TYPE VCType IS TABLE OF VARCHAR2(60) INDEX BY BINARY_INTEGER;\n\ PROCEDURE P (Inp IN IntType, Outp OUT VCType);\n\ - END "+pkgname+";")); + END "+ pkgname + QLatin1Char(';'))); QVERIFY_SQL(q, exec("CREATE OR REPLACE PACKAGE BODY "+pkgname+" IS\n\ PROCEDURE P (Inp IN IntType, Outp OUT VCType)\n\ @@ -3172,7 +3172,7 @@ void tst_QSqlQuery::QTBUG_551() Outp(2) := '2. Value is ' ||TO_CHAR(Inp(2));\n\ Outp(3) := '3. Value is ' ||TO_CHAR(Inp(3));\n\ END p;\n\ - END "+pkgname+";")); + END " + pkgname + QLatin1Char(';'))); QVariantList inLst, outLst, res_outLst; @@ -3310,7 +3310,7 @@ void tst_QSqlQuery::QTBUG_6421() QVERIFY_SQL(q, exec("create index INDEX2 on "+tableName+" (COL2 desc)")); QVERIFY_SQL(q, exec("create index INDEX3 on "+tableName+" (COL3 desc)")); q.setForwardOnly(true); - QVERIFY_SQL(q, exec("select COLUMN_EXPRESSION from ALL_IND_EXPRESSIONS where TABLE_NAME='"+tableName+"'")); + QVERIFY_SQL(q, exec("select COLUMN_EXPRESSION from ALL_IND_EXPRESSIONS where TABLE_NAME='" + tableName + QLatin1Char('\''))); QVERIFY_SQL(q, next()); QCOMPARE(q.value(0).toString(), QLatin1String("\"COL1\"")); QVERIFY_SQL(q, next()); @@ -3338,7 +3338,7 @@ void tst_QSqlQuery::QTBUG_6618() "begin\n" " raiserror('" + errorString + "', 16, 1)\n" "end\n" )); - q.exec("{call " + qTableName("tst_raiseError", __FILE__, db) + "}"); + q.exec("{call " + qTableName("tst_raiseError", __FILE__, db) + QLatin1Char('}')); QVERIFY(q.lastError().text().contains(errorString)); } @@ -3430,7 +3430,7 @@ void tst_QSqlQuery::QTBUG_21884() QStringList stList; QString tableName(qTableName("bug21884", __FILE__, db)); stList << "create table " + tableName + "(id integer primary key, note string)"; - stList << "select * from " + tableName + ";"; + stList << "select * from " + tableName + QLatin1Char(';'); stList << "select * from " + tableName + "; \t\n\r"; stList << "drop table " + tableName; @@ -3984,7 +3984,7 @@ void runIntegralTypesMysqlTest(QSqlDatabase &db, const QString &tableName, const { QSqlQuery q(db); QVERIFY_SQL(q, exec("DROP TABLE IF EXISTS " + tableName)); - QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + " (id " + type + ")")); + QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + " (id " + type + ')')); const int steps = 20; const T increment = max / steps - min / steps; @@ -4001,7 +4001,7 @@ void runIntegralTypesMysqlTest(QSqlDatabase &db, const QString &tableName, const q.bindValue(0, v); QVERIFY_SQL(q, exec()); } else { - QVERIFY_SQL(q, exec("INSERT INTO " + tableName + " (id) VALUES (" + QString::number(v) + ")")); + QVERIFY_SQL(q, exec("INSERT INTO " + tableName + " (id) VALUES (" + QString::number(v) + QLatin1Char(')'))); } values[i] = v; v += increment; diff --git a/tests/auto/sql/kernel/qsqlrecord/qsqlrecord.pro b/tests/auto/sql/kernel/qsqlrecord/qsqlrecord.pro index 0e92797bb0..ee17b5f249 100644 --- a/tests/auto/sql/kernel/qsqlrecord/qsqlrecord.pro +++ b/tests/auto/sql/kernel/qsqlrecord/qsqlrecord.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsqlrecord SOURCES += tst_qsqlrecord.cpp diff --git a/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp b/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp index 8a90f16dce..722a391c13 100644 --- a/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp +++ b/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp @@ -484,7 +484,7 @@ void tst_QSqlRecord::setValue() QVERIFY( rec2.value( 3 ) == QVariant(bval) ); rec2.setValue( "string", "__Harry__" ); - QVERIFY( rec2.value( 0 ) == "__Harry__" ); + QCOMPARE(rec2.value(0).toString(), QLatin1String("__Harry__")); for ( i = 0; i < 4; ++i ) QVERIFY( !rec2.isNull( i ) ); @@ -501,7 +501,7 @@ void tst_QSqlRecord::value() QSqlRecord rec2; rec2.append( QSqlField( "string", QVariant::String ) ); rec2.setValue( "string", "Harry" ); - QVERIFY( rec2.value( "string" ) == "Harry" ); + QCOMPARE(rec2.value("string").toString(), QLatin1String("Harry")); } QTEST_MAIN(tst_QSqlRecord) diff --git a/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro index bc627e0724..2576fbad71 100644 --- a/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro +++ b/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsqlquerymodel SOURCES += tst_qsqlquerymodel.cpp diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro index 5ce1b5694c..cade7c171d 100644 --- a/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro +++ b/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsqlrelationaltablemodel SOURCES += tst_qsqlrelationaltablemodel.cpp diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index 3702631275..fbc583f341 100644 --- a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -1115,7 +1115,7 @@ void tst_QSqlRelationalTableModel::casing() QCOMPARE( rec.count(), 0); //try an owner that does exist - rec = db.driver()->record(db.userName() + "." + qTableName("CASETEST1", db).toUpper()); + rec = db.driver()->record(db.userName() + QLatin1Char('.') + qTableName("CASETEST1", db).toUpper()); QCOMPARE( rec.count(), 4); } QSqlRecord rec = db.driver()->record(qTableName("CASETEST1", db).toUpper()); @@ -1464,13 +1464,13 @@ void tst_QSqlRelationalTableModel::psqlSchemaTest() QSqlQuery q(db); QVERIFY_SQL(q, exec("create schema " + qTableName("QTBUG_5373", __FILE__, db))); QVERIFY_SQL(q, exec("create schema " + qTableName("QTBUG_5373_s2", __FILE__, db))); - QVERIFY_SQL(q, exec("create table " + qTableName("QTBUG_5373", __FILE__, db) + "." + qTableName("document", __FILE__, db) + + QVERIFY_SQL(q, exec("create table " + qTableName("QTBUG_5373", __FILE__, db) + QLatin1Char('.') + qTableName("document", __FILE__, db) + "(document_id int primary key, relatingid int, userid int)")); - QVERIFY_SQL(q, exec("create table " + qTableName("QTBUG_5373_s2", __FILE__, db) + "." + qTableName("user", __FILE__, db) + + QVERIFY_SQL(q, exec("create table " + qTableName("QTBUG_5373_s2", __FILE__, db) + QLatin1Char('.') + qTableName("user", __FILE__, db) + "(userid int primary key, username char(40))")); - model.setTable(qTableName("QTBUG_5373", __FILE__, db) + "." + qTableName("document", __FILE__, db)); - model.setRelation(1, QSqlRelation(qTableName("QTBUG_5373_s2", __FILE__, db) + "." + qTableName("user", __FILE__, db), "userid", "username")); - model.setRelation(2, QSqlRelation(qTableName("QTBUG_5373_s2", __FILE__, db) + "." + qTableName("user", __FILE__, db), "userid", "username")); + model.setTable(qTableName("QTBUG_5373", __FILE__, db) + QLatin1Char('.') + qTableName("document", __FILE__, db)); + model.setRelation(1, QSqlRelation(qTableName("QTBUG_5373_s2", __FILE__, db) + QLatin1Char('.') + qTableName("user", __FILE__, db), "userid", "username")); + model.setRelation(2, QSqlRelation(qTableName("QTBUG_5373_s2", __FILE__, db) + QLatin1Char('.') + qTableName("user", __FILE__, db), "userid", "username")); QVERIFY_SQL(model, select()); model.setJoinMode(QSqlRelationalTableModel::LeftJoin); @@ -1515,14 +1515,14 @@ void tst_QSqlRelationalTableModel::relationOnFirstColumn() //prepare test1 table QSqlQuery q(db); QVERIFY_SQL(q, exec("CREATE TABLE " + testTable1 + " (val1 INTEGER, id1 INTEGER PRIMARY KEY);")); - QVERIFY_SQL(q, exec("DELETE FROM " + testTable1 + ";")); + QVERIFY_SQL(q, exec("DELETE FROM " + testTable1 + QLatin1Char(';'))); QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(1, 10);")); QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(2, 20);")); QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(3, 30);")); //prepare test2 table QVERIFY_SQL(q, exec("CREATE TABLE " + testTable2 + " (id INTEGER PRIMARY KEY, name TEXT);")); - QVERIFY_SQL(q, exec("DELETE FROM " + testTable2 + ";")); + QVERIFY_SQL(q, exec("DELETE FROM " + testTable2 + QLatin1Char(';'))); QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (10, 'Hervanta');")); QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (20, 'Keskusta');")); QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (30, 'Annala');")); diff --git a/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro b/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro index fedb41ba1d..2af39b341f 100644 --- a/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro +++ b/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsqltablemodel SOURCES += tst_qsqltablemodel.cpp diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp index 2ace79973b..fff9811e60 100644 --- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp @@ -1987,7 +1987,7 @@ void tst_QSqlTableModel::tableModifyWithBlank() //set a filter on the table so the only record we get is the one we just made //I could just do another setData command, but I want to make sure the TableModel //matches exactly what is stored in the database - model.setFilter("column1='"+timeString+"'"); //filter to get just the newly entered row + model.setFilter("column1='" + timeString + QLatin1Char('\'')); //filter to get just the newly entered row QVERIFY_SQL(model, select()); //Make sure we only get one record, and that it is the one we just made diff --git a/tests/auto/testlib/qsignalspy/qsignalspy.pro b/tests/auto/testlib/qsignalspy/qsignalspy.pro index 72ae3a5009..1578802bf8 100644 --- a/tests/auto/testlib/qsignalspy/qsignalspy.pro +++ b/tests/auto/testlib/qsignalspy/qsignalspy.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qsignalspy SOURCES += tst_qsignalspy.cpp QT = core testlib -CONFIG += parallel_test diff --git a/tests/auto/testlib/selftests/selftests.pro b/tests/auto/testlib/selftests/selftests.pro index 1d39e6a899..32d66c019d 100644 --- a/tests/auto/testlib/selftests/selftests.pro +++ b/tests/auto/testlib/selftests/selftests.pro @@ -9,4 +9,3 @@ INSTALLS = QT = core -CONFIG += parallel_test diff --git a/tests/auto/testlib/selftests/test/test.pro b/tests/auto/testlib/selftests/test/test.pro index 0a31810105..106787b64d 100644 --- a/tests/auto/testlib/selftests/test/test.pro +++ b/tests/auto/testlib/selftests/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test SOURCES += ../tst_selftests.cpp QT = core xml testlib-private diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index 99e226c5f4..688799048f 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_moc #exists(/usr/include/boost/spirit.hpp) { @@ -41,7 +40,6 @@ qtHaveModule(dbus) { DEFINES += WITH_DBUS QT += dbus } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 # tst_Moc::specifyMetaTagsFromCmdline() # Ensure that plugin_metadata.h are moc-ed with some extra -M arguments: diff --git a/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro b/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro index d568e7107d..4bfa89a44e 100644 --- a/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro +++ b/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro @@ -9,4 +9,3 @@ SOURCES += tst_qdbuscpp2xml.cpp \ RESOURCES += qdbuscpp2xml.qrc HEADERS += test1.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/tools/qdbusxml2cpp/qdbusxml2cpp.pro b/tests/auto/tools/qdbusxml2cpp/qdbusxml2cpp.pro index d2e2e19a36..8c29ff47c4 100644 --- a/tests/auto/tools/qdbusxml2cpp/qdbusxml2cpp.pro +++ b/tests/auto/tools/qdbusxml2cpp/qdbusxml2cpp.pro @@ -3,4 +3,3 @@ QT = core testlib TARGET = tst_qdbusxml2cpp SOURCES += tst_qdbusxml2cpp.cpp QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/tools/qmake/qmake.pro b/tests/auto/tools/qmake/qmake.pro index d0817247db..ac52fb81fa 100644 --- a/tests/auto/tools/qmake/qmake.pro +++ b/tests/auto/tools/qmake/qmake.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test # Allow more time since examples are compiled, which may take longer on Windows. win32:testcase.timeout=900 TARGET = tst_qmake diff --git a/tests/auto/tools/qmake/testcompiler.cpp b/tests/auto/tools/qmake/testcompiler.cpp index 601d626b5c..23a7012af7 100644 --- a/tests/auto/tools/qmake/testcompiler.cpp +++ b/tests/auto/tools/qmake/testcompiler.cpp @@ -296,7 +296,7 @@ bool TestCompiler::make( const QString &workPath, const QString &target, bool ex bool TestCompiler::exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version ) { - QFileInfo f(destDir + "/" + targetName(buildType, exeName, version)); + QFileInfo f(destDir + QLatin1Char('/') + targetName(buildType, exeName, version)); return f.exists(); } diff --git a/tests/auto/tools/qmakelib/qmakelib.pro b/tests/auto/tools/qmakelib/qmakelib.pro index f1b8dfef3d..140bece708 100644 --- a/tests/auto/tools/qmakelib/qmakelib.pro +++ b/tests/auto/tools/qmakelib/qmakelib.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmakelib QT = core testlib diff --git a/tests/auto/tools/rcc/rcc.pro b/tests/auto/tools/rcc/rcc.pro index 160697b06c..264b8ecc66 100644 --- a/tests/auto/tools/rcc/rcc.pro +++ b/tests/auto/tools/rcc/rcc.pro @@ -3,4 +3,3 @@ QT = core testlib TARGET = tst_rcc SOURCES += tst_rcc.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro index c379e67ec5..c8ddedb401 100644 --- a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro +++ b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qcolordialog QT += widgets testlib SOURCES += tst_qcolordialog.cpp diff --git a/tests/auto/widgets/dialogs/qdialog/qdialog.pro b/tests/auto/widgets/dialogs/qdialog/qdialog.pro index c7917e8ff6..0a065b1a87 100644 --- a/tests/auto/widgets/dialogs/qdialog/qdialog.pro +++ b/tests/auto/widgets/dialogs/qdialog/qdialog.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdialog QT += widgets testlib gui-private core-private SOURCES += tst_qdialog.cpp diff --git a/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro b/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro index a88f449494..b4cf05e347 100644 --- a/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro +++ b/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TEMPLATE = app TARGET = tst_qerrormessage diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp index bc3c5e73f0..16ff118a3f 100644 --- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp @@ -956,7 +956,7 @@ void tst_QFiledialog::selectFiles() QListView* listView = fd.findChild<QListView*>("listView"); QVERIFY(listView); for (int i = 0; i < list.count(); ++i) { - fd.selectFile(fd.directory().path() + "/" + list.at(i)); + fd.selectFile(fd.directory().path() + QLatin1Char('/') + list.at(i)); QTRY_VERIFY(!listView->selectionModel()->selectedRows().isEmpty()); toSelect.append(listView->selectionModel()->selectedRows().last()); } diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index d48c718d4d..cca150eb54 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -520,7 +520,7 @@ protected: path = parentIndex.child(source_row,0).data(Qt::DisplayRole).toString(); do { - path = parentIndex.data(Qt::DisplayRole).toString() + "/" + path; + path = parentIndex.data(Qt::DisplayRole).toString() + QLatin1Char('/') + path; parentIndex = parentIndex.parent(); } while(parentIndex.isValid()); @@ -903,7 +903,7 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting() #else QTest::qWait(500); #endif - QCOMPARE(fd2.selectedFiles().first(), current.absolutePath() + QChar('/') + QLatin1String("g")); + QCOMPARE(fd2.selectedFiles().first(), current.absolutePath() + QLatin1String("/g")); QNonNativeFileDialog fd3(0, "This is a third file dialog", tempFile->fileName()); fd3.restoreState(fd.saveState()); diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index 209048a853..a70be695ef 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -1097,7 +1097,7 @@ void tst_QFileSystemModel::permissions() // checks QTBUG-20503 QFETCH(bool, readOnly); const QString tmp = flatDirTestPath; - const QString file = tmp + '/' + "f"; + const QString file = tmp + QLatin1String("/f"); QVERIFY(createFiles(tmp, QStringList() << "f")); QVERIFY(QFile::setPermissions(file, QFile::Permissions(permissions))); diff --git a/tests/auto/widgets/dialogs/qfontdialog/qfontdialog.pro b/tests/auto/widgets/dialogs/qfontdialog/qfontdialog.pro index dc1702971e..320d6ee3b5 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/qfontdialog.pro +++ b/tests/auto/widgets/dialogs/qfontdialog/qfontdialog.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontdialog QT += widgets widgets-private testlib @@ -9,9 +8,9 @@ SOURCES += tst_qfontdialog.cpp RESOURCES += testfonts.qrc -mac { +osx { # ### fixme # OBJECTIVE_SOURCES += tst_qfontdialog_mac_helpers.mm -# LIBS += -framework Cocoa +# LIBS += -framework AppKit } diff --git a/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro b/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro index e9f220101b..91848fee24 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro +++ b/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro @@ -2,6 +2,5 @@ TEMPLATE = app TARGET = tst_qmessagebox QT += gui-private core-private widgets testlib CONFIG += testcase -CONFIG += parallel_test SOURCES += tst_qmessagebox.cpp diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 97cfec8171..fd78bd870b 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -606,7 +606,7 @@ void tst_QMessageBox::detailsButtonText() QAbstractButton* btn = NULL; foreach(btn, list) { if (btn && (btn->inherits("QPushButton"))) { - if (btn->text().remove("&") != QMessageBox::tr("OK") + if (btn->text().remove(QLatin1Char('&')) != QMessageBox::tr("OK") && btn->text() != QMessageBox::tr("Show Details...")) { QFAIL(qPrintable(QString("Unexpected messagebox button text: %1").arg(btn->text()))); } diff --git a/tests/auto/widgets/dialogs/qprogressdialog/qprogressdialog.pro b/tests/auto/widgets/dialogs/qprogressdialog/qprogressdialog.pro index 290374f825..10aeaace71 100644 --- a/tests/auto/widgets/dialogs/qprogressdialog/qprogressdialog.pro +++ b/tests/auto/widgets/dialogs/qprogressdialog/qprogressdialog.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qprogressdialog QT += widgets testlib SOURCES += tst_qprogressdialog.cpp diff --git a/tests/auto/widgets/dialogs/qsidebar/qsidebar.pro b/tests/auto/widgets/dialogs/qsidebar/qsidebar.pro index ce485504e2..18e637199a 100644 --- a/tests/auto/widgets/dialogs/qsidebar/qsidebar.pro +++ b/tests/auto/widgets/dialogs/qsidebar/qsidebar.pro @@ -1,8 +1,6 @@ CONFIG += testcase -CONFIG += parallel_test QT += core-private QT += widgets widgets-private testlib SOURCES += tst_qsidebar.cpp TARGET = tst_qsidebar -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/dialogs/qwizard/qwizard.pro b/tests/auto/widgets/dialogs/qwizard/qwizard.pro index a1d72e854a..c6e5bcea7a 100644 --- a/tests/auto/widgets/dialogs/qwizard/qwizard.pro +++ b/tests/auto/widgets/dialogs/qwizard/qwizard.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qwizard QT += widgets testlib SOURCES += tst_qwizard.cpp tst_qwizard_2.cpp diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp index b2bdbac79a..5fddaf21ea 100644 --- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp +++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp @@ -547,8 +547,8 @@ void tst_QWizard::setDefaultProperty() // make sure the data structure is reasonable for (int i = 0; i < 200000; ++i) { - wizard.setDefaultProperty("QLineEdit", QByteArray("x" + QByteArray::number(i)).constData(), 0); - wizard.setDefaultProperty("QLabel", QByteArray("y" + QByteArray::number(i)).constData(), 0); + wizard.setDefaultProperty("QLineEdit", QByteArray('x' + QByteArray::number(i)).constData(), 0); + wizard.setDefaultProperty("QLabel", QByteArray('y' + QByteArray::number(i)).constData(), 0); } } @@ -2115,7 +2115,7 @@ void tst_QWizard::combinations() } if (minSizeTest) - qDebug() << "minimum sizes" << reason.latin1() << ";" << wizard.minimumSizeHint() + qDebug() << "minimum sizes" << reason.latin1() << ';' << wizard.minimumSizeHint() << otor.latin1() << refMinSize; if (imageTest) diff --git a/tests/auto/widgets/effects/qgraphicseffect/qgraphicseffect.pro b/tests/auto/widgets/effects/qgraphicseffect/qgraphicseffect.pro index 9f6b0455e2..177d1a7c42 100644 --- a/tests/auto/widgets/effects/qgraphicseffect/qgraphicseffect.pro +++ b/tests/auto/widgets/effects/qgraphicseffect/qgraphicseffect.pro @@ -5,4 +5,3 @@ QT += widgets widgets-private testlib QT += core-private gui-private SOURCES += tst_qgraphicseffect.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp index c7d1dd0aa1..ceeea77dc2 100644 --- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp @@ -549,7 +549,7 @@ void tst_QGraphicsEffect::drawPixmapItem() QVERIFY(QTest::qWaitForWindowExposed(&view)); QTRY_VERIFY(effect->repaints >= 1); - item->rotate(180); + item->setTransform(QTransform().rotate(180), true); QTRY_VERIFY(effect->repaints >= 2); } @@ -593,7 +593,7 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching() QTRY_VERIFY(item->numRepaints >= 1); int numRepaints = item->numRepaints; - item->translate(10, 0); + item->setTransform(QTransform::fromTranslate(10, 0), true); QTRY_COMPARE(item->numRepaints, numRepaints); } diff --git a/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro b/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro index b6693eeb5f..bf0f99598b 100644 --- a/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro +++ b/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpixmapfilter QT += widgets widgets-private testlib diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro index 6e8717c86d..a1064d1c73 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro @@ -3,4 +3,3 @@ TARGET = tst_qgraphicsanchorlayout1 QT += widgets widgets-private testlib QT += core-private gui-private SOURCES += tst_qgraphicsanchorlayout1.cpp -CONFIG += parallel_test diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro index 66e39869bb..5bfa15db16 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro @@ -6,4 +6,3 @@ SOURCES += tst_qgraphicsitem.cpp DEFINES += QT_NO_CAST_TO_ASCII win32:!wince:!winrt: LIBS += -luser32 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 835aeaa4df..c097a6a969 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -310,7 +310,7 @@ private slots: void selected_textItem(); void selected_multi(); void acceptedMouseButtons(); - void acceptsHoverEvents(); + void acceptHoverEvents(); void childAcceptsHoverEvents(); void hasFocus(); void pos(); @@ -385,7 +385,9 @@ private slots: void itemContainsChildrenInShape2(); void ancestorFlags(); void untransformable(); +#ifndef QT_NO_CONTEXTMENU void contextMenuEventPropagation(); +#endif // QT_NO_CONTEXTMENU void itemIsMovable(); void boundingRegion_data(); void boundingRegion(); @@ -564,9 +566,9 @@ void tst_QGraphicsItem::construction() QVERIFY(!item->isSelected()); QCOMPARE(item->acceptedMouseButtons(), Qt::MouseButtons(0x1f)); if (item->type() == QGraphicsTextItem::Type) - QVERIFY(item->acceptsHoverEvents()); + QVERIFY(item->acceptHoverEvents()); else - QVERIFY(!item->acceptsHoverEvents()); + QVERIFY(!item->acceptHoverEvents()); QVERIFY(!item->hasFocus()); QCOMPARE(item->pos(), QPointF()); QCOMPARE(item->matrix(), QMatrix()); @@ -1125,11 +1127,11 @@ void tst_QGraphicsItem::visible() scene.addItem(item); QVERIFY(item->isVisible()); - QCOMPARE(scene.itemAt(0, 0), item); + QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item); item->setVisible(false); - QCOMPARE(scene.itemAt(0, 0), (QGraphicsItem *)0); + QVERIFY(scene.items(QPointF(0, 0)).isEmpty()); item->setVisible(true); - QCOMPARE(scene.itemAt(0, 0), item); + QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item); QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress); event.setButton(Qt::LeftButton); @@ -1930,7 +1932,7 @@ protected: { ++hoverOutCount; } }; -void tst_QGraphicsItem::acceptsHoverEvents() +void tst_QGraphicsItem::acceptHoverEvents() { QGraphicsScene scene; HoverItem *item1 = new HoverItem(QRectF(-10, -10, 20, 20)); @@ -1939,10 +1941,10 @@ void tst_QGraphicsItem::acceptsHoverEvents() scene.addItem(item2); item2->setZValue(1); - QVERIFY(!item1->acceptsHoverEvents()); - QVERIFY(!item2->acceptsHoverEvents()); - item1->setAcceptsHoverEvents(true); - item2->setAcceptsHoverEvents(true); + QVERIFY(!item1->acceptHoverEvents()); + QVERIFY(!item2->acceptHoverEvents()); + item1->setAcceptHoverEvents(true); + item2->setAcceptHoverEvents(true); QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseMove); event.setScenePos(QPointF(-100, -100)); @@ -1953,8 +1955,8 @@ void tst_QGraphicsItem::acceptsHoverEvents() QCOMPARE(item1->hoverInCount, 0); QCOMPARE(item2->hoverInCount, 1); - item1->setAcceptsHoverEvents(false); - item2->setAcceptsHoverEvents(false); + item1->setAcceptHoverEvents(false); + item2->setAcceptHoverEvents(false); event.setScenePos(QPointF(-100, -100)); QApplication::sendEvent(&scene, &event); @@ -1964,8 +1966,8 @@ void tst_QGraphicsItem::acceptsHoverEvents() QCOMPARE(item1->hoverInCount, 0); QCOMPARE(item2->hoverInCount, 1); - item1->setAcceptsHoverEvents(true); - item2->setAcceptsHoverEvents(false); + item1->setAcceptHoverEvents(true); + item2->setAcceptHoverEvents(false); event.setScenePos(QPointF(-100, -100)); QApplication::sendEvent(&scene, &event); @@ -2168,27 +2170,27 @@ void tst_QGraphicsItem::matrix() line.resetMatrix(); QCOMPARE(line.matrix(), QMatrix()); - line.rotate(90); + line.setTransform(QTransform().rotate(90), true); QCOMPARE(line.matrix(), QMatrix().rotate(90)); - line.rotate(90); + line.setTransform(QTransform().rotate(90), true); QCOMPARE(line.matrix(), QMatrix().rotate(90).rotate(90)); line.resetMatrix(); - line.scale(2, 4); + line.setTransform(QTransform::fromScale(2, 4), true); QCOMPARE(line.matrix(), QMatrix().scale(2, 4)); - line.scale(2, 4); + line.setTransform(QTransform::fromScale(2, 4), true); QCOMPARE(line.matrix(), QMatrix().scale(2, 4).scale(2, 4)); line.resetMatrix(); - line.shear(2, 4); + line.setTransform(QTransform().shear(2, 4), true); QCOMPARE(line.matrix(), QMatrix().shear(2, 4)); - line.shear(2, 4); + line.setTransform(QTransform().shear(2, 4), true); QCOMPARE(line.matrix(), QMatrix().shear(2, 4).shear(2, 4)); line.resetMatrix(); - line.translate(10, 10); + line.setTransform(QTransform::fromTranslate(10, 10), true); QCOMPARE(line.matrix(), QMatrix().translate(10, 10)); - line.translate(10, 10); + line.setTransform(QTransform::fromTranslate(10, 10), true); QCOMPARE(line.matrix(), QMatrix().translate(10, 10).translate(10, 10)); line.resetMatrix(); } @@ -2201,15 +2203,15 @@ void tst_QGraphicsItem::sceneMatrix() QCOMPARE(parent->sceneMatrix(), QMatrix()); QCOMPARE(child->sceneMatrix(), QMatrix()); - parent->translate(10, 10); + parent->setTransform(QTransform::fromTranslate(10, 10), true); QCOMPARE(parent->sceneMatrix(), QMatrix().translate(10, 10)); QCOMPARE(child->sceneMatrix(), QMatrix().translate(10, 10)); - child->translate(10, 10); + child->setTransform(QTransform::fromTranslate(10, 10), true); QCOMPARE(parent->sceneMatrix(), QMatrix().translate(10, 10)); QCOMPARE(child->sceneMatrix(), QMatrix().translate(20, 20)); - parent->rotate(90); + parent->setTransform(QTransform().rotate(90), true); QCOMPARE(parent->sceneMatrix(), QMatrix().translate(10, 10).rotate(90)); QCOMPARE(child->sceneMatrix(), QMatrix().translate(10, 10).rotate(90).translate(10, 10)); @@ -2645,7 +2647,7 @@ void tst_QGraphicsItem::isObscuredBy() MyItem myitem1, myitem2; myitem1.setRect(QRectF(50, 50, 40, 200)); - myitem1.rotate(67); + myitem1.setTransform(QTransform().rotate(67), true); myitem2.setRect(QRectF(25, 25, 20, 20)); myitem2.setZValue(-1.0); @@ -3271,7 +3273,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints() EventTester *tester = new EventTester; scene.addItem(tester); - tester->setAcceptsHoverEvents(true); + tester->setAcceptHoverEvents(true); QTRY_COMPARE(tester->repaints, 1); @@ -3363,7 +3365,7 @@ void tst_QGraphicsItem::sceneBoundingRect() QCOMPARE(item->boundingRect(), QRectF(0, 0, 100, 100)); QCOMPARE(item->sceneBoundingRect(), QRectF(100, 100, 100, 100)); - item->rotate(90); + item->setTransform(QTransform().rotate(90), true); QCOMPARE(item->boundingRect(), QRectF(0, 0, 100, 100)); QCOMPARE(item->sceneBoundingRect(), QRectF(0, 100, 100, 100)); @@ -3391,7 +3393,7 @@ void tst_QGraphicsItem::childrenBoundingRect() QGraphicsRectItem *childChild = scene.addRect(QRectF(0, 0, 100, 100), QPen(Qt::black, 0)); childChild->setParentItem(child); childChild->setPos(500, 500); - child->rotate(90); + child->setTransform(QTransform().rotate(90), true); scene.addPolygon(parent->mapToScene(parent->boundingRect() | parent->childrenBoundingRect()))->setPen(QPen(Qt::red));; @@ -3439,11 +3441,11 @@ void tst_QGraphicsItem::childrenBoundingRectTransformed() QCOMPARE(subTreeRect.width(), qreal(351.7766952966369)); QCOMPARE(subTreeRect.height(), qreal(251.7766952966369)); - rect->rotate(45); - rect2->rotate(-45); - rect3->rotate(45); - rect4->rotate(-45); - rect5->rotate(45); + rect->setTransform(QTransform().rotate(45), true); + rect2->setTransform(QTransform().rotate(-45), true); + rect3->setTransform(QTransform().rotate(45), true); + rect4->setTransform(QTransform().rotate(-45), true); + rect5->setTransform(QTransform().rotate(45), true); subTreeRect = rect->childrenBoundingRect(); QCOMPARE(rect->childrenBoundingRect(), QRectF(-100, 75, 275, 250)); @@ -3565,7 +3567,7 @@ void tst_QGraphicsItem::group() QGraphicsRectItem *child = scene.addRect(QRectF(0, 0, 50, 50), QPen(Qt::black, 0), QBrush(Qt::blue)); QGraphicsRectItem *parent2 = scene.addRect(QRectF(0, 0, 50, 50), QPen(Qt::black, 0), QBrush(Qt::red)); parent2->setPos(-50, 50); - child->rotate(45); + child->setTransform(QTransform().rotate(45), true); child->setParentItem(parent); parent->setPos(25, 25); child->setPos(25, 25); @@ -3614,7 +3616,7 @@ void tst_QGraphicsItem::group() newItems << item; item->setPos(-1000 + rand() % 2000, -1000 + rand() % 2000); - item->rotate(rand() % 90); + item->setTransform(QTransform().rotate(rand() % 90), true); } view.fitInView(scene.itemsBoundingRect()); @@ -3657,8 +3659,8 @@ void tst_QGraphicsItem::setGroup2() rect->setTransformOriginPoint(50,50); rect->setRotation(45); rect->setScale(1.5); - rect->translate(20,20); - group.translate(-30,-40); + rect->setTransform(QTransform::fromTranslate(20,20), true); + group.setTransform(QTransform::fromTranslate(-30, -40), true); group.setRotation(180); group.setScale(0.5); @@ -3711,7 +3713,7 @@ void tst_QGraphicsItem::warpChildrenIntoGroup() QGraphicsScene scene; QGraphicsRectItem *parentRectItem = scene.addRect(QRectF(0, 0, 100, 100)); QGraphicsRectItem *childRectItem = scene.addRect(QRectF(0, 0, 100, 100)); - parentRectItem->rotate(90); + parentRectItem->setTransform(QTransform().rotate(90), true); childRectItem->setPos(-50, -25); childRectItem->setParentItem(parentRectItem); @@ -3720,7 +3722,7 @@ void tst_QGraphicsItem::warpChildrenIntoGroup() QGraphicsRectItem *parentOfGroup = scene.addRect(QRectF(0, 0, 100, 100)); parentOfGroup->setPos(-200, -200); - parentOfGroup->scale(2, 2); + parentOfGroup->setTransform(QTransform::fromScale(2, 2), true); QGraphicsItemGroup *group = new QGraphicsItemGroup; group->setPos(50, 50); @@ -4633,7 +4635,7 @@ void tst_QGraphicsItem::itemChange() // ItemTransformChange / ItemTransformHasChanged tester.itemChangeReturnValue.setValue<QTransform>(QTransform().rotate(90)); - tester.translate(50, 0); + tester.setTransform(QTransform::fromTranslate(50, 0), true); ++changeCount; // notification sent too ++changeCount; QCOMPARE(tester.changes.size(), changeCount); @@ -5193,6 +5195,7 @@ public: } protected: +#ifndef QT_NO_CONTEXTMENU void contextMenuEvent(QGraphicsSceneContextMenuEvent *) { if (harakiri == 3) { @@ -5200,6 +5203,7 @@ protected: delete this; } } +#endif // QT_NO_CONTEXTMENU void dragEnterEvent(QGraphicsSceneDragDropEvent *event) { @@ -5362,7 +5366,7 @@ void tst_QGraphicsItem::deleteItemInEventHandlers() for (int i = 0; i < 17; ++i) { QGraphicsScene scene; HarakiriItem *item = new HarakiriItem(i); - item->setAcceptsHoverEvents(true); + item->setAcceptHoverEvents(true); item->setFlag(QGraphicsItem::ItemIsFocusable); scene.addItem(item); @@ -5378,11 +5382,13 @@ void tst_QGraphicsItem::deleteItemInEventHandlers() if (!item->dead) scene.advance(); +#ifndef QT_NO_CONTEXTMENU if (!item->dead) { QContextMenuEvent event(QContextMenuEvent::Other, view.mapFromScene(item->scenePos())); QCoreApplication::sendEvent(view.viewport(), &event); } +#endif // QT_NO_CONTEXTMENU if (!item->dead) QTest::mouseMove(view.viewport(), view.mapFromScene(item->scenePos())); if (!item->dead) @@ -5514,16 +5520,16 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2() QGraphicsScene scene; scene.addItem(parent); - QCOMPARE(scene.itemAt(5, 5), (QGraphicsItem *)parent); - QCOMPARE(scene.itemAt(15, 5), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(5, 15), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(60, 60), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(140, 60), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(60, 140), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(140, 140), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(75, 75), (QGraphicsItem *)child2); - QCOMPARE(scene.itemAt(75, 100), (QGraphicsItem *)child1); - QCOMPARE(scene.itemAt(100, 75), (QGraphicsItem *)child1); + QCOMPARE(scene.items(QPointF(5, 5)).value(0, Q_NULLPTR), (QGraphicsItem *)parent); + QVERIFY(scene.items(QPointF(15, 5)).isEmpty()); + QVERIFY(scene.items(QPointF(5, 15)).isEmpty()); + QVERIFY(scene.items(QPointF(60, 60)).isEmpty()); + QVERIFY(scene.items(QPointF(140, 60)).isEmpty()); + QVERIFY(scene.items(QPointF(60, 140)).isEmpty()); + QVERIFY(scene.items(QPointF(140, 140)).isEmpty()); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child2); + QCOMPARE(scene.items(QPointF(75, 100)).value(0, Q_NULLPTR), (QGraphicsItem *)child1); + QCOMPARE(scene.items(QPointF(100, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child1); QImage image(100, 100, QImage::Format_ARGB32_Premultiplied); image.fill(0); @@ -5558,20 +5564,20 @@ void tst_QGraphicsItem::itemClipsChildrenToShape3() grandchild->setPos( 50, 50 ); parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape); - QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)parent); - QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)child); - QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild); - QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0); + QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)parent); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child); + QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); + QVERIFY(scene.items(QPointF(175, 175)).isEmpty()); // Move child to fully overlap the parent. The grandchild should // now occupy two-thirds of the scene child->prepareGeometryChange(); child->setPos( 0, 0 ); - QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)child); - QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)grandchild); - QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild); - QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0); + QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)child); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); + QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); + QVERIFY(scene.items(QPointF(175, 175)).isEmpty()); } class MyProxyWidget : public QGraphicsProxyWidget @@ -5843,17 +5849,17 @@ void tst_QGraphicsItem::itemClippingDiscovery() rightRectItem->setParentItem(clipItem); // The rects item are both visible at these points. - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)leftRectItem); - QCOMPARE(scene.itemAt(90, 90), (QGraphicsItem *)rightRectItem); + QCOMPARE(scene.items(QPointF(10, 10)).value(0, Q_NULLPTR), (QGraphicsItem *)leftRectItem); + QCOMPARE(scene.items(QPointF(90, 90)).value(0, Q_NULLPTR), (QGraphicsItem *)rightRectItem); // The ellipse clips the rects now. clipItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape); // The rect items are no longer visible at these points. - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)0); + QVERIFY(scene.items(QPointF(10, 10)).isEmpty()); if (sizeof(qreal) != sizeof(double)) QSKIP("This fails due to internal rounding errors"); - QCOMPARE(scene.itemAt(90, 90), (QGraphicsItem *)0); + QVERIFY(scene.items(QPointF(90, 90)).isEmpty()); } class ItemCountsBoundingRectCalls : public QGraphicsRectItem @@ -5884,7 +5890,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() int oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; // First test that both items are searched if no optimization flags are set - QGraphicsItem* item = scene.itemAt(25,5); + QGraphicsItem* item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); QCOMPARE(item, childOutsideShape); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); @@ -5895,7 +5901,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; // Repeat the test to make sure that no caching/indexing is in effect - item = scene.itemAt(25,5); + item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); QCOMPARE(item, childOutsideShape); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); @@ -5908,7 +5914,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() // Set the optimization flag and make sure that the child is not returned // and that the child's boundingRect() method is never called. parent->setFlag(QGraphicsItem::ItemContainsChildrenInShape); - item = scene.itemAt(25,5); + item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); QVERIFY(!(item)); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); @@ -6216,12 +6222,12 @@ void tst_QGraphicsItem::untransformable() QGraphicsItem *item1 = new QGraphicsEllipseItem(QRectF(-50, -50, 100, 100)); item1->setZValue(1); item1->setFlag(QGraphicsItem::ItemIgnoresTransformations); - item1->rotate(45); + item1->setTransform(QTransform().rotate(45), true); ((QGraphicsEllipseItem *)item1)->setBrush(Qt::red); QGraphicsItem *item2 = new QGraphicsEllipseItem(QRectF(-50, -50, 100, 100)); item2->setParentItem(item1); - item2->rotate(45); + item2->setTransform(QTransform().rotate(45), true); item2->setPos(100, 0); ((QGraphicsEllipseItem *)item2)->setBrush(Qt::green); @@ -6276,6 +6282,7 @@ void tst_QGraphicsItem::untransformable() } } +#ifndef QT_NO_CONTEXTMENU class ContextMenuItem : public QGraphicsRectItem { public: @@ -6339,6 +6346,7 @@ void tst_QGraphicsItem::contextMenuEventPropagation() QCOMPARE(bottomItem->gotEvent, false); QCOMPARE(topItem->eventWasAccepted, true); } +#endif // QT_NO_CONTEXTMENU void tst_QGraphicsItem::itemIsMovable() { @@ -6460,10 +6468,11 @@ void tst_QGraphicsItem::task177918_lineItemUndetected() QGraphicsLineItem *line = scene.addLine(10, 10, 10, 10); QCOMPARE(line->boundingRect(), QRectF(10, 10, 0, 0)); - QVERIFY(!scene.items(9, 9, 2, 2, Qt::IntersectsItemShape).isEmpty()); - QVERIFY(!scene.items(9, 9, 2, 2, Qt::ContainsItemShape).isEmpty()); - QVERIFY(!scene.items(9, 9, 2, 2, Qt::IntersectsItemBoundingRect).isEmpty()); - QVERIFY(!scene.items(9, 9, 2, 2, Qt::ContainsItemBoundingRect).isEmpty()); + const QRectF rect(9, 9, 2, 2); + QVERIFY(!scene.items(rect, Qt::IntersectsItemShape).isEmpty()); + QVERIFY(!scene.items(rect, Qt::ContainsItemShape).isEmpty()); + QVERIFY(!scene.items(rect, Qt::IntersectsItemBoundingRect).isEmpty()); + QVERIFY(!scene.items(rect, Qt::ContainsItemBoundingRect).isEmpty()); } void tst_QGraphicsItem::task240400_clickOnTextItem_data() @@ -6699,8 +6708,8 @@ void tst_QGraphicsItem::itemTransform_parentChild() QGraphicsItem *child = scene.addRect(0, 0, 100, 100); child->setParentItem(parent); child->setPos(10, 10); - child->scale(2, 2); - child->rotate(90); + child->setTransform(QTransform::fromScale(2, 2), true); + child->setTransform(QTransform().rotate(90), true); QCOMPARE(child->itemTransform(parent).map(QPointF(10, 10)), QPointF(-10, 30)); QCOMPARE(parent->itemTransform(child).map(QPointF(-10, 30)), QPointF(10, 10)); @@ -6712,19 +6721,19 @@ void tst_QGraphicsItem::itemTransform_siblings() QGraphicsItem *parent = scene.addRect(0, 0, 100, 100); QGraphicsItem *brother = scene.addRect(0, 0, 100, 100); QGraphicsItem *sister = scene.addRect(0, 0, 100, 100); - parent->scale(10, 5); - parent->rotate(-180); - parent->shear(2, 3); + parent->setTransform(QTransform::fromScale(10, 5), true); + parent->setTransform(QTransform().rotate(-180), true); + parent->setTransform(QTransform().shear(2, 3), true); brother->setParentItem(parent); sister->setParentItem(parent); brother->setPos(10, 10); - brother->scale(2, 2); - brother->rotate(90); + brother->setTransform(QTransform::fromScale(2, 2), true); + brother->setTransform(QTransform().rotate(90), true); sister->setPos(10, 10); - sister->scale(2, 2); - sister->rotate(90); + sister->setTransform(QTransform::fromScale(2, 2), true); + sister->setTransform(QTransform().rotate(90), true); QCOMPARE(brother->itemTransform(sister).map(QPointF(10, 10)), QPointF(10, 10)); QCOMPARE(sister->itemTransform(brother).map(QPointF(10, 10)), QPointF(10, 10)); @@ -6736,11 +6745,11 @@ void tst_QGraphicsItem::itemTransform_unrelated() QGraphicsItem *stranger1 = scene.addRect(0, 0, 100, 100); QGraphicsItem *stranger2 = scene.addRect(0, 0, 100, 100); stranger1->setPos(10, 10); - stranger1->scale(2, 2); - stranger1->rotate(90); + stranger1->setTransform(QTransform::fromScale(2, 2), true); + stranger1->setTransform(QTransform().rotate(90), true); stranger2->setPos(10, 10); - stranger2->scale(2, 2); - stranger2->rotate(90); + stranger2->setTransform(QTransform::fromScale(2, 2), true); + stranger2->setTransform(QTransform().rotate(90), true); QCOMPARE(stranger1->itemTransform(stranger2).map(QPointF(10, 10)), QPointF(10, 10)); QCOMPARE(stranger2->itemTransform(stranger1).map(QPointF(10, 10)), QPointF(10, 10)); @@ -7022,7 +7031,8 @@ void tst_QGraphicsItem::itemStacksBehindParent() paintedItems.clear(); view.viewport()->update(); QApplication::processEvents(); - QTRY_COMPARE(scene.items(0, 0, 100, 100), (QList<QGraphicsItem *>() + QRectF rect(0, 0, 100, 100); + QTRY_COMPARE(scene.items(rect), (QList<QGraphicsItem *>() << grandChild111 << child11 << grandChild121 << child12 << parent1 << grandChild211 << child21 @@ -7038,7 +7048,7 @@ void tst_QGraphicsItem::itemStacksBehindParent() paintedItems.clear(); QApplication::processEvents(); - QTRY_COMPARE(scene.items(0, 0, 100, 100), (QList<QGraphicsItem *>() + QTRY_COMPARE(scene.items(rect), (QList<QGraphicsItem *>() << grandChild121 << child12 << parent1 << grandChild111 << child11 << grandChild211 << child21 @@ -7054,7 +7064,7 @@ void tst_QGraphicsItem::itemStacksBehindParent() scene.update(); QApplication::processEvents(); - QTRY_COMPARE(scene.items(0, 0, 100, 100), (QList<QGraphicsItem *>() + QTRY_COMPARE(scene.items(rect), (QList<QGraphicsItem *>() << parent1 << grandChild111 << child11 << grandChild121 << child12 << grandChild211 << child21 @@ -7221,12 +7231,12 @@ void tst_QGraphicsItem::sceneTransformCache() QGraphicsRectItem *rect2 = scene.addRect(0, 0, 100, 100); rect2->setPen(QPen(Qt::black, 0)); rect2->setParentItem(rect); - rect2->rotate(90); - rect->translate(0, 50); + rect2->setTransform(QTransform().rotate(90), true); + rect->setTransform(QTransform::fromTranslate(0, 50), true); QGraphicsView view(&scene); view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - rect->translate(0, 100); + rect->setTransform(QTransform::fromTranslate(0, 100), true); QTransform x; x.translate(0, 150); x.rotate(90); @@ -7390,14 +7400,14 @@ void tst_QGraphicsItem::cacheMode() QCOMPARE(testerChild2->repaints, 2); // Translating does not result in a repaint. - tester->translate(10, 10); + tester->setTransform(QTransform::fromTranslate(10, 10), true); QTest::qWait(25); QTRY_COMPARE(tester->repaints, 2); QCOMPARE(testerChild->repaints, 2); QCOMPARE(testerChild2->repaints, 2); // Rotating results in a repaint. - tester->rotate(45); + tester->setTransform(QTransform().rotate(45), true); QTest::qWait(25); QTRY_COMPARE(tester->repaints, 3); QCOMPARE(testerChild->repaints, 3); @@ -7413,9 +7423,9 @@ void tst_QGraphicsItem::cacheMode() QCOMPARE(testerChild2->repaints, 3); // Rotating items with ItemCoordinateCache doesn't cause a repaint. - tester->rotate(22); - testerChild->rotate(22); - testerChild2->rotate(22); + tester->setTransform(QTransform().rotate(22), true); + testerChild->setTransform(QTransform().rotate(22), true); + testerChild2->setTransform(QTransform().rotate(22), true); QTest::qWait(25); QTRY_COMPARE(tester->repaints, 4); QTRY_COMPARE(testerChild->repaints, 4); @@ -7728,9 +7738,9 @@ void tst_QGraphicsItem::deviceTransform() rect1->setPos(100, 100); rect2->setPos(100, 100); rect3->setPos(100, 100); - rect1->rotate(rotation1); - rect2->rotate(rotation2); - rect3->rotate(rotation3); + rect1->setTransform(QTransform().rotate(rotation1), true); + rect2->setTransform(QTransform().rotate(rotation2), true); + rect3->setTransform(QTransform().rotate(rotation3), true); rect1->setFlag(QGraphicsItem::ItemIgnoresTransformations, untransformable1); rect2->setFlag(QGraphicsItem::ItemIgnoresTransformations, untransformable2); rect3->setFlag(QGraphicsItem::ItemIgnoresTransformations, untransformable3); @@ -7863,14 +7873,14 @@ void tst_QGraphicsItem::update() expectedRegion = itemDeviceBoundingRect.adjusted(-2, -2, 2, 2); view.reset(); item->repaints = 0; - parent->translate(-400, 0); + parent->setTransform(QTransform::fromTranslate(-400, 0), true); qApp->processEvents(); QCOMPARE(item->repaints, 0); QCOMPARE(view.repaints, 1); QCOMPARE(view.paintedRegion, expectedRegion); view.reset(); item->repaints = 0; - parent->translate(400, 0); + parent->setTransform(QTransform::fromTranslate(400, 0), true); qApp->processEvents(); QCOMPARE(item->repaints, 1); QCOMPARE(view.repaints, 1); @@ -8170,7 +8180,7 @@ void tst_QGraphicsItem::moveItem() RESET_COUNTERS - parent->translate(20, 20); + parent->setTransform(QTransform::fromTranslate(20, 20), true); qApp->processEvents(); QCOMPARE(parent->repaints, 1); QCOMPARE(child->repaints, 1); @@ -11641,12 +11651,12 @@ void tst_QGraphicsItem::QTBUG_21618_untransformable_sceneTransform() QGraphicsItem *item1 = scene.addRect(0, 0, 100, 100, QPen(), Qt::red); item1->setPos(50, 50); - item1->translate(50, 50); - item1->rotate(90); + item1->setTransform(QTransform::fromTranslate(50, 50), true); + item1->setTransform(QTransform().rotate(90), true); QGraphicsItem *item2 = scene.addRect(0, 0, 100, 100, QPen(), Qt::green); item2->setPos(50, 50); - item2->translate(50, 50); - item2->rotate(90); + item2->setTransform(QTransform::fromTranslate(50, 50), true); + item2->setTransform(QTransform().rotate(90), true); item2->setFlags(QGraphicsItem::ItemIgnoresTransformations); QGraphicsRectItem *item1_topleft = new QGraphicsRectItem(QRectF(-2, -2, 4, 4)); diff --git a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/qgraphicsitemanimation.pro b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/qgraphicsitemanimation.pro index 484f4ba5f8..3515d259d0 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/qgraphicsitemanimation.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/qgraphicsitemanimation.pro @@ -3,5 +3,4 @@ TARGET = tst_qgraphicsitemanimation QT += widgets testlib SOURCES += tst_qgraphicsitemanimation.cpp DEFINES += QT_NO_CAST_TO_ASCII -CONFIG += parallel_test diff --git a/tests/auto/widgets/graphicsview/qgraphicslayout/qgraphicslayout.pro b/tests/auto/widgets/graphicsview/qgraphicslayout/qgraphicslayout.pro index 254a91ef6a..1be43692d5 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslayout/qgraphicslayout.pro +++ b/tests/auto/widgets/graphicsview/qgraphicslayout/qgraphicslayout.pro @@ -7,4 +7,3 @@ TARGET = tst_qgraphicslayout QT += widgets testlib SOURCES += tst_qgraphicslayout.cpp DEFINES += QT_USE_USING_NAMESPACE -CONFIG += parallel_test diff --git a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/qgraphicslayoutitem.pro b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/qgraphicslayoutitem.pro index ef5cc36d05..e4a970201a 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/qgraphicslayoutitem.pro +++ b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/qgraphicslayoutitem.pro @@ -2,5 +2,4 @@ CONFIG += testcase TARGET = tst_qgraphicslayoutitem QT += widgets testlib SOURCES += tst_qgraphicslayoutitem.cpp -CONFIG += parallel_test diff --git a/tests/auto/widgets/graphicsview/qgraphicsobject/qgraphicsobject.pro b/tests/auto/widgets/graphicsview/qgraphicsobject/qgraphicsobject.pro index 60f09c2228..483f123fa7 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsobject/qgraphicsobject.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsobject/qgraphicsobject.pro @@ -5,4 +5,3 @@ QT += widgets testlib QT += core-private SOURCES += tst_qgraphicsobject.cpp -CONFIG += parallel_test diff --git a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/qgraphicspixmapitem.pro b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/qgraphicspixmapitem.pro index 6452e39c56..123f1050ec 100644 --- a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/qgraphicspixmapitem.pro +++ b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/qgraphicspixmapitem.pro @@ -2,5 +2,4 @@ CONFIG += testcase TARGET = tst_qgraphicspixmapitem QT += widgets testlib SOURCES += tst_qgraphicspixmapitem.cpp -CONFIG += parallel_test diff --git a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/qgraphicspolygonitem.pro b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/qgraphicspolygonitem.pro index bca0ecc20c..89847e9ed2 100644 --- a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/qgraphicspolygonitem.pro +++ b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/qgraphicspolygonitem.pro @@ -2,5 +2,3 @@ CONFIG += testcase TARGET = tst_qgraphicspolygonitem QT += widgets testlib SOURCES += tst_qgraphicspolygonitem.cpp -CONFIG += parallel_test - diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro index 38fef51394..e7bcccb495 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro @@ -6,4 +6,3 @@ QT += core-private gui-private SOURCES += tst_qgraphicsproxywidget.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 8760dc176c..7d5946dc5f 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -162,7 +162,9 @@ private slots: void fontPropagation(); void dontCrashWhenDie(); void createProxyForChildWidget(); +#ifndef QT_NO_CONTEXTMENU void actionsContextMenu(); +#endif // QT_NO_CONTEXTMENU void actionsContextMenu_data(); void deleteProxyForChildWidget(); void bypassGraphicsProxyWidget_data(); @@ -492,7 +494,7 @@ void tst_QGraphicsProxyWidget::setWidget() QCOMPARE(proxy->rect().toRect(), widget->rect()); QCOMPARE(proxy->focusPolicy(), Qt::WheelFocus); QVERIFY(proxy->acceptDrops()); - QCOMPARE(proxy->acceptsHoverEvents(), true); // to get widget enter events + QCOMPARE(proxy->acceptHoverEvents(), true); // to get widget enter events int left, top, right, bottom; widget->getContentsMargins(&left, &top, &right, &bottom); qreal rleft, rtop, rright, rbottom; @@ -3072,6 +3074,7 @@ void tst_QGraphicsProxyWidget::createProxyForChildWidget() delete boxProxy; } +#ifndef QT_NO_CONTEXTMENU class ContextMenuWidget : public QLabel { Q_OBJECT @@ -3120,6 +3123,7 @@ private: bool m_embeddedPopupSet; QTimer *m_timer; }; +#endif // QT_NO_CONTEXTMENU void tst_QGraphicsProxyWidget::actionsContextMenu_data() { @@ -3132,6 +3136,7 @@ void tst_QGraphicsProxyWidget::actionsContextMenu_data() QTest::newRow("with actionsContextMenu without focus") << true << false; } +#ifndef QT_NO_CONTEXTMENU void tst_QGraphicsProxyWidget::actionsContextMenu() { QFETCH(bool, hasFocus); @@ -3186,7 +3191,7 @@ void tst_QGraphicsProxyWidget::actionsContextMenu() } } - +#endif // QT_NO_CONTEXTMENU void tst_QGraphicsProxyWidget::deleteProxyForChildWidget() { diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro index 25a43d6821..1a775d8b16 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro @@ -17,4 +17,3 @@ wince* { DEPLOYMENT += rootFiles renderFiles DEFINES += SRCDIR=\\\".\\\" } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index ae71b0412f..4a16c8583d 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -108,7 +108,7 @@ class HoverItem : public QGraphicsRectItem public: HoverItem() : QGraphicsRectItem(QRectF(-10, -10, 20, 20)), isHovered(false) - { setAcceptsHoverEvents(true); } + { setAcceptHoverEvents(true); } bool isHovered; @@ -227,8 +227,10 @@ private slots: void render_data(); void render(); void renderItemsWithNegativeWidthOrHeight(); +#ifndef QT_NO_CONTEXTMENU void contextMenuEvent(); void contextMenuEvent_ItemIgnoresTransformations(); +#endif void update(); void update2(); void views(); @@ -301,11 +303,16 @@ void tst_QGraphicsScene::construction() QVERIFY(scene.items(QPainterPath()).isEmpty()); QTest::ignoreMessage(QtWarningMsg, "QGraphicsScene::collidingItems: cannot find collisions for null item"); QVERIFY(scene.collidingItems(0).isEmpty()); - QVERIFY(!scene.itemAt(QPointF())); + QVERIFY(scene.items(QPointF()).isEmpty()); QVERIFY(scene.selectedItems().isEmpty()); QVERIFY(!scene.focusItem()); } +static inline const QGraphicsItem *itemAt(const QGraphicsScene &scene, qreal x, qreal y) +{ + return scene.items(QPointF(x, y)).value(0, Q_NULLPTR); +} + void tst_QGraphicsScene::sceneRect() { QGraphicsScene scene; @@ -318,8 +325,8 @@ void tst_QGraphicsScene::sceneRect() item->setPos(-5, -5); QCOMPARE(sceneRectChanged.count(), 0); - QCOMPARE(scene.itemAt(0, 0), item); - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 0, 0), item); + QVERIFY(scene.items(QPointF(10, 10)).isEmpty()); QCOMPARE(sceneRectChanged.count(), 0); QCOMPARE(scene.sceneRect(), QRectF(-5, -5, 10, 10)); QCOMPARE(sceneRectChanged.count(), 1); @@ -334,8 +341,8 @@ void tst_QGraphicsScene::sceneRect() QCOMPARE(sceneRectChanged.count(), 3); QCOMPARE(sceneRectChanged.last().at(0).toRectF(), scene.sceneRect()); - QCOMPARE(scene.itemAt(0, 0), item); - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 0, 0), item); + QVERIFY(scene.items(QPointF(10, 10)).isEmpty()); QCOMPARE(scene.sceneRect(), QRectF(-100, -100, 10, 10)); item->setPos(10, 10); QCOMPARE(scene.sceneRect(), QRectF(-100, -100, 10, 10)); @@ -344,8 +351,8 @@ void tst_QGraphicsScene::sceneRect() scene.setSceneRect(QRectF()); - QCOMPARE(scene.itemAt(10, 10), item); - QCOMPARE(scene.itemAt(20, 20), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 10, 10), item); + QVERIFY(scene.items(QPointF(20, 20)).isEmpty()); QCOMPARE(sceneRectChanged.count(), 4); QCOMPARE(scene.sceneRect(), QRectF(-5, -5, 25, 25)); QCOMPARE(sceneRectChanged.count(), 5); @@ -374,7 +381,7 @@ void tst_QGraphicsScene::itemIndexMethod() for (int x = minX; x < maxX; x += 100) { QGraphicsItem *item = scene.addRect(QRectF(0, 0, 10, 10)); item->setPos(x, y); - QCOMPARE(scene.itemAt(x, y), item); + QCOMPARE(itemAt(scene, x, y), item); items << item; } } @@ -382,7 +389,7 @@ void tst_QGraphicsScene::itemIndexMethod() int n = 0; for (int y = minY; y < maxY; y += 100) { for (int x = minX; x < maxX; x += 100) - QCOMPARE(scene.itemAt(x, y), items.at(n++)); + QCOMPARE(itemAt(scene, x, y), items.at(n++)); } scene.setItemIndexMethod(QGraphicsScene::NoIndex); @@ -391,7 +398,7 @@ void tst_QGraphicsScene::itemIndexMethod() n = 0; for (int y = minY; y < maxY; y += 100) { for (int x = minX; x < maxX; x += 100) - QCOMPARE(scene.itemAt(x, y), items.at(n++)); + QCOMPARE(itemAt(scene, x, y), items.at(n++)); } scene.setItemIndexMethod(QGraphicsScene::BspTreeIndex); @@ -400,7 +407,7 @@ void tst_QGraphicsScene::itemIndexMethod() n = 0; for (int y = minY; y < maxY; y += 100) { for (int x = minX; x < maxX; x += 100) - QCOMPARE(scene.itemAt(x, y), items.at(n++)); + QCOMPARE(itemAt(scene, x, y), items.at(n++)); } } @@ -439,7 +446,7 @@ void tst_QGraphicsScene::items() items << scene.addRect(QRectF(0, 0, 10, 10)); } QCOMPARE(scene.items().size(), items.size()); - scene.itemAt(0, 0); // trigger indexing + itemAt(scene, 0, 0); // trigger indexing scene.removeItem(items.at(5)); delete items.at(5); @@ -458,8 +465,8 @@ void tst_QGraphicsScene::items() QList<QGraphicsItem *> items; items<<l1<<l2; QCOMPARE(scene.items().size(), items.size()); - QVERIFY(scene.items(-1, -1, 2, 2).contains(l1)); - QVERIFY(scene.items(-1, -1, 2, 2).contains(l2)); + QVERIFY(scene.items(QRectF(-1, -1, 2, 2)).contains(l1)); + QVERIFY(scene.items(QRectF(-1, -1, 2, 2)).contains(l2)); } } @@ -722,7 +729,7 @@ void tst_QGraphicsScene::items_QRectF_2() QGraphicsItem *item = scene.addEllipse(ellipseRect); QCOMPARE(!scene.items(sceneRect, selectionMode).isEmpty(), contained); - item->rotate(45); + item->setTransform(QTransform().rotate(45), true); QCOMPARE(!scene.items(sceneRect, selectionMode).isEmpty(), containedRotated); } @@ -1085,19 +1092,19 @@ void tst_QGraphicsScene::addItem() QTRY_VERIFY(view.repaints > 0); view.repaints = 0; - QCOMPARE(scene.itemAt(0, 0), path); + QCOMPARE(itemAt(scene, 0, 0), path); QGraphicsItem *path2 = new QGraphicsEllipseItem(QRectF(-10, -10, 20, 20)); path2->setPos(100, 100); - QCOMPARE(scene.itemAt(0, 0), path); - QCOMPARE(scene.itemAt(100, 100), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 0, 0), path); + QVERIFY(scene.items(QPointF(100, 100)).isEmpty()); scene.addItem(path2); // Adding an item should always issue a repaint. QTRY_VERIFY(view.repaints > 0); - QCOMPARE(scene.itemAt(100, 100), path2); + QCOMPARE(itemAt(scene, 100, 100), path2); } { // 2) Create scene, then item, then add item @@ -1109,8 +1116,8 @@ void tst_QGraphicsScene::addItem() path2->setPos(100, 100); scene.addItem(path2); - QCOMPARE(scene.itemAt(0, 0), path); - QCOMPARE(scene.itemAt(100, 100), path2); + QCOMPARE(itemAt(scene, 0, 0), path); + QCOMPARE(itemAt(scene, 100, 100), path2); } } @@ -1123,15 +1130,15 @@ void tst_QGraphicsScene::addEllipse() QCOMPARE(ellipse->pen(), QPen(Qt::red)); QCOMPARE(ellipse->brush(), QBrush(Qt::blue)); QCOMPARE(ellipse->rect(), QRectF(-10, -10, 20, 20)); - QCOMPARE(scene.itemAt(0, 0), (QGraphicsItem *)ellipse); - QCOMPARE(scene.itemAt(-10, -10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(-9.9, 0), (QGraphicsItem *)ellipse); - QCOMPARE(scene.itemAt(-10, 10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(0, -9.9), (QGraphicsItem *)ellipse); - QCOMPARE(scene.itemAt(0, 9.9), (QGraphicsItem *)ellipse); - QCOMPARE(scene.itemAt(10, -10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(9.9, 0), (QGraphicsItem *)ellipse); - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)ellipse); + QVERIFY(scene.items(QPointF(-10, -10)).isEmpty()); + QCOMPARE(itemAt(scene, -9.9, 0), (QGraphicsItem *)ellipse); + QVERIFY(scene.items(QPointF(-10, 10)).isEmpty()); + QCOMPARE(itemAt(scene, 0, -9.9), (QGraphicsItem *)ellipse); + QCOMPARE(itemAt(scene, 0, 9.9), (QGraphicsItem *)ellipse); + QVERIFY(scene.items(QPointF(10, -10)).isEmpty()); + QCOMPARE(itemAt(scene, 9.9, 0), (QGraphicsItem *)ellipse); + QVERIFY(scene.items(QPointF(10, 10)).isEmpty()); } void tst_QGraphicsScene::addLine() @@ -1144,15 +1151,15 @@ void tst_QGraphicsScene::addLine() QCOMPARE(line->pos(), QPointF()); QCOMPARE(line->pen(), pen); QCOMPARE(line->line(), QLineF(-10, -10, 20, 20)); - QCOMPARE(scene.itemAt(0, 0), (QGraphicsItem *)line); - QCOMPARE(scene.itemAt(-10, -10), (QGraphicsItem *)line); - QCOMPARE(scene.itemAt(-9.9, 0), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(-10, 10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(0, -9.9), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(0, 9.9), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(10, -10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(9.9, 0), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)line); + QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)line); + QCOMPARE(itemAt(scene, -10, -10), (QGraphicsItem *)line); + QVERIFY(scene.items(QPointF(-9.9, 0)).isEmpty()); + QVERIFY(scene.items(QPointF(-10, 10)).isEmpty()); + QVERIFY(scene.items(QPointF(0, -9.9)).isEmpty()); + QVERIFY(scene.items(QPointF(0, 9.9)).isEmpty()); + QVERIFY(scene.items(QPointF(10, -10)).isEmpty()); + QVERIFY(scene.items(QPointF(9.9, 0)).isEmpty()); + QCOMPARE(itemAt(scene, 10, 10), (QGraphicsItem *)line); } void tst_QGraphicsScene::addPath() @@ -1170,27 +1177,27 @@ void tst_QGraphicsScene::addPath() path->setPen(QPen(Qt::red, 0)); - QCOMPARE(scene.itemAt(0, 0), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(-9.9, 0), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(9.9, 0), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(0, -9.9), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(0, 9.9), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(0, 30), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(-9.9, 30), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(9.9, 30), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(0, 20.1), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(0, 39.9), (QGraphicsItem *)path); - QCOMPARE(scene.itemAt(-10, -10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(10, -10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(-10, 10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(-10, 20), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(10, 20), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, -9.9, 0), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, 9.9, 0), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, 0, -9.9), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, 0, 9.9), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, 0, 30), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, -9.9, 30), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, 9.9, 30), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, 0, 20.1), (QGraphicsItem *)path); + QCOMPARE(itemAt(scene, 0, 39.9), (QGraphicsItem *)path); + QVERIFY(scene.items(QPointF(-10, -10)).isEmpty()); + QVERIFY(scene.items(QPointF(10, -10)).isEmpty()); + QVERIFY(scene.items(QPointF(-10, 10)).isEmpty()); + QVERIFY(scene.items(QPointF(10, 10)).isEmpty()); + QVERIFY(scene.items(QPointF(-10, 20)).isEmpty()); + QVERIFY(scene.items(QPointF(10, 20)).isEmpty()); if (sizeof(qreal) != sizeof(double)) QWARN("Skipping test because of rounding errors when qreal != double"); else - QCOMPARE(scene.itemAt(-10, 30), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(10.1, 30), (QGraphicsItem *)0); + QVERIFY(scene.items(QPointF(-10, 30)).isEmpty()); + QVERIFY(scene.items(QPointF(10.1, 30)).isEmpty()); } void tst_QGraphicsScene::addPixmap() @@ -1201,16 +1208,17 @@ void tst_QGraphicsScene::addPixmap() QCOMPARE(pixmap->pos(), QPointF()); QCOMPARE(pixmap->pixmap(), pix); - QCOMPARE(scene.itemAt(0, 0), (QGraphicsItem *)pixmap); - QCOMPARE(scene.itemAt(pix.width() - 1, 0), (QGraphicsItem *)pixmap); - QCOMPARE(scene.itemAt(0, pix.height() - 1), (QGraphicsItem *)pixmap); - QCOMPARE(scene.itemAt(pix.width() - 1, pix.height() - 1), (QGraphicsItem *)pixmap); - QCOMPARE(scene.itemAt(-1, -1), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(pix.width() - 1, -1), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(-1, pix.height() - 1), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(pix.width(), pix.height()), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(0, pix.height()), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(pix.width(), 0), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)pixmap); + QCOMPARE(itemAt(scene, pix.width() - 1, 0), (QGraphicsItem *)pixmap); + QCOMPARE(itemAt(scene, 0, pix.height() - 1), (QGraphicsItem *)pixmap); + QCOMPARE(itemAt(scene, pix.width() - 1, pix.height() - 1), (QGraphicsItem *)pixmap); + + QVERIFY(scene.items(QPointF(-1, -1)).isEmpty()); + QVERIFY(scene.items(QPointF(pix.width() - 1, -1)).isEmpty()); + QVERIFY(scene.items(QPointF(-1, pix.height() - 1)).isEmpty()); + QVERIFY(scene.items(QPointF(pix.width(), pix.height())).isEmpty()); + QVERIFY(scene.items(QPointF(0, pix.height())).isEmpty()); + QVERIFY(scene.items(QPointF(pix.width(), 0)).isEmpty()); } void tst_QGraphicsScene::addRect() @@ -1225,15 +1233,15 @@ void tst_QGraphicsScene::addRect() rect->setPen(QPen(Qt::red, 0)); - QCOMPARE(scene.itemAt(0, 0), (QGraphicsItem *)rect); - QCOMPARE(scene.itemAt(-10, -10), (QGraphicsItem *)rect); - QCOMPARE(scene.itemAt(-9.9, 0), (QGraphicsItem *)rect); - QCOMPARE(scene.itemAt(-10, 10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(0, -9.9), (QGraphicsItem *)rect); - QCOMPARE(scene.itemAt(0, 9.9), (QGraphicsItem *)rect); - QCOMPARE(scene.itemAt(10, -10), (QGraphicsItem *)0); - QCOMPARE(scene.itemAt(9.9, 0), (QGraphicsItem *)rect); - QCOMPARE(scene.itemAt(10, 10), (QGraphicsItem *)0); + QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)rect); + QCOMPARE(itemAt(scene, -10, -10), (QGraphicsItem *)rect); + QCOMPARE(itemAt(scene, -9.9, 0), (QGraphicsItem *)rect); + QVERIFY(scene.items(QPointF(-10, 10)).isEmpty()); + QCOMPARE(itemAt(scene, 0, -9.9), (QGraphicsItem *)rect); + QCOMPARE(itemAt(scene, 0, 9.9), (QGraphicsItem *)rect); + QVERIFY(scene.items(QPointF(10, -10)).isEmpty()); + QCOMPARE(itemAt(scene, 9.9, 0), (QGraphicsItem *)rect); + QVERIFY(scene.items(QPointF(10, 10)).isEmpty()); } void tst_QGraphicsScene::addText() @@ -1252,14 +1260,14 @@ void tst_QGraphicsScene::removeItem() #endif QGraphicsScene scene; QGraphicsItem *item = scene.addRect(QRectF(0, 0, 10, 10)); - QCOMPARE(scene.itemAt(0, 0), item); // forces indexing + QCOMPARE(itemAt(scene, 0, 0), item); // forces indexing scene.removeItem(item); - QCOMPARE(scene.itemAt(0, 0), (QGraphicsItem *)0); + QVERIFY(scene.items(QPointF(0, 0)).isEmpty()); delete item; QGraphicsItem *item2 = scene.addRect(QRectF(0, 0, 10, 10)); item2->setFlag(QGraphicsItem::ItemIsSelectable); - QCOMPARE(scene.itemAt(0, 0), item2); + QCOMPARE(itemAt(scene, 0, 0), item2); // Removing a selected item QVERIFY(scene.selectedItems().isEmpty()); @@ -1289,7 +1297,7 @@ void tst_QGraphicsScene::removeItem() QTRY_VERIFY(hoverItem->isHovered); scene.removeItem(hoverItem); - hoverItem->setAcceptsHoverEvents(false); + hoverItem->setAcceptHoverEvents(false); scene.addItem(hoverItem); QTRY_VERIFY(!hoverItem->isHovered); } @@ -1801,7 +1809,7 @@ void tst_QGraphicsScene::createItemGroup() scene.destroyItemGroup(group); QGraphicsItemGroup *emptyGroup = scene.createItemGroup(QList<QGraphicsItem *>()); - QCOMPARE(emptyGroup->children(), QList<QGraphicsItem *>()); + QVERIFY(emptyGroup->childItems().isEmpty()); QVERIFY(!emptyGroup->parentItem()); QCOMPARE(emptyGroup->scene(), &scene); } @@ -2140,7 +2148,7 @@ void tst_QGraphicsScene::mouseEventPropagation_mouseMove() { Scene scene; scene.addRect(QRectF(5, 0, 12, 12)); - scene.addRect(QRectF(15, 0, 12, 12))->setAcceptsHoverEvents(true); + scene.addRect(QRectF(15, 0, 12, 12))->setAcceptHoverEvents(true); for (int i = 0; i < 30; ++i) { QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseMove); event.setScenePos(QPointF(i, 5)); @@ -2706,6 +2714,7 @@ void tst_QGraphicsScene::renderItemsWithNegativeWidthOrHeight() QCOMPARE(actual, expected); } +#ifndef QT_NO_CONTEXTMENU void tst_QGraphicsScene::contextMenuEvent() { QGraphicsScene scene; @@ -2788,6 +2797,7 @@ void tst_QGraphicsScene::contextMenuEvent_ItemIgnoresTransformations() QVERIFY(!event.isAccepted()); } } +#endif // QT_NO_CONTEXTMENU void tst_QGraphicsScene::update() { @@ -2800,7 +2810,7 @@ void tst_QGraphicsScene::update() rect->setPos(-100, -100); // This function forces indexing - scene.itemAt(0, 0); + itemAt(scene, 0, 0); qRegisterMetaType<QList<QRectF> >("QList<QRectF>"); QSignalSpy spy(&scene, SIGNAL(changed(QList<QRectF>))); @@ -2809,7 +2819,7 @@ void tst_QGraphicsScene::update() scene.update(); // This function forces a purge, which will post an update signal - scene.itemAt(0, 0); + itemAt(scene, 0, 0); // This will process the pending update QApplication::instance()->processEvents(); @@ -3257,10 +3267,11 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() FocusWidget *widget1_1 = new FocusWidget; FocusWidget *widget1_2 = new FocusWidget; widget1_1->setParentItem(widget1); - widget1_1->scale(0.5, 0.5); + const QTransform scale(QTransform::fromScale(0.5, 0.5)); + widget1_1->setTransform(scale, true); widget1_1->setPos(0, widget1->boundingRect().height() / 2); widget1_2->setParentItem(widget1); - widget1_2->scale(0.5, 0.5); + widget1_2->setTransform(scale, true); widget1_2->setPos(widget1->boundingRect().width() / 2, widget1->boundingRect().height() / 2); FocusWidget *widget2 = new FocusWidget; @@ -3520,7 +3531,7 @@ void tst_QGraphicsScene::task250680_childClip() QVERIFY(QPathCompare::comparePaths(rect->clipPath().simplified(), path)); QCOMPARE(scene.items(QRectF(320, 240, 5, 5)).size(), 2); - rect->rotate(45); + rect->setTransform(QTransform().rotate(45), true); QCOMPARE(scene.items(QRectF(320, 240, 5, 5)).size(), 2); } @@ -3599,20 +3610,20 @@ void tst_QGraphicsScene::sorting() // view.show(); qDebug() << "items: {"; - foreach (QGraphicsItem *item, scene.items(32, 31, 4, 55)) + foreach (QGraphicsItem *item, scene.items(QRectF(32, 31, 4, 55))) qDebug() << "\t" << item->data(0).toString(); qDebug() << "}"; - QCOMPARE(scene.items(32, 31, 4, 55), + QCOMPARE(scene.items(QRectF(32, 31, 4, 55)), QList<QGraphicsItem *>() << c_1_2 << c_1_1_1 << c_1 << t_1); - QCOMPARE(scene.items(-53, 47, 136, 3), + QCOMPARE(scene.items(QRectF(-53, 47, 136, 3)), QList<QGraphicsItem *>() << c_2_2 << c_2_1 << c_2 << c_1_2 << c_1_1 << c_1 << t_1); - QCOMPARE(scene.items(-23, 79, 104, 3), + QCOMPARE(scene.items(QRectF(-23, 79, 104, 3)), QList<QGraphicsItem *>() << c_2_1_1 << c_1_1_1); - QCOMPARE(scene.items(-26, -3, 92, 79), + QCOMPARE(scene.items(QRectF(-26, -3, 92, 79)), QList<QGraphicsItem *>() << c_2_2 << c_2_1_1 << c_2_1 << c_2 << c_1_2 << c_1_1_1 << c_1_1 << c_1 @@ -4376,7 +4387,7 @@ void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts() QGraphicsProxyWidget *proxy = scene->addWidget(w); proxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache); - proxy->rotate(15); + proxy->setTransform(QTransform().rotate(15), true); view->show(); QVERIFY(QTest::qWaitForWindowExposed(view)); @@ -4422,7 +4433,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts() scene->addItem(backItem); rectItem->setCacheMode(QGraphicsItem::DeviceCoordinateCache); - backItem->rotate(15); + backItem->setTransform(QTransform().rotate(15), true); view->show(); QVERIFY(QTest::qWaitForWindowExposed(view)); @@ -4464,7 +4475,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts() scene->addItem(rectItem); rectItem->setCacheMode(QGraphicsItem::ItemCoordinateCache); - rectItem->rotate(15); + rectItem->setTransform(QTransform().rotate(15), true); view->show(); QVERIFY(QTest::qWaitForWindowExposed(view)); @@ -4505,7 +4516,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts() scene->addItem(rectItem); rectItem->setCacheMode(QGraphicsItem::ItemCoordinateCache); - rectItem->rotate(15); + rectItem->setTransform(QTransform().rotate(15), true); view->show(); QVERIFY(QTest::qWaitForWindowExposed(view)); @@ -4609,41 +4620,41 @@ void tst_QGraphicsScene::focusItemChangedSignal() QCOMPARE(spy.count(), 1); QList<QVariant> arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)0); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::OtherFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)0); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::OtherFocusReason); QVERIFY(topLevelItem2->hasFocus()); scene.clearFocus(); QCOMPARE(spy.count(), 1); arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)0); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::OtherFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)0); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::OtherFocusReason); scene.setFocus(Qt::MenuBarFocusReason); QCOMPARE(spy.count(), 1); arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)0); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::MenuBarFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)0); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::MenuBarFocusReason); for (int i = 0; i < 3; ++i) { topLevelItem1->setFocus(Qt::TabFocusReason); arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem1); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::TabFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem1); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::TabFocusReason); topLevelItem2->setFocus(Qt::TabFocusReason); arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem1); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::TabFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem1); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::TabFocusReason); } // The following two are unexpected, but fixing this (i.e., losing and gaining focus @@ -4664,9 +4675,9 @@ void tst_QGraphicsScene::focusItemChangedSignal() QCOMPARE(spy.count(), 1); arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel1); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel1); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason); QGraphicsRectItem *panel2 = new QGraphicsRectItem; panel2->setFlags(QGraphicsItem::ItemIsPanel | QGraphicsItem::ItemIsFocusable); @@ -4678,17 +4689,17 @@ void tst_QGraphicsScene::focusItemChangedSignal() QCOMPARE(spy.count(), 1); arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel2); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)panel1); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel2); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)panel1); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason); scene.setActivePanel(panel1); QCOMPARE(spy.count(), 1); arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 3); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel1); - QCOMPARE(qVariantValue<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)panel2); - QCOMPARE(qVariantValue<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel1); + QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)panel2); + QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason); } } diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro b/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro index 3d0d73566e..3b74ab0c75 100644 --- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro +++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro @@ -4,4 +4,3 @@ requires(contains(QT_CONFIG,private_tests)) QT += widgets widgets-private testlib QT += core-private gui-private SOURCES += tst_qgraphicssceneindex.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp index b2d6eef9b1..88c081bcfb 100644 --- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp @@ -327,7 +327,7 @@ void tst_QGraphicsSceneIndex::removeItems() delete widgetChild1; //We move the parent - scene.items(295, 295, 50, 50); + scene.items(QRectF(295, 295, 50, 50)); //This should not crash } diff --git a/tests/auto/widgets/graphicsview/qgraphicstransform/qgraphicstransform.pro b/tests/auto/widgets/graphicsview/qgraphicstransform/qgraphicstransform.pro index a46c803e41..68ee58d0d7 100644 --- a/tests/auto/widgets/graphicsview/qgraphicstransform/qgraphicstransform.pro +++ b/tests/auto/widgets/graphicsview/qgraphicstransform/qgraphicstransform.pro @@ -2,5 +2,3 @@ CONFIG += testcase TARGET = tst_qgraphicstransform QT += widgets testlib SOURCES += tst_qgraphicstransform.cpp -CONFIG += parallel_test - diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro index d1f9bede0b..258b5e0e14 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro @@ -9,4 +9,3 @@ SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp HEADERS += tst_qgraphicsview.h DEFINES += QT_NO_CAST_TO_ASCII -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 98473fb5cc..e1ed9f5e23 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -468,10 +468,12 @@ void tst_QGraphicsView::interactive() QCOMPARE(item->events.size(), i * 5 + 5); QCOMPARE(item->events.at(item->events.size() - 2), QEvent::GraphicsSceneMouseRelease); QCOMPARE(item->events.at(item->events.size() - 1), QEvent::UngrabMouse); +#ifndef QT_NO_CONTEXTMENU QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, itemPoint, view.mapToGlobal(itemPoint)); QApplication::sendEvent(view.viewport(), &contextEvent); QCOMPARE(item->events.size(), i * 5 + 6); QCOMPARE(item->events.last(), QEvent::GraphicsSceneContextMenu); +#endif // QT_NO_CONTEXTMENU } view.setInteractive(false); @@ -483,10 +485,12 @@ void tst_QGraphicsView::interactive() sendMouseRelease(view.viewport(), itemPoint); QCOMPARE(item->events.size(), 501); QCOMPARE(item->events.last(), QEvent::GraphicsSceneContextMenu); +#ifndef QT_NO_CONTEXTMENU QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, itemPoint, view.mapToGlobal(itemPoint)); QApplication::sendEvent(view.viewport(), &contextEvent); QCOMPARE(item->events.size(), 501); QCOMPARE(item->events.last(), QEvent::GraphicsSceneContextMenu); +#endif // QT_NO_CONTEXTMENU } } @@ -1391,8 +1395,8 @@ void tst_QGraphicsView::fitInView() items[2]->setPos(-100, 100); items[3]->setPos(100, 100); - items[0]->rotate(30); - items[1]->rotate(-30); + items[0]->setTransform(QTransform().rotate(30), true); + items[1]->setTransform(QTransform().rotate(-30), true); #if defined(Q_OS_WINCE) //Is the standard scrollbar size @@ -2888,9 +2892,6 @@ void tst_QGraphicsView::scrollBarRanges() QFETCH(ExpectedValueDescription, vmax); QFETCH(bool, useStyledPanel); - if (style == QLatin1String("GTK+") && useStyledPanel) - QSKIP("GTK + style test skipped, see QTBUG-29002"); - if (useStyledPanel && style == QStringLiteral("Macintosh") && platformName == QStringLiteral("cocoa")) QSKIP("Insignificant on OSX"); QGraphicsScene scene; @@ -3506,7 +3507,7 @@ void tst_QGraphicsView::embeddedViews() SpyItem *item = new SpyItem; v2->scene()->addItem(item); - proxy->translate(5, 5); + proxy->setTransform(QTransform::fromTranslate(5, 5), true); QImage actual(64, 64, QImage::Format_ARGB32_Premultiplied); actual.fill(0); diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro index 481bc96d96..042c42f63f 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro @@ -6,4 +6,3 @@ QT += core-private gui-private SOURCES += tst_qgraphicswidget.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index ec2203e615..2f10d8d911 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -1108,7 +1108,7 @@ void tst_QGraphicsWidget::initStyleOption() view.setAlignment(Qt::AlignTop | Qt::AlignLeft); SubQGraphicsWidget *widget = new SubQGraphicsWidget; - widget->setAcceptsHoverEvents(true); + widget->setAcceptHoverEvents(true); QStyleOption option; scene.addItem(widget); @@ -2090,12 +2090,12 @@ void tst_QGraphicsWidget::task236127_bspTreeIndexFails() view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - QTRY_VERIFY(!scene.itemAt(25, 25)); + QTRY_VERIFY(scene.items(QPointF(25, 25)).isEmpty()); widget->setGeometry(0, 112, 360, 528); - QTRY_COMPARE(scene.itemAt(15, 120), (QGraphicsItem *)widget); + QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget); widget2->setGeometry(0, 573, 360, 67); - QTRY_COMPARE(scene.itemAt(15, 120), (QGraphicsItem *)widget); - QTRY_COMPARE(scene.itemAt(50, 585), (QGraphicsItem *)widget2); + QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget); + QTRY_COMPARE(scene.items(QPointF(50, 585)).value(0, Q_NULLPTR), (QGraphicsItem *)widget2); } void tst_QGraphicsWidget::defaultSize() diff --git a/tests/auto/widgets/itemviews/qdatawidgetmapper/qdatawidgetmapper.pro b/tests/auto/widgets/itemviews/qdatawidgetmapper/qdatawidgetmapper.pro index 3f4cb491f4..53b23b5ef2 100644 --- a/tests/auto/widgets/itemviews/qdatawidgetmapper/qdatawidgetmapper.pro +++ b/tests/auto/widgets/itemviews/qdatawidgetmapper/qdatawidgetmapper.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdatawidgetmapper QT += widgets testlib SOURCES += tst_qdatawidgetmapper.cpp diff --git a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp index f12876f745..63cf7b2751 100644 --- a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp +++ b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp @@ -416,14 +416,14 @@ void tst_QDirModel::rowsAboutToBeRemoved_data() bool tst_QDirModel::rowsAboutToBeRemoved_init(const QString &test_path, const QStringList &initial_files) { - QString path = QDir::currentPath() + "/" + test_path; + QString path = QDir::currentPath() + QLatin1Char('/') + test_path; if (!QDir::current().mkdir(test_path) && false) { // FIXME qDebug() << "failed to create dir" << path; return false; } for (int i = 0; i < initial_files.count(); ++i) { - QFile file(path + "/" + initial_files.at(i)); + QFile file(path + QLatin1Char('/') + initial_files.at(i)); if (!file.open(QIODevice::WriteOnly)) { qDebug() << "failed to open file" << initial_files.at(i); return false; @@ -443,7 +443,7 @@ bool tst_QDirModel::rowsAboutToBeRemoved_init(const QString &test_path, const QS bool tst_QDirModel::rowsAboutToBeRemoved_cleanup(const QString &test_path) { - QString path = QDir::currentPath() + "/" + test_path; + QString path = QDir::currentPath() + QLatin1Char('/') + test_path; QDir dir(path, "*", QDir::SortFlags(QDir::Name|QDir::IgnoreCase), QDir::Files); QStringList files = dir.entryList(); @@ -584,8 +584,8 @@ void tst_QDirModel::filePath() QString path = SRCDIR; #else QString path = QFileInfo(SRCDIR).absoluteFilePath(); - if (!path.endsWith("/")) - path += "/"; + if (!path.endsWith(QLatin1Char('/'))) + path += QLatin1Char('/'); #endif QCOMPARE(model.filePath(index), path + QString( "test.lnk")); model.setResolveSymlinks(true); diff --git a/tests/auto/widgets/itemviews/qfileiconprovider/qfileiconprovider.pro b/tests/auto/widgets/itemviews/qfileiconprovider/qfileiconprovider.pro index 0c3a780405..37173a175e 100644 --- a/tests/auto/widgets/itemviews/qfileiconprovider/qfileiconprovider.pro +++ b/tests/auto/widgets/itemviews/qfileiconprovider/qfileiconprovider.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfileiconprovider QT += widgets testlib SOURCES += tst_qfileiconprovider.cpp diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index 7e73c19539..6738ab60df 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -2492,7 +2492,7 @@ void tst_QHeaderView::calculateAndCheck(int cppline, const int precalced_compare QString msg = "semantic problem at " + QString(__FILE__) + " (" + sline + ")"; msg += "\nThe *expected* result was : {" + istr(x[0]) + istr(x[1]) + istr(x[2]) + istr(x[3]) - + istr(x[4]) + istr(x[5]) + istr(x[6], false) + "}"; + + istr(x[4]) + istr(x[5]) + istr(x[6], false) + QLatin1Char('}'); msg += "\nThe calculated result was : {"; msg += istr(chk_visual) + istr(chk_logical) + istr(chk_sizes) + istr(chk_hidden_size) + istr(chk_lookup_visual) + istr(chk_lookup_logical) + istr(header_lenght, false) + "};"; @@ -2570,7 +2570,7 @@ void tst_QHeaderView::additionalInit() for (int i = 0; i < model->rowCount(); ++i) { model->setData(model->index(i, 0), QVariant(i)); s.setNum(i); - s += "."; + s += QLatin1Char('.'); s += 'a' + (i % 25); model->setData(model->index(i, 1), QVariant(s)); } diff --git a/tests/auto/widgets/itemviews/qitemeditorfactory/qitemeditorfactory.pro b/tests/auto/widgets/itemviews/qitemeditorfactory/qitemeditorfactory.pro index 55df1d83f1..5ff7771585 100644 --- a/tests/auto/widgets/itemviews/qitemeditorfactory/qitemeditorfactory.pro +++ b/tests/auto/widgets/itemviews/qitemeditorfactory/qitemeditorfactory.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qitemeditorfactory QT += widgets testlib SOURCES += tst_qitemeditorfactory.cpp diff --git a/tests/auto/widgets/itemviews/qitemview/qitemview.pro b/tests/auto/widgets/itemviews/qitemview/qitemview.pro index 6e1697f790..079953d60d 100644 --- a/tests/auto/widgets/itemviews/qitemview/qitemview.pro +++ b/tests/auto/widgets/itemviews/qitemview/qitemview.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qitemview QT += widgets testlib SOURCES += tst_qitemview.cpp diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index d94a3c8bca..b7804da4ad 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -2084,7 +2084,7 @@ void tst_QListView::taskQTBUG_12308_wrongFlowLayout() QListWidgetItem *item = new QListWidgetItem(); item->setText(QString("Item %L1").arg(i)); lw.addItem(item); - if (!item->text().contains(QString::fromLatin1("1"))) + if (!item->text().contains(QLatin1Char('1'))) item->setHidden(true); } lw.show(); diff --git a/tests/auto/widgets/itemviews/qtableview/qtableview.pro b/tests/auto/widgets/itemviews/qtableview/qtableview.pro index 0814af77fb..e02da95ab9 100644 --- a/tests/auto/widgets/itemviews/qtableview/qtableview.pro +++ b/tests/auto/widgets/itemviews/qtableview/qtableview.pro @@ -3,6 +3,4 @@ TARGET = tst_qtableview QT += widgets widgets-private testlib QT += core-private gui-private -TARGET.EPOCHEAPSIZE = 0x200000 0x800000 SOURCES += tst_qtableview.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index e5abd6bc46..999445096c 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -415,7 +415,8 @@ public: void reset() { - QAbstractTableModel::reset(); + beginResetModel(); + endResetModel(); } int row_count; @@ -3606,7 +3607,11 @@ public: { return QVariant(); } - void res() { reset(); } + void res() + { + beginResetModel(); + endResetModel(); + } int rows; int columns; diff --git a/tests/auto/widgets/itemviews/qtablewidget/qtablewidget.pro b/tests/auto/widgets/itemviews/qtablewidget/qtablewidget.pro index d2c962b4de..114ce115eb 100644 --- a/tests/auto/widgets/itemviews/qtablewidget/qtablewidget.pro +++ b/tests/auto/widgets/itemviews/qtablewidget/qtablewidget.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtablewidget QT += widgets testlib SOURCES += tst_qtablewidget.cpp diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index 6d5f5a1c60..7c808b9655 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -4286,7 +4286,7 @@ void tst_QTreeView::testInitialFocus() { QTreeWidget treeWidget; treeWidget.setColumnCount(5); - new QTreeWidgetItem(&treeWidget, QStringList(QString("1;2;3;4;5").split(";"))); + new QTreeWidgetItem(&treeWidget, QStringList(QString("1;2;3;4;5").split(QLatin1Char(';')))); treeWidget.setTreePosition(2); treeWidget.header()->hideSection(0); // make sure we skip hidden section(s) treeWidget.header()->swapSections(1, 2); // make sure that we look for first visual index (and not first logical) diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp index 117c53a2bb..afc61025ba 100644 --- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp @@ -2007,7 +2007,7 @@ void tst_QTreeWidget::columnCount() void tst_QTreeWidget::setHeaderLabels() { - QStringList list = QString("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z").split(","); + QStringList list = QString("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z").split(QLatin1Char(',')); testWidget->setHeaderLabels(list); QCOMPARE(testWidget->header()->count(), list.count()); } diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/qtreewidgetitemiterator.pro b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/qtreewidgetitemiterator.pro index 5fa6762617..42a00618a2 100644 --- a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/qtreewidgetitemiterator.pro +++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/qtreewidgetitemiterator.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtreewidgetitemiterator QT += widgets testlib SOURCES += tst_qtreewidgetitemiterator.cpp diff --git a/tests/auto/widgets/kernel/qactiongroup/qactiongroup.pro b/tests/auto/widgets/kernel/qactiongroup/qactiongroup.pro index 82c0204aa8..87521edfe9 100644 --- a/tests/auto/widgets/kernel/qactiongroup/qactiongroup.pro +++ b/tests/auto/widgets/kernel/qactiongroup/qactiongroup.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qactiongroup QT += widgets testlib SOURCES += tst_qactiongroup.cpp diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 878136b4a0..8f8b4313e2 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -133,9 +133,11 @@ private slots: void testDeleteLater(); void testDeleteLaterProcessEvents(); +#ifndef QT_NO_LIBRARY void libraryPaths(); void libraryPaths_qt_plugin_path(); void libraryPaths_qt_plugin_path_2(); +#endif void sendPostedEvents(); @@ -500,7 +502,7 @@ static QString cstrings2QString( char **args ) while ( args[i] ) { string += args[i]; if ( args[i+1] ) - string += " "; + string += QLatin1Char(' '); ++i; } return string; @@ -909,6 +911,7 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r) return j == r.count(); } +#ifndef QT_NO_LIBRARY #define QT_TST_QAPP_DEBUG void tst_QApplication::libraryPaths() { @@ -1057,16 +1060,16 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() #ifdef Q_OS_UNIX QByteArray validPath = QDir("/tmp").canonicalPath().toLatin1(); QByteArray nonExistentPath = "/nonexistent"; - QByteArray pluginPath = validPath + ":" + nonExistentPath; + QByteArray pluginPath = validPath + ':' + nonExistentPath; #elif defined(Q_OS_WIN) # ifdef Q_OS_WINCE QByteArray validPath = "/Temp"; QByteArray nonExistentPath = "/nonexistent"; - QByteArray pluginPath = validPath + ";" + nonExistentPath; + QByteArray pluginPath = validPath + ';' + nonExistentPath; # else QByteArray validPath = "C:\\windows"; QByteArray nonExistentPath = "Z:\\nonexistent"; - QByteArray pluginPath = validPath + ";" + nonExistentPath; + QByteArray pluginPath = validPath + ';' + nonExistentPath; # endif #endif @@ -1114,6 +1117,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() qputenv("QT_PLUGIN_PATH", QByteArray()); } } +#endif class SendPostedEventsTester : public QObject { diff --git a/tests/auto/widgets/kernel/qboxlayout/qboxlayout.pro b/tests/auto/widgets/kernel/qboxlayout/qboxlayout.pro index e30a4b57b1..90e83f5285 100644 --- a/tests/auto/widgets/kernel/qboxlayout/qboxlayout.pro +++ b/tests/auto/widgets/kernel/qboxlayout/qboxlayout.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qboxlayout QT += widgets testlib SOURCES += tst_qboxlayout.cpp diff --git a/tests/auto/widgets/kernel/qdesktopwidget/qdesktopwidget.pro b/tests/auto/widgets/kernel/qdesktopwidget/qdesktopwidget.pro index 77709df5da..1ab155f22e 100644 --- a/tests/auto/widgets/kernel/qdesktopwidget/qdesktopwidget.pro +++ b/tests/auto/widgets/kernel/qdesktopwidget/qdesktopwidget.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdesktopwidget QT += widgets testlib SOURCES += tst_qdesktopwidget.cpp diff --git a/tests/auto/widgets/kernel/qformlayout/qformlayout.pro b/tests/auto/widgets/kernel/qformlayout/qformlayout.pro index 668b890c97..be944605a3 100644 --- a/tests/auto/widgets/kernel/qformlayout/qformlayout.pro +++ b/tests/auto/widgets/kernel/qformlayout/qformlayout.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qformlayout QT += widgets testlib SOURCES += tst_qformlayout.cpp diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp index e1b494c9f1..6b27b4ffb6 100644 --- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp @@ -493,8 +493,8 @@ void tst_QFormLayout::addRow() QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1); QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2); - QVERIFY(layout->itemAt(2, QFormLayout::LabelRole)->widget()->property("text") == "Foo:"); - QVERIFY(layout->itemAt(3, QFormLayout::LabelRole)->widget()->property("text") == "Bar:"); + QCOMPARE(layout->itemAt(2, QFormLayout::LabelRole)->widget()->property("text").toString(), QLatin1String("Foo:")); + QCOMPARE(layout->itemAt(3, QFormLayout::LabelRole)->widget()->property("text").toString(), QLatin1String("Bar:")); QVERIFY(layout->itemAt(4, QFormLayout::LabelRole) == 0); QVERIFY(layout->itemAt(5, QFormLayout::LabelRole) == 0); diff --git a/tests/auto/widgets/kernel/qgridlayout/qgridlayout.pro b/tests/auto/widgets/kernel/qgridlayout/qgridlayout.pro index febcee6c55..ee64f8538f 100644 --- a/tests/auto/widgets/kernel/qgridlayout/qgridlayout.pro +++ b/tests/auto/widgets/kernel/qgridlayout/qgridlayout.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qgridlayout QT += widgets widgets-private testlib diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp index 4d15ac9a93..5413b274d4 100644 --- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp +++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp @@ -195,7 +195,7 @@ void tst_QLayout::smartMaxSize() int width = sz.width(); int expectedWidth = expectedWidths[expectedIndex]; if (width != expectedWidth) { - qDebug() << "error at index" << expectedIndex << ":" << sizePolicy.horizontalPolicy() << align << minSize << sizeHint << maxSize << width; + qDebug() << "error at index" << expectedIndex << ':' << sizePolicy.horizontalPolicy() << align << minSize << sizeHint << maxSize << width; ++regressionCount; } ++expectedIndex; diff --git a/tests/auto/widgets/kernel/qstackedlayout/qstackedlayout.pro b/tests/auto/widgets/kernel/qstackedlayout/qstackedlayout.pro index cd80253e12..1f94c1b386 100644 --- a/tests/auto/widgets/kernel/qstackedlayout/qstackedlayout.pro +++ b/tests/auto/widgets/kernel/qstackedlayout/qstackedlayout.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstackedlayout QT += widgets testlib SOURCES += tst_qstackedlayout.cpp diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm index c67682fd85..293b3387ee 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm @@ -39,7 +39,7 @@ #include <qpa/qplatformnativeinterface.h> #include <private/qcore_mac_p.h> -#include <Cocoa/Cocoa.h> +#include <AppKit/AppKit.h> QString nativeWindowTitle(QWidget *window, Qt::WindowState state) { diff --git a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro index d61681d5cb..8672c363a2 100644 --- a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro +++ b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qwidget_window QT += widgets testlib core-private gui-private SOURCES += tst_qwidget_window.cpp diff --git a/tests/auto/widgets/kernel/qwidgetaction/qwidgetaction.pro b/tests/auto/widgets/kernel/qwidgetaction/qwidgetaction.pro index 0029ebd51e..e4158559a9 100644 --- a/tests/auto/widgets/kernel/qwidgetaction/qwidgetaction.pro +++ b/tests/auto/widgets/kernel/qwidgetaction/qwidgetaction.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qwidgetaction QT += widgets testlib SOURCES += tst_qwidgetaction.cpp diff --git a/tests/auto/widgets/kernel/qwidgetsvariant/qwidgetsvariant.pro b/tests/auto/widgets/kernel/qwidgetsvariant/qwidgetsvariant.pro index e3f2da96bd..7979e92087 100644 --- a/tests/auto/widgets/kernel/qwidgetsvariant/qwidgetsvariant.pro +++ b/tests/auto/widgets/kernel/qwidgetsvariant/qwidgetsvariant.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qwidgetsvariant INCLUDEPATH += $$PWD/../../../other/qvariant_common SOURCES += tst_qwidgetsvariant.cpp diff --git a/tests/auto/widgets/kernel/qwindowcontainer/qwindowcontainer.pro b/tests/auto/widgets/kernel/qwindowcontainer/qwindowcontainer.pro index 4ff05eb04a..17fc1d28b5 100644 --- a/tests/auto/widgets/kernel/qwindowcontainer/qwindowcontainer.pro +++ b/tests/auto/widgets/kernel/qwindowcontainer/qwindowcontainer.pro @@ -1,6 +1,5 @@ CONFIG += testcase mac:CONFIG -= app_bundle -# CONFIG += parallel_test // Cannot be parallel due to the activation test TARGET = tst_qwindowcontainer QT += widgets testlib SOURCES += tst_qwindowcontainer.cpp diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro index b4546aa760..4d7473f068 100644 --- a/tests/auto/widgets/styles/qstyle/qstyle.pro +++ b/tests/auto/widgets/styles/qstyle/qstyle.pro @@ -1,7 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstyle -TARGET.EPOCHEAPSIZE = 0x200000 0x800000 QT += widgets testlib SOURCES += tst_qstyle.cpp diff --git a/tests/auto/widgets/styles/qstyleoption/qstyleoption.pro b/tests/auto/widgets/styles/qstyleoption/qstyleoption.pro index 2ca24c4f43..bf12a6b30f 100644 --- a/tests/auto/widgets/styles/qstyleoption/qstyleoption.pro +++ b/tests/auto/widgets/styles/qstyleoption/qstyleoption.pro @@ -2,7 +2,6 @@ TEMPLATE = app TARGET = tst_qstyleoption CONFIG += testcase -CONFIG += parallel_test QT += widgets testlib SOURCES += tst_qstyleoption.cpp diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index a511e91e2c..b52aa30239 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -55,6 +55,7 @@ public: ~tst_QStyleSheetStyle(); private slots: + void init(); void repolish(); void numinstances(); void widgetsBeforeAppStyleSheet(); @@ -71,8 +72,12 @@ private slots: void layoutSpacing(); #endif void qproperty(); + void palettePropagation_data(); void palettePropagation(); + void fontPropagation_data(); void fontPropagation(); + void widgetStylePropagation_data(); + void widgetStylePropagation(); void onWidgetDestroyed(); void fontPrecedence(); void focusColors(); @@ -137,6 +142,12 @@ tst_QStyleSheetStyle::~tst_QStyleSheetStyle() { } +void tst_QStyleSheetStyle::init() +{ + qApp->setStyleSheet(QString()); + QCoreApplication::setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles, false); +} + void tst_QStyleSheetStyle::numinstances() { QWidget w; @@ -627,31 +638,80 @@ void tst_QStyleSheetStyle::namespaces() QCOMPARE(BACKGROUND(pb2), red); } +void tst_QStyleSheetStyle::palettePropagation_data() +{ + QTest::addColumn<QString>("applicationStyleSheet"); + QTest::addColumn<bool>("widgetStylePropagation"); + QTest::newRow("Widget style propagation") << " " << true; + QTest::newRow("Widget style propagation, no application style sheet") << QString() << true; + QTest::newRow("Default propagation") << " " << false; + QTest::newRow("Default propagation, no application style sheet") << QString() << false; +} + void tst_QStyleSheetStyle::palettePropagation() { - qApp->setStyleSheet(""); + QFETCH(QString, applicationStyleSheet); + QFETCH(bool, widgetStylePropagation); + + qApp->setStyleSheet(applicationStyleSheet); + QCoreApplication::setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles, widgetStylePropagation); + QGroupBox gb; - QPushButton *push = new QPushButton(&gb); - QPushButton &pb = *push; - push->setText("AsdF"); + QLabel *label = new QLabel(&gb); + QLabel &lb = *label; + label->setText("AsdF"); gb.setStyleSheet("QGroupBox { color: red }"); - QVERIFY(COLOR(gb) == Qt::red); - QVERIFY(COLOR(pb) == APPCOLOR(pb)); // palette shouldn't propagate - gb.setStyleSheet("QGroupBox * { color: red }"); + QCOMPARE(COLOR(gb), QColor(Qt::red)); - QVERIFY(COLOR(pb) == Qt::red); - QVERIFY(COLOR(gb) == APPCOLOR(gb)); + if (widgetStylePropagation) { + QCOMPARE(COLOR(lb), QColor(Qt::red)); // palette should propagate in standard mode + } else { + QCOMPARE(COLOR(lb), APPCOLOR(lb)); // palette shouldn't propagate + } QWidget window; + lb.setParent(&window); + if (widgetStylePropagation) { + // In standard propagation mode, widgets that are not explicitly + // targeted do not have their propagated palette unset when they are + // unpolished by changing parents. This is consistent with regular Qt + // widgets, who also maintain their propagated palette when changing + // parents + QCOMPARE(COLOR(lb), QColor(Qt::red)); + } else { + QCOMPARE(COLOR(lb), APPCOLOR(lb)); + } + lb.setParent(&gb); + + gb.setStyleSheet("QGroupBox * { color: red }"); + + QCOMPARE(COLOR(lb), QColor(Qt::red)); + QCOMPARE(COLOR(gb), APPCOLOR(gb)); + window.setStyleSheet("* { color: white; }"); - pb.setParent(&window); - QVERIFY(COLOR(pb) == Qt::white); + lb.setParent(&window); + QCOMPARE(COLOR(lb), QColor(Qt::white)); +} + +void tst_QStyleSheetStyle::fontPropagation_data() +{ + QTest::addColumn<QString>("applicationStyleSheet"); + QTest::addColumn<bool>("widgetStylePropagation"); + QTest::newRow("Widget style propagation") << " " << true; + QTest::newRow("Widget style propagation, no application style sheet") << QString() << true; + QTest::newRow("Default propagation") << " " << false; + QTest::newRow("Default propagation, no application style sheet") << QString() << false; } void tst_QStyleSheetStyle::fontPropagation() { - qApp->setStyleSheet(""); + QFETCH(QString, applicationStyleSheet); + QFETCH(bool, widgetStylePropagation); + + qApp->setStyleSheet(applicationStyleSheet); + QCoreApplication::setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles, widgetStylePropagation); + QComboBox cb; cb.addItem("item1"); cb.addItem("item2"); @@ -661,7 +721,11 @@ void tst_QStyleSheetStyle::fontPropagation() cb.setStyleSheet("QComboBox { font-size: 20pt; }"); QCOMPARE(FONTSIZE(cb), 20); - QCOMPARE(FONTSIZE(*popup), viewFontSize); + if (widgetStylePropagation) { + QCOMPARE(FONTSIZE(*popup), 20); + } else { + QCOMPARE(FONTSIZE(*popup), viewFontSize); + } QGroupBox gb; QPushButton *push = new QPushButton(&gb); QPushButton &pb = *push; @@ -670,7 +734,11 @@ void tst_QStyleSheetStyle::fontPropagation() gb.setStyleSheet("QGroupBox { font-size: 20pt }"); QCOMPARE(FONTSIZE(gb), 20); - QVERIFY(FONTSIZE(pb) == buttonFontSize); // font does not propagate + if (widgetStylePropagation) { + QCOMPARE(FONTSIZE(pb), 20); + } else { + QCOMPARE(FONTSIZE(pb), buttonFontSize); // font does not propagate + } gb.setStyleSheet("QGroupBox * { font-size: 20pt; }"); QCOMPARE(FONTSIZE(gb), gbFontSize); QCOMPARE(FONTSIZE(pb), 20); @@ -1471,12 +1539,14 @@ void tst_QStyleSheetStyle::embeddedFonts() QCOMPARE(spin.font().pixelSize(), 32); QCOMPARE(embedded->font().pixelSize(), 32); +#ifndef QT_NO_CONTEXTMENU QMenu *menu = embedded->createStandardContextMenu(); menu->show(); QTest::qWait(20); QVERIFY(menu); QVERIFY(menu->font().pixelSize() != 32); QCOMPARE(menu->font().pixelSize(), qApp->font(menu).pixelSize()); +#endif // QT_NO_CONTEXTMENU //task 242556 QComboBox box; @@ -1794,6 +1864,138 @@ void tst_QStyleSheetStyle::styleSheetChangeBeforePolish() QVERIFY(testForColors(image2, QColor(0x00, 0xFF, 0x00))); } +void tst_QStyleSheetStyle::widgetStylePropagation_data() +{ + QTest::addColumn<QString>("applicationStyleSheet"); + QTest::addColumn<QString>("parentStyleSheet"); + QTest::addColumn<QString>("childStyleSheet"); + QTest::addColumn<QFont>("parentFont"); + QTest::addColumn<QFont>("childFont"); + QTest::addColumn<QPalette>("parentPalette"); + QTest::addColumn<QPalette>("childPalette"); + QTest::addColumn<int>("parentExpectedSize"); + QTest::addColumn<int>("childExpectedSize"); + QTest::addColumn<QColor>("parentExpectedColor"); + QTest::addColumn<QColor>("childExpectedColor"); + + QFont noFont; + QFont font45; font45.setPointSize(45); + QFont font32; font32.setPointSize(32); + + QPalette noPalette; + QPalette redPalette; redPalette.setColor(QPalette::WindowText, QColor("red")); + QPalette greenPalette; greenPalette.setColor(QPalette::WindowText, QColor("green")); + + QLabel defaultLabel; + + int defaultSize = defaultLabel.font().pointSize(); + QColor defaultColor = defaultLabel.palette().color(defaultLabel.foregroundRole()); + QColor redColor("red"); + QColor greenColor("green"); + + // Check regular Qt propagation works as expected, with and without a + // non-interfering application stylesheet + QTest::newRow("defaults") + << QString() << QString() << QString() + << noFont << noFont << noPalette << noPalette + << defaultSize << defaultSize << defaultColor << defaultColor; + QTest::newRow("parent font propagation, no application style sheet") + << QString() << QString() << QString() + << font45 << noFont << noPalette << noPalette + << 45 << 45 << defaultColor << defaultColor; + QTest::newRow("parent font propagation, dummy application style sheet") + << "QGroupBox { font-size: 64pt }" << QString() << QString() + << font45 << noFont << noPalette << noPalette + << 45 << 45 << defaultColor << defaultColor; + QTest::newRow("parent color propagation, no application style sheet") + << QString() << QString() << QString() + << noFont << noFont << redPalette << noPalette + << defaultSize << defaultSize << redColor << redColor; + QTest::newRow("parent color propagation, dummy application style sheet") + << "QGroupBox { color: blue }" << QString() << QString() + << noFont << noFont << redPalette << noPalette + << defaultSize << defaultSize << redColor << redColor; + + // Parent style sheet propagates to child if child has not explicitly + // set a value + QTest::newRow("parent style sheet color propagation") + << "#parentLabel { color: red }" << QString() << QString() + << noFont << noFont << noPalette << noPalette + << defaultSize << defaultSize << redColor << redColor; + QTest::newRow("parent style sheet font propagation") + << "#parentLabel { font-size: 45pt }" << QString() << QString() + << noFont << noFont << noPalette << noPalette + << 45 << 45 << defaultColor << defaultColor; + + // Parent style sheet does not propagate to child if child has explicitly + // set a value + QTest::newRow("parent style sheet color propagation, child explicitly set") + << "#parentLabel { color: red }" << QString() << QString() + << noFont << noFont << noPalette << greenPalette + << defaultSize << defaultSize << redColor << greenColor; + QTest::newRow("parent style sheet font propagation, child explicitly set") + << "#parentLabel { font-size: 45pt }" << QString() << QString() + << noFont << font32 << noPalette << noPalette + << 45 << 32 << defaultColor << defaultColor; + + // Parent does not propagate to child when child is target of style sheet + QTest::newRow("parent style sheet font propagation, child application style sheet") + << "#childLabel { font-size: 32pt }" << QString() << QString() + << font45 << noFont << noPalette << noPalette + << 45 << 32 << defaultColor << defaultColor; + QTest::newRow("parent style sheet color propagation, child application style sheet") + << "#childLabel { color: green }" << QString() << QString() + << noFont << noFont << redPalette << noPalette + << defaultSize << defaultSize << redColor << greenColor; +} + +void tst_QStyleSheetStyle::widgetStylePropagation() +{ + QFETCH(QString, applicationStyleSheet); + QFETCH(QString, parentStyleSheet); + QFETCH(QString, childStyleSheet); + + QFETCH(QFont, parentFont); + QFETCH(QFont, childFont); + QFETCH(QPalette, parentPalette); + QFETCH(QPalette, childPalette); + + QFETCH(int, parentExpectedSize); + QFETCH(int, childExpectedSize); + QFETCH(QColor, parentExpectedColor); + QFETCH(QColor, childExpectedColor); + + QCoreApplication::setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles, true); + + qApp->setStyleSheet(applicationStyleSheet); + + QLabel parentLabel; + parentLabel.setObjectName("parentLabel"); + QLabel childLabel(&parentLabel); + childLabel.setObjectName("childLabel"); + + if (parentFont.resolve()) + parentLabel.setFont(parentFont); + if (childFont.resolve()) + childLabel.setFont(childFont); + if (parentPalette.resolve()) + parentLabel.setPalette(parentPalette); + if (childPalette.resolve()) + childLabel.setPalette(childPalette); + if (!parentStyleSheet.isEmpty()) + parentLabel.setStyleSheet(parentStyleSheet); + if (!childStyleSheet.isEmpty()) + childLabel.setStyleSheet(childStyleSheet); + + parentLabel.ensurePolished(); + childLabel.ensurePolished(); + + QCOMPARE(FONTSIZE(parentLabel), parentExpectedSize); + QCOMPARE(FONTSIZE(childLabel), childExpectedSize); + QCOMPARE(COLOR(parentLabel), parentExpectedColor); + QCOMPARE(COLOR(childLabel), childExpectedColor); +} + QTEST_MAIN(tst_QStyleSheetStyle) #include "tst_qstylesheetstyle.moc" diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp index e8ac9aa5d2..e8369ef9bd 100644 --- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp +++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp @@ -61,7 +61,7 @@ public: protected: QStringList splitPath(const QString &path) const { - return csv ? path.split(",") : QCompleter::splitPath(path); + return csv ? path.split(QLatin1Char(',')) : QCompleter::splitPath(path); } private: diff --git a/tests/auto/widgets/util/qscroller/qscroller.pro b/tests/auto/widgets/util/qscroller/qscroller.pro index 55f57f5ed1..29e8378f2b 100644 --- a/tests/auto/widgets/util/qscroller/qscroller.pro +++ b/tests/auto/widgets/util/qscroller/qscroller.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qscroller QT += widgets testlib gui-private diff --git a/tests/auto/widgets/util/qsystemtrayicon/qsystemtrayicon.pro b/tests/auto/widgets/util/qsystemtrayicon/qsystemtrayicon.pro index d409d23650..e9310fc234 100644 --- a/tests/auto/widgets/util/qsystemtrayicon/qsystemtrayicon.pro +++ b/tests/auto/widgets/util/qsystemtrayicon/qsystemtrayicon.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsystemtrayicon QT += widgets testlib SOURCES += tst_qsystemtrayicon.cpp diff --git a/tests/auto/widgets/widgets/qabstractscrollarea/qabstractscrollarea.pro b/tests/auto/widgets/widgets/qabstractscrollarea/qabstractscrollarea.pro index 911898407b..2d9aa52e3a 100644 --- a/tests/auto/widgets/widgets/qabstractscrollarea/qabstractscrollarea.pro +++ b/tests/auto/widgets/widgets/qabstractscrollarea/qabstractscrollarea.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstractscrollarea QT += widgets testlib SOURCES += tst_qabstractscrollarea.cpp diff --git a/tests/auto/widgets/widgets/qabstractslider/qabstractslider.pro b/tests/auto/widgets/widgets/qabstractslider/qabstractslider.pro index 020be08867..6453999786 100644 --- a/tests/auto/widgets/widgets/qabstractslider/qabstractslider.pro +++ b/tests/auto/widgets/widgets/qabstractslider/qabstractslider.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstractslider QT += widgets testlib SOURCES += tst_qabstractslider.cpp diff --git a/tests/auto/widgets/widgets/qabstractspinbox/qabstractspinbox.pro b/tests/auto/widgets/widgets/qabstractspinbox/qabstractspinbox.pro index 8fa1c0fcac..f9b601228e 100644 --- a/tests/auto/widgets/widgets/qabstractspinbox/qabstractspinbox.pro +++ b/tests/auto/widgets/widgets/qabstractspinbox/qabstractspinbox.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstractspinbox QT += widgets testlib SOURCES += tst_qabstractspinbox.cpp diff --git a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro index 03e8ed75ed..88b9d08557 100644 --- a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro +++ b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qcombobox QT += widgets widgets-private gui-private core-private testlib SOURCES += tst_qcombobox.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 09129f0676..86407e2acc 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -2687,7 +2687,8 @@ void tst_QComboBox::resetModel() void reset() { - QStringListModel::reset(); + QStringListModel::beginResetModel(); + QStringListModel::endResetModel(); } }; QComboBox cb; diff --git a/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro b/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro index 690edd5c9e..411185ae2a 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro +++ b/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdatetimeedit QT += widgets testlib core-private widgets-private SOURCES += tst_qdatetimeedit.cpp diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index d41398046f..d496386773 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -3436,7 +3436,7 @@ void tst_QDateTimeEdit::deleteCalendarWidget() // it should create a new widget QVERIFY(edit.calendarWidget()); - QVERIFY(edit.calendarWidget()->objectName() != "cw1"); + QVERIFY(edit.calendarWidget()->objectName() != QLatin1String("cw1")); } } diff --git a/tests/auto/widgets/widgets/qdial/qdial.pro b/tests/auto/widgets/widgets/qdial/qdial.pro index 0af9633236..9bdd61f9d5 100644 --- a/tests/auto/widgets/widgets/qdial/qdial.pro +++ b/tests/auto/widgets/widgets/qdial/qdial.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdial QT += widgets testlib SOURCES += tst_qdial.cpp diff --git a/tests/auto/widgets/widgets/qdialogbuttonbox/qdialogbuttonbox.pro b/tests/auto/widgets/widgets/qdialogbuttonbox/qdialogbuttonbox.pro index 9892c48e0c..7f2ad59581 100644 --- a/tests/auto/widgets/widgets/qdialogbuttonbox/qdialogbuttonbox.pro +++ b/tests/auto/widgets/widgets/qdialogbuttonbox/qdialogbuttonbox.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test QT += widgets testlib SOURCES += tst_qdialogbuttonbox.cpp diff --git a/tests/auto/widgets/widgets/qdockwidget/qdockwidget.pro b/tests/auto/widgets/widgets/qdockwidget/qdockwidget.pro index eca396f1a8..5c1ef52036 100644 --- a/tests/auto/widgets/widgets/qdockwidget/qdockwidget.pro +++ b/tests/auto/widgets/widgets/qdockwidget/qdockwidget.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdockwidget QT += widgets widgets-private testlib QT += core-private gui-private diff --git a/tests/auto/widgets/widgets/qfocusframe/qfocusframe.pro b/tests/auto/widgets/widgets/qfocusframe/qfocusframe.pro index 6fa0589f95..404edcd075 100644 --- a/tests/auto/widgets/widgets/qfocusframe/qfocusframe.pro +++ b/tests/auto/widgets/widgets/qfocusframe/qfocusframe.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfocusframe QT += widgets testlib SOURCES += tst_qfocusframe.cpp diff --git a/tests/auto/widgets/widgets/qfontcombobox/qfontcombobox.pro b/tests/auto/widgets/widgets/qfontcombobox/qfontcombobox.pro index b21729bb9b..418789ac0f 100644 --- a/tests/auto/widgets/widgets/qfontcombobox/qfontcombobox.pro +++ b/tests/auto/widgets/widgets/qfontcombobox/qfontcombobox.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontcombobox QT += widgets testlib SOURCES += tst_qfontcombobox.cpp diff --git a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp index 53eec99258..d7a03deb45 100644 --- a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp @@ -73,6 +73,7 @@ private slots: void childrenAreDisabled(); void propagateFocus(); void task_QTBUG_19170_ignoreMouseReleseEvent(); + void task_QTBUG_15519_propagateMouseEvents(); private: bool checked; @@ -80,6 +81,7 @@ private: qint64 clickTimeStamp; qint64 toggleTimeStamp; + static void sendMouseMoveEvent(QWidget *widget, const QPoint &localPos); }; tst_QGroupBox::tst_QGroupBox() @@ -502,5 +504,114 @@ void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleseEvent() QCOMPARE(box.isChecked(), false); } +class MouseEventTestWidget : public QWidget +{ +public: + bool mousePressed; + bool mouseReleased; + bool mouseMoved; + + void reset() + { + mousePressed = false; + mouseReleased = false; + mouseMoved = false; + } + +protected: + void mousePressEvent(QMouseEvent*) + { + mousePressed = true; + } + + void mouseReleaseEvent(QMouseEvent*) + { + mouseReleased = true; + } + + void mouseMoveEvent(QMouseEvent*) + { + mouseMoved = true; + } +}; + +void tst_QGroupBox::task_QTBUG_15519_propagateMouseEvents() +{ + MouseEventTestWidget parent; + QGroupBox box(&parent); + parent.setMouseTracking(true); + box.setMouseTracking(true); + box.resize(100, 100); + box.setTitle("This is a test for QTBUG-15519"); + box.show(); + + QStyleOptionGroupBox option; + option.initFrom(&box); + option.subControls = QStyle::SubControls(QStyle::SC_All); + QRect checkBoxRect = box.style()->subControlRect(QStyle::CC_GroupBox, &option, + QStyle::SC_GroupBoxCheckBox, &box); + + // Without a checkbox, all mouse events should propagate + + parent.reset(); + QTest::mousePress(&box, Qt::LeftButton, 0, checkBoxRect.center()); + QCOMPARE(parent.mousePressed, true); + + parent.reset(); + QTest::mousePress(&box, Qt::LeftButton, 0, box.rect().center()); + QCOMPARE(parent.mousePressed, true); + + parent.reset(); + QTest::mouseRelease(&box, Qt::LeftButton, 0, checkBoxRect.center()); + QCOMPARE(parent.mouseReleased, true); + + parent.reset(); + QTest::mouseRelease(&box, Qt::LeftButton, 0, box.rect().center()); + QCOMPARE(parent.mouseReleased, true); + + parent.reset(); + sendMouseMoveEvent(&box, checkBoxRect.center()); + QCOMPARE(parent.mouseMoved, true); + + parent.reset(); + sendMouseMoveEvent(&box, box.rect().center()); + QCOMPARE(parent.mouseMoved, true); + + // With a checkbox, presses and releases to the checkbox should not propagate + + box.setCheckable(true); + + parent.reset(); + QTest::mousePress(&box, Qt::LeftButton, 0, checkBoxRect.center()); + QCOMPARE(parent.mousePressed, false); + + parent.reset(); + QTest::mousePress(&box, Qt::LeftButton, 0, box.rect().center()); + QCOMPARE(parent.mousePressed, true); + + parent.reset(); + QTest::mouseRelease(&box, Qt::LeftButton, 0, checkBoxRect.center()); + QCOMPARE(parent.mouseReleased, false); + + parent.reset(); + QTest::mouseRelease(&box, Qt::LeftButton, 0, box.rect().center()); + QCOMPARE(parent.mouseReleased, true); + + parent.reset(); + sendMouseMoveEvent(&box, checkBoxRect.center()); + QCOMPARE(parent.mouseMoved, true); + + parent.reset(); + sendMouseMoveEvent(&box, box.rect().center()); + QCOMPARE(parent.mouseMoved, true); +} + +void tst_QGroupBox::sendMouseMoveEvent(QWidget *widget, const QPoint &localPos) +{ + // Send a MouseMove event without actually moving the pointer + QMouseEvent event(QEvent::MouseMove, localPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier); + QApplication::sendEvent(widget, &event); +} + QTEST_MAIN(tst_QGroupBox) #include "tst_qgroupbox.moc" diff --git a/tests/auto/widgets/widgets/qkeysequenceedit/qkeysequenceedit.pro b/tests/auto/widgets/widgets/qkeysequenceedit/qkeysequenceedit.pro index 097cb00d11..c660b398ce 100644 --- a/tests/auto/widgets/widgets/qkeysequenceedit/qkeysequenceedit.pro +++ b/tests/auto/widgets/widgets/qkeysequenceedit/qkeysequenceedit.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qkeysequenceedit QT += widgets testlib SOURCES += tst_qkeysequenceedit.cpp diff --git a/tests/auto/widgets/widgets/qlabel/qlabel.pro b/tests/auto/widgets/widgets/qlabel/qlabel.pro index 6c259bc5a3..6a5757fb5c 100644 --- a/tests/auto/widgets/widgets/qlabel/qlabel.pro +++ b/tests/auto/widgets/widgets/qlabel/qlabel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qlabel QT += widgets widgets-private testlib diff --git a/tests/auto/widgets/widgets/qlcdnumber/qlcdnumber.pro b/tests/auto/widgets/widgets/qlcdnumber/qlcdnumber.pro index 220380b1d5..1508806fb0 100644 --- a/tests/auto/widgets/widgets/qlcdnumber/qlcdnumber.pro +++ b/tests/auto/widgets/widgets/qlcdnumber/qlcdnumber.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qlcdnumber QT += widgets testlib SOURCES += tst_qlcdnumber.cpp diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index a41d80d7dd..396dad4fa5 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -2244,6 +2244,7 @@ void tst_QLineEdit::deleteSelectedText() edit.setText(text); edit.selectAll(); +#ifndef QT_NO_CONTEXTMENU QMenu *menu = edit.createStandardContextMenu(); for (int i = 0; i < menu->actions().count(); ++i) { QAction *current = menu->actions().at(i); @@ -2252,6 +2253,7 @@ void tst_QLineEdit::deleteSelectedText() QVERIFY(edit.text().isEmpty()); } } +#endif // QT_NO_CONTEXTMENU } diff --git a/tests/auto/widgets/widgets/qmainwindow/qmainwindow.pro b/tests/auto/widgets/widgets/qmainwindow/qmainwindow.pro index bd4fc6ba97..7e0a5320b0 100644 --- a/tests/auto/widgets/widgets/qmainwindow/qmainwindow.pro +++ b/tests/auto/widgets/widgets/qmainwindow/qmainwindow.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmainwindow QT += widgets widgets-private testlib SOURCES += tst_qmainwindow.cpp diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index a6caa3d020..acdf5b00e2 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -201,6 +201,7 @@ private slots: void task_226929(); void styleChange(); void testFullScreenState(); + void testRemoveBaseWidget(); }; void tst_QMdiSubWindow::initTestCase() @@ -2064,6 +2065,27 @@ void tst_QMdiSubWindow::testFullScreenState() QCOMPARE(subWindow->size(), QSize(300, 300)); } +void tst_QMdiSubWindow::testRemoveBaseWidget() +{ + QMdiArea mdiArea; + mdiArea.show(); + + QWidget *widget1 = new QWidget; + mdiArea.addSubWindow(widget1); + + QWidget *widget2 = new QWidget; + mdiArea.addSubWindow(widget2); + + mdiArea.removeSubWindow(widget1); + QVERIFY(!widget1->parent()); + + widget2->setParent(widget1); + mdiArea.removeSubWindow(widget2); + QCOMPARE(widget2->parent(), widget1); + + delete widget1; +} + QTEST_MAIN(tst_QMdiSubWindow) #include "tst_qmdisubwindow.moc" diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm b/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm index b1708d8669..7130e79276 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm @@ -31,7 +31,7 @@ ** ****************************************************************************/ -#import <Cocoa/Cocoa.h> +#import <AppKit/AppKit.h> #include <QMenu> #include <QTest> diff --git a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST index 725b8e93b4..86c7141268 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST +++ b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST @@ -1,2 +1,14 @@ [clearAndGrab] opensuse-13.1 + +#QTBUG-31611 +[painter] +windows msvc-2010 32bit developer-build + +#QTBUG-31611 +[reparentToAlreadyCreated] +windows msvc-2010 32bit developer-build + +#QTBUG-31611 +[reparentToNotYetCreated] +windows msvc-2010 32bit developer-build diff --git a/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro b/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro index bbc6e987af..2d4cff9e10 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro +++ b/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro @@ -1,8 +1,5 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qopenglwidget QT += gui-private core-private testlib widgets SOURCES += tst_qopenglwidget.cpp - -win32-msvc2010:contains(QT_CONFIG, angle):CONFIG += insignificant_test # QTBUG-31611 diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp index 44a554ad82..1657751605 100644 --- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp +++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp @@ -537,9 +537,6 @@ void tst_QPushButton::sizeHint_data() #if !defined(QT_NO_STYLE_WINDOWS) QTest::newRow("windows") << QString::fromLatin1("windows"); #endif -#if !defined(QT_NO_STYLE_GTK) - QTest::newRow("gtk") << QString::fromLatin1("gtk"); -#endif #if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) QTest::newRow("macintosh") << QString::fromLatin1("macintosh"); #endif diff --git a/tests/auto/widgets/widgets/qscrollarea/qscrollarea.pro b/tests/auto/widgets/widgets/qscrollarea/qscrollarea.pro index 0cd706420e..bdf18a0252 100644 --- a/tests/auto/widgets/widgets/qscrollarea/qscrollarea.pro +++ b/tests/auto/widgets/widgets/qscrollarea/qscrollarea.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qscrollarea QT += widgets testlib SOURCES += tst_qscrollarea.cpp diff --git a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro index 8c6ea6e1d4..2863dd2034 100644 --- a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro +++ b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qscrollbar QT += widgets testlib SOURCES += tst_qscrollbar.cpp diff --git a/tests/auto/widgets/widgets/qsizegrip/qsizegrip.pro b/tests/auto/widgets/widgets/qsizegrip/qsizegrip.pro index ceb897c612..1149b50feb 100644 --- a/tests/auto/widgets/widgets/qsizegrip/qsizegrip.pro +++ b/tests/auto/widgets/widgets/qsizegrip/qsizegrip.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsizegrip INCLUDEPATH += . QT += widgets testlib diff --git a/tests/auto/widgets/widgets/qslider/qslider.pro b/tests/auto/widgets/widgets/qslider/qslider.pro index d0a61e5a95..4c8b061459 100644 --- a/tests/auto/widgets/widgets/qslider/qslider.pro +++ b/tests/auto/widgets/widgets/qslider/qslider.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qslider QT += widgets testlib SOURCES += tst_qslider.cpp diff --git a/tests/auto/widgets/widgets/qsplitter/qsplitter.pro b/tests/auto/widgets/widgets/qsplitter/qsplitter.pro index c43847b11f..8ae745ea9d 100644 --- a/tests/auto/widgets/widgets/qsplitter/qsplitter.pro +++ b/tests/auto/widgets/widgets/qsplitter/qsplitter.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsplitter QT += widgets testlib SOURCES += tst_qsplitter.cpp diff --git a/tests/auto/widgets/widgets/qtabbar/qtabbar.pro b/tests/auto/widgets/widgets/qtabbar/qtabbar.pro index 8772005bef..01b3c4a404 100644 --- a/tests/auto/widgets/widgets/qtabbar/qtabbar.pro +++ b/tests/auto/widgets/widgets/qtabbar/qtabbar.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtabbar QT += widgets testlib SOURCES += tst_qtabbar.cpp diff --git a/tests/auto/widgets/widgets/qtoolbox/qtoolbox.pro b/tests/auto/widgets/widgets/qtoolbox/qtoolbox.pro index a8c62ec54a..19b3a03443 100644 --- a/tests/auto/widgets/widgets/qtoolbox/qtoolbox.pro +++ b/tests/auto/widgets/widgets/qtoolbox/qtoolbox.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtoolbox QT += widgets testlib SOURCES += tst_qtoolbox.cpp diff --git a/tests/auto/xml/sax/qxml/qxml.pro b/tests/auto/xml/sax/qxml/qxml.pro index e5fd4eafe3..e0b48ad9f5 100644 --- a/tests/auto/xml/sax/qxml/qxml.pro +++ b/tests/auto/xml/sax/qxml/qxml.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qxml SOURCES += tst_qxml.cpp |