diff options
Diffstat (limited to 'tests')
111 files changed, 520 insertions, 1577 deletions
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp index a72e689..6ab71f8 100644 --- a/tests/arthur/common/paintcommands.cpp +++ b/tests/arthur/common/paintcommands.cpp @@ -1886,7 +1886,6 @@ void PaintCommands::command_setBrushOrigin(QRegExp re) /***************************************************************************************************/ void PaintCommands::command_brushTranslate(QRegExp re) { -#if QT_VERSION > 0x040200 QStringList caps = re.capturedTexts(); double dx = convertToDouble(caps.at(1)); double dy = convertToDouble(caps.at(2)); @@ -1899,13 +1898,11 @@ void PaintCommands::command_brushTranslate(QRegExp re) brush_matrix.translate(dx, dy); new_brush.setTransform(brush_matrix); m_painter->setBrush(new_brush); -#endif } /***************************************************************************************************/ void PaintCommands::command_brushScale(QRegExp re) { -#if QT_VERSION > 0x040200 QStringList caps = re.capturedTexts(); double sx = convertToDouble(caps.at(1)); double sy = convertToDouble(caps.at(2)); @@ -1918,13 +1915,11 @@ void PaintCommands::command_brushScale(QRegExp re) brush_matrix.scale(sx, sy); new_brush.setTransform(brush_matrix); m_painter->setBrush(new_brush); -#endif } /***************************************************************************************************/ void PaintCommands::command_brushRotate(QRegExp re) { -#if QT_VERSION > 0x040200 QStringList caps = re.capturedTexts(); double rot = convertToDouble(caps.at(1)); @@ -1936,13 +1931,11 @@ void PaintCommands::command_brushRotate(QRegExp re) brush_matrix.rotate(rot); new_brush.setTransform(brush_matrix); m_painter->setBrush(new_brush); -#endif } /***************************************************************************************************/ void PaintCommands::command_brushShear(QRegExp re) { -#if QT_VERSION > 0x040200 QStringList caps = re.capturedTexts(); double sx = convertToDouble(caps.at(1)); double sy = convertToDouble(caps.at(2)); @@ -1955,7 +1948,6 @@ void PaintCommands::command_brushShear(QRegExp re) brush_matrix.shear(sx, sy); new_brush.setTransform(brush_matrix); m_painter->setBrush(new_brush); -#endif } /***************************************************************************************************/ @@ -2326,10 +2318,8 @@ void PaintCommands::command_gradient_setLinear(QRegExp re) lg.setSpread(m_gradientSpread); lg.setCoordinateMode(m_gradientCoordinate); QBrush brush(lg); -#if QT_VERSION > 0x040200 QTransform brush_matrix = m_painter->brush().transform(); brush.setTransform(brush_matrix); -#endif m_painter->setBrush(brush); } @@ -2375,10 +2365,8 @@ void PaintCommands::command_gradient_setRadial(QRegExp re) rg.setSpread(m_gradientSpread); rg.setCoordinateMode(m_gradientCoordinate); QBrush brush(rg); -#if QT_VERSION > 0x040200 QTransform brush_matrix = m_painter->brush().transform(); brush.setTransform(brush_matrix); -#endif m_painter->setBrush(brush); } @@ -2400,10 +2388,8 @@ void PaintCommands::command_gradient_setConical(QRegExp re) cg.setSpread(m_gradientSpread); cg.setCoordinateMode(m_gradientCoordinate); QBrush brush(cg); -#if QT_VERSION > 0x040200 QTransform brush_matrix = m_painter->brush().transform(); brush.setTransform(brush_matrix); -#endif m_painter->setBrush(brush); } @@ -2448,7 +2434,6 @@ void PaintCommands::command_surface_begin(QRegExp re) m_surface_painter = m_painter; -#if QT_VERSION > 0x040200 if (m_type == OpenGLType || m_type == OpenGLPBufferType) { #ifndef QT_NO_OPENGL m_surface_pbuffer = new QGLPixelBuffer(qRound(w), qRound(h)); @@ -2461,9 +2446,7 @@ void PaintCommands::command_surface_begin(QRegExp re) m_surface_pixmap.fill(Qt::transparent); m_painter = new QPainter(&m_surface_pixmap); #endif - } else -#endif - { + } else { m_surface_image = QImage(qRound(w), qRound(h), QImage::Format_ARGB32_Premultiplied); m_surface_image.fill(0); m_painter = new QPainter(&m_surface_image); diff --git a/tests/arthur/common/qengines.cpp b/tests/arthur/common/qengines.cpp index 46f4e6b..9cd2389 100644 --- a/tests/arthur/common/qengines.cpp +++ b/tests/arthur/common/qengines.cpp @@ -243,11 +243,7 @@ void GLEngine::prepare(const QSize &_size, const QColor &color) size = _size; fillColor = color; if (usePixelBuffers) { -#if (QT_VERSION < 0x040200) && defined(Q_WS_MAC) - pbuffer = new QGLPixelBuffer(QSize(512, 512), QGLFormat(QGL::SampleBuffers)); -#else pbuffer = new QGLPixelBuffer(size, QGLFormat(QGL::SampleBuffers)); -#endif } else { widget = new QGLWidget(QGLFormat(QGL::SampleBuffers)); widget->setAutoFillBackground(false); diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp index e0f42f0..181c275 100644 --- a/tests/auto/bic/tst_bic.cpp +++ b/tests/auto/bic/tst_bic.cpp @@ -195,29 +195,10 @@ void tst_Bic::sizesAndVTables_data() && archFileName420.isEmpty()) QSKIP("No reference files found for this platform", SkipAll); -#if QT_VERSION >= 0x040100 bool isPatchRelease400 = false; -#else - bool isPatchRelease400 = true; -#endif - -#if QT_VERSION >= 0x040200 bool isPatchRelease410 = false; -#else - bool isPatchRelease410 = true; -#endif - -#if QT_VERSION >= 0x040300 bool isPatchRelease420 = false; -#else - bool isPatchRelease420 = true; -#endif - -#if QT_VERSION >= 0x040400 bool isPatchRelease430 = false; -#else - bool isPatchRelease430 = true; -#endif QTest::addColumn<QString>("oldLib"); QTest::addColumn<bool>("isPatchRelease"); diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index 6d3d1df..c05d8da 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -161,9 +161,7 @@ private slots: void q_init(); void pointersize(); void containerInstantiation(); -#if QT_VERSION >= 0x040101 void qtimerList(); -#endif void containerTypedefs(); void forwardDeclared(); }; @@ -1907,11 +1905,9 @@ void tst_Collections::map() i.toFront(); while(i.hasNext()) { sum += i.next().value(); -#if QT_VERSION >= 0x040100 i.setValue(10); i.value() += 22; QVERIFY(i.value() == 32); -#endif } QVERIFY(sum == 11); } @@ -2870,10 +2866,8 @@ void tst_Collections::javaStyleIterators() while (i.hasPrevious()) { i.previous(); QVERIFY(i.value().isEmpty()); -#if QT_VERSION >= 0x040100 i.value() = "x"; QCOMPARE(i.value(), QString("x")); -#endif } } @@ -3355,7 +3349,6 @@ void tst_Collections::containerInstantiation() instantiateRandomAccess<Stack, EqualsComparable>(); } -#if QT_VERSION >= 0x040101 void tst_Collections::qtimerList() { QList<double> foo; @@ -3378,7 +3371,6 @@ void tst_Collections::qtimerList() } QFAIL("QList preallocates too much memory"); } -#endif template <typename Container> void testContainerTypedefs(Container container) @@ -3387,11 +3379,11 @@ void testContainerTypedefs(Container container) { typedef typename Container::value_type Foo; } { typedef typename Container::iterator Foo; } { typedef typename Container::const_iterator Foo; } - { typedef typename Container::reference Foo; } - { typedef typename Container::const_reference Foo; } - { typedef typename Container::pointer Foo; } - { typedef typename Container::difference_type Foo; } - { typedef typename Container::size_type Foo; } + { typedef typename Container::reference Foo; } + { typedef typename Container::const_reference Foo; } + { typedef typename Container::pointer Foo; } + { typedef typename Container::difference_type Foo; } + { typedef typename Container::size_type Foo; } } template <typename Container> @@ -3403,11 +3395,11 @@ void testPairAssociativeContainerTypedefs(Container container) // { typedef typename Container::value_type Foo; } // { typedef typename Container::const_iterator Foo; } // { typedef typename Container::reference Foo; } -// { typedef typename Container::const_reference Foo; } -// { typedef typename Container::pointer Foo; } +// { typedef typename Container::const_reference Foo; } +// { typedef typename Container::pointer Foo; } - { typedef typename Container::difference_type Foo; } - { typedef typename Container::size_type Foo; } + { typedef typename Container::difference_type Foo; } + { typedef typename Container::size_type Foo; } { typedef typename Container::iterator Foo; } { typedef typename Container::key_type Foo; } { typedef typename Container::mapped_type Foo; } @@ -3422,11 +3414,11 @@ void testSetContainerTypedefs(Container container) Q_UNUSED(container) { typedef typename Container::iterator Foo; } { typedef typename Container::const_iterator Foo; } - { typedef typename Container::reference Foo; } - { typedef typename Container::const_reference Foo; } - { typedef typename Container::pointer Foo; } - { typedef typename Container::difference_type Foo; } - { typedef typename Container::size_type Foo; } + { typedef typename Container::reference Foo; } + { typedef typename Container::const_reference Foo; } + { typedef typename Container::pointer Foo; } + { typedef typename Container::difference_type Foo; } + { typedef typename Container::size_type Foo; } { typedef typename Container::key_type Foo; } } @@ -3450,7 +3442,7 @@ void tst_Collections::containerTypedefs() } #if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) -class Key1 +class Key1 {}; class T1 {}; diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index 232af55..1f5f479 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -173,9 +173,7 @@ void tst_CompilerWarnings::warnings() << "-Wno-long-long" << "-Wshadow" << "-Wpacked" << "-Wunreachable-code" << "-Wundef" << "-Wchar-subscripts" << "-Wformat-nonliteral" << "-Wformat-security" << "-Wcast-align" -#if QT_VERSION >= 0x040100 << "-Wfloat-equal" -#endif << "-o" << tmpFile << tmpSourceFile; #elif defined(Q_CC_XLC) diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp index e0275de..1b113b2 100644 --- a/tests/auto/mediaobject/tst_mediaobject.cpp +++ b/tests/auto/mediaobject/tst_mediaobject.cpp @@ -349,6 +349,18 @@ void tst_MediaObject::_pausePlayback() void tst_MediaObject::initTestCase() { QCoreApplication::setApplicationName("tst_MediaObject"); + m_stateChangedSignalSpy = 0; + m_media = 0; + +#ifdef Q_OS_WINCE + QString pluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath); +#ifdef DEBUG + QVERIFY(QFile::exists(pluginsPath + "/phonon_backend/phonon_waveoutd4.dll") || QFile::exists(pluginsPath + "/phonon_backend/phonon_phonon_ds9d4.dll")); +#else + QVERIFY(QFile::exists(pluginsPath + "/phonon_backend/phonon_waveout4.dll") || QFile::exists(pluginsPath + "/phonon_backend/phonon_phonon_ds94.dll")); +#endif +#endif + m_url = qgetenv("PHONON_TESTURL"); m_media = new MediaObject(this); @@ -856,8 +868,10 @@ void tst_MediaObject::testPlayBeforeFinish() void tst_MediaObject::cleanupTestCase() { - delete m_stateChangedSignalSpy; - delete m_media; + if (m_stateChangedSignalSpy) + delete m_stateChangedSignalSpy; + if (m_media) + delete m_media; #ifdef Q_OS_WINCE QTest::qWait(200); #endif diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index 4e4f6e7..afb31f6 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -151,7 +151,6 @@ public slots: Q_DECLARE_METATYPE(MyStruct) Q_DECLARE_METATYPE(MyStruct*) -#if QT_VERSION >= 0x040200 namespace myNS { struct Points { @@ -161,7 +160,6 @@ namespace myNS { } Q_DECLARE_METATYPE(myNS::Points) -#endif class TestClassinfoWithEscapes: public QObject { @@ -195,10 +193,7 @@ class TestClass : public MyNamespace::TestSuperClass, public DONT_CONFUSE_MOC(My public DONT_CONFUSE_MOC_EVEN_MORE(MyStruct2, dummy, ignored) { Q_OBJECT -#if QT_VERSION >= 0x040101 Q_CLASSINFO("help", QT_TR_NOOP("Opening this will let you configure something")) -#endif -#if QT_VERSION >= 0x040102 Q_PROPERTY(short int shortIntProperty READ shortIntProperty) Q_PROPERTY(unsigned short int unsignedShortIntProperty READ unsignedShortIntProperty) Q_PROPERTY(signed short int signedShortIntProperty READ signedShortIntProperty) @@ -206,10 +201,7 @@ class TestClass : public MyNamespace::TestSuperClass, public DONT_CONFUSE_MOC(My Q_PROPERTY(unsigned long int unsignedLongIntProperty READ unsignedLongIntProperty) Q_PROPERTY(signed long int signedLongIntProperty READ signedLongIntProperty) Q_PROPERTY(long double longDoubleProperty READ longDoubleProperty) -#endif -#if QT_VERSION >= 0x040200 Q_PROPERTY(myNS::Points points READ points WRITE setPoints) -#endif Q_CLASSINFO("Multi" "line", @@ -294,9 +286,7 @@ private slots: #ifndef NOLONGLONG void slotWithULongLong(unsigned long long) {} -#if QT_VERSION >= 0x040101 void slotWithULongLongP(unsigned long long*) {} -#endif void slotWithULong(unsigned long) {} void slotWithLongLong(long long) {} void slotWithLong(long) {} @@ -304,9 +294,7 @@ private slots: void slotWithColonColonType(::Int::Type) {} -#if QT_VERSION >= 0x040101 TestClass &slotWithReferenceReturnType() { return *this; } -#endif #if (0 && 1) || 1 void expressionEvaluationShortcut1() {} @@ -321,7 +309,6 @@ public slots: void slotWithNamedArray(const double namedArray[3]) {} void slotWithMultiArray(const double[3][4]) {} -#if QT_VERSION >= 0x040102 short int shortIntProperty() { return 0; } unsigned short int unsignedShortIntProperty() { return 0; } signed short int signedShortIntProperty() { return 0; } @@ -329,12 +316,9 @@ public slots: unsigned long int unsignedLongIntProperty() { return 0; } signed long int signedLongIntProperty() { return 0; } long double longDoubleProperty() { return 0.0; } -#endif -#if QT_VERSION >= 0x040200 myNS::Points points() { return m_points; } void setPoints(myNS::Points points) { m_points = points; } -#endif signals: void signalWithArray(const double[3]); @@ -384,10 +368,8 @@ public: public slots: void slotWithVoidStar(void *) {} -#if QT_VERSION >= 0x040200 private: myNS::Points m_points; -#endif private slots: inline virtual void blub1() {} @@ -628,10 +610,8 @@ void tst_Moc::uLongLong() QVERIFY(idx != -1); idx = mobj->indexOfSlot("slotWithULongLong(unsigned long long)"); QVERIFY(idx != -1); -#if QT_VERSION >= 0x040101 idx = mobj->indexOfSlot("slotWithULongLongP(unsigned long long*)"); QVERIFY(idx != -1); -#endif idx = mobj->indexOfSlot("slotWithLong(long)"); QVERIFY(idx != -1); @@ -707,22 +687,14 @@ void tst_Moc::supportConstSignals() void tst_Moc::task87883() { -#if QT_VERSION >= 0x040101 QVERIFY(Task87883::staticMetaObject.className()); -#else - QSKIP("Fixed in >= 4.1.1", SkipAll); -#endif } #include "c-comments.h" void tst_Moc::multilineComments() { -#if QT_VERSION >= 0x040101 QVERIFY(IfdefedClass::staticMetaObject.className()); -#else - QSKIP("Fixed in >= 4.1.1", SkipAll); -#endif } void tst_Moc::classinfoWithEscapes() diff --git a/tests/auto/q3accel/tst_q3accel.cpp b/tests/auto/q3accel/tst_q3accel.cpp index c2ba9dd..7b1c8ae 100644 --- a/tests/auto/q3accel/tst_q3accel.cpp +++ b/tests/auto/q3accel/tst_q3accel.cpp @@ -142,10 +142,8 @@ void tst_Q3Accel::initTestCase() edit->setObjectName("test_edit"); connect( accel1, SIGNAL(activated(int)), this, SLOT(accelTrig1()) ); connect( accel2, SIGNAL(activated(int)), this, SLOT(accelTrig2()) ); -#if QT_VERSION >= 0x30100 connect( accel1, SIGNAL(activatedAmbiguously(int)), this, SLOT(ambig1()) ); connect( accel2, SIGNAL(activatedAmbiguously(int)), this, SLOT(ambig2()) ); -#endif mainW->setCentralWidget( edit ); connect( mainW->statusBar(), SIGNAL(messageChanged(const QString&)), this, SLOT(statusMessage(const QString&)) ); @@ -160,11 +158,9 @@ int tst_Q3Accel::toButtons( int key ) result |= Qt::ShiftModifier; if ( key & Qt::CTRL ) result |= Qt::ControlModifier; -#if QT_VERSION >= 0x30100 - if ( key & Qt::META ) + if ( key & Qt::META ) result |= Qt::MetaModifier; -#endif - if ( key & Qt::ALT ) + if ( key & Qt::ALT ) result |= Qt::AltModifier; return result; } @@ -185,7 +181,6 @@ void tst_Q3Accel::defElements() QTest::addColumn<int>("theResult"); } -#if QT_VERSION >= 0x30100 void tst_Q3Accel::number() { testElement(); @@ -369,34 +364,17 @@ void tst_Q3Accel::number_data() int(Qt::Key_Aring) UNICODE_ACCEL + int(Qt::Key_K) */ - /* The #ifdefs for Qt4 are there, because accelerators are always case insensitive in Qt4. - It was not wise to differentiate between ASCII (where accelerators where case insensitive) and all other - unicode chars in 3.x. - */ QTest::newRow( "N06 - sA1" ) << int(SetupAccel) << int(Accel1) << QString("") << int(Qt::Key_aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(NoResult); -#if QT_VERSION < 0x040000 - QTest::newRow( "N07 - sA2" ) << int(SetupAccel) << int(Accel2) << QString("") - << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(NoResult); -#endif QTest::newRow( "N08 - sA2" ) << int(SetupAccel) << int(Accel1) << QString("") << int(Qt::UNICODE_ACCEL) + int(Qt::Key_K) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(NoResult); QTest::newRow( "N:int(Qt::Key_aring)" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::Key_aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); -#if QT_VERSION < 0x040000 - QTest::newRow( "N:int(Qt::Key_Aring)" ) << int(TestAccel) << int(NoWidget) << QString("") - << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel2Triggered); -#endif QTest::newRow( "N:int(Qt::Key_aring) - Text Form" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::Key_unknown) << 0xE5 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); -#if QT_VERSION < 0x040000 - QTest::newRow( "N:int(Qt::Key_Aring) - Text Form" ) << int(TestAccel) << int(NoWidget) << QString("") - << int(Qt::Key_unknown) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel2Triggered); -#else QTest::newRow( "N:int(Qt::Key_Aring) - Text Form" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::Key_unknown) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); -#endif QTest::newRow( "N:UNICODE_ACCEL + int(Qt::Key_K)" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::UNICODE_ACCEL) + int(Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); @@ -615,28 +593,15 @@ void tst_Q3Accel::text_data() /* see comments above on the #ifdef'ery */ QTest::newRow( "T06 - sA1" ) << int(SetupAccel) << int(Accel1) << QString("\x0E5") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(NoResult); -#if QT_VERSION < 0x040000 - QTest::newRow( "T07 - sA2" ) << int(SetupAccel) << int(Accel2) << QString("\x0C5") - << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(NoResult); -#endif QTest::newRow( "T08 - sA2" ) << int(SetupAccel) << int(Accel1) << QString("K") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(NoResult); QTest::newRow( "T:int(Qt::Key_aring)" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::Key_aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); -#if QT_VERSION < 0x040000 - QTest::newRow( "T:int(Qt::Key_Aring)" ) << int(TestAccel) << int(NoWidget) << QString("") - << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel2Triggered); -#endif QTest::newRow( "T:int(Qt::Key_aring) - Text Form" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::Key_unknown) << 0xE5 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); -#if QT_VERSION < 0x040000 - QTest::newRow( "T:int(Qt::Key_Aring) - Text Form" ) << int(TestAccel) << int(NoWidget) << QString("") - << int(Qt::Key_unknown) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel2Triggered); -#else QTest::newRow( "T:int(Qt::Key_Aring) - Text Form" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::Key_unknown) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); -#endif QTest::newRow( "T:UNICODE_ACCEL + int(Qt::Key_K)" ) << int(TestAccel) << int(NoWidget) << QString("") << int(Qt::UNICODE_ACCEL) + int(Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << int(Accel1Triggered); @@ -986,11 +951,7 @@ void tst_Q3Accel::sendKeyEvents( int k1, QChar c1, int k2, QChar c2, int k3, QCh k2 &= ~Qt::MODIFIER_MASK; k3 &= ~Qt::MODIFIER_MASK; k4 &= ~Qt::MODIFIER_MASK; -#if QT_VERSION < 0x040000 - QKeyEvent ke( QEvent::Accel, k1, k1, b1, QString(c1) ); -#else QKeyEvent ke( QEvent::Accel, k1, (Qt::KeyboardModifiers)b1, QString(c1) ); -#endif QApplication::sendEvent( mainW, &ke ); if ( k2 ) { QKeyEvent ke( QEvent::Accel, k2, k2, b2, QString(c2) ); @@ -1006,48 +967,5 @@ void tst_Q3Accel::sendKeyEvents( int k1, QChar c1, int k2, QChar c2, int k3, QCh } } -// ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- - -#else // For Qt < 3.1 -void tst_Q3Accel::number_data() -{ - QTest::addColumn<int>("bogus"); - QTest::newRow( "b01" ) << 0; -} - -void tst_Q3Accel::number() -{ - QSKIP( "Accel test for Qt < 3.1 not implemented", SkipAll); -} - -void tst_Q3Accel::text_data() -{ - QTest::addColumn<int>("bogus"); - QTest::newRow( "b02" ) << 0; -} - -void tst_Q3Accel::text() -{ - QSKIP( "Accel test for Qt < 3.1 not implemented", SkipAll); -} -void tst_Q3Accel::disabledItems() -{ - QSKIP( "Accel test for Qt < 3.1 not implemented", SkipAll); -} -void tst_Q3Accel::ambiguousItems() -{ - QSKIP( "Amibguous signals non-existant in Qt < 3.1", SkipAll); -} -void tst_Q3Accel::unicodeCompare() -{ - QSKIP( "Accel test for Qt < 3.1 not implemented", SkipAll); -} -void tst_Q3Accel::unicodeCompose() -{ - QSKIP( "Unicode composing non-existant in Qt < 3.1", SkipAll); -} -#endif // QT_VERSION >= 0x30100 - QTEST_MAIN(tst_Q3Accel) #include "tst_q3accel.moc" diff --git a/tests/auto/q3cstring/tst_q3cstring.cpp b/tests/auto/q3cstring/tst_q3cstring.cpp index f9bdf6b..60a66a9 100644 --- a/tests/auto/q3cstring/tst_q3cstring.cpp +++ b/tests/auto/q3cstring/tst_q3cstring.cpp @@ -69,8 +69,6 @@ private slots: void replace_uint_uint(); void replace_string_data(); void replace_string(); - void replace_regexp_data(); - void replace_regexp(); void remove_uint_uint_data(); void remove_uint_uint(); void prepend(); @@ -132,11 +130,6 @@ void tst_Q3CString::remove_string_data() replace_string_data(); } -void tst_Q3CString::remove_regexp_data() -{ - replace_regexp_data(); -} - void tst_Q3CString::length_data() { QTest::addColumn<Q3CString>("s1"); @@ -202,9 +195,6 @@ void tst_Q3CString::replace_string_data() QTest::newRow( "rem13" ) << Q3CString("") << Q3CString("A") << Q3CString(0) << Q3CString(""); QTest::newRow( "rem14" ) << Q3CString(0) << Q3CString("A") << Q3CString("") << Q3CString(0); QTest::newRow( "rem15" ) << Q3CString(0) << Q3CString("A") << Q3CString(0) << Q3CString(0); -#if QT_VERSION < 0x040000 - QTest::newRow( "rem16" ) << Q3CString(0) << Q3CString("") << Q3CString("A") << Q3CString(0); -#endif QTest::newRow( "rem17" ) << Q3CString(0) << Q3CString("") << Q3CString("") << Q3CString(0); // ### how should the one below behave in Q3CString???? // QTest::newRow( "rem18" ) << Q3CString("") << Q3CString(0) << Q3CString("A") << Q3CString("A"); @@ -216,7 +206,7 @@ void tst_Q3CString::replace_string_data() QTest::newRow( "rep03" ) << Q3CString("") << Q3CString("") << Q3CString("X") << Q3CString("X"); } -void tst_Q3CString::replace_regexp_data() +void tst_Q3CString::remove_regexp_data() { QTest::addColumn<Q3CString>("string"); QTest::addColumn<Q3CString>("regexp"); @@ -224,20 +214,16 @@ void tst_Q3CString::replace_regexp_data() QTest::addColumn<Q3CString>("result"); QTest::newRow( "rem00" ) << Q3CString("alpha") << Q3CString("a+") << Q3CString("") << Q3CString("lph"); -#if QT_VERSION >= 0x030100 QTest::newRow( "rem01" ) << Q3CString("banana") << Q3CString("^.a") << Q3CString("") << Q3CString("nana"); -#endif QTest::newRow( "rem02" ) << Q3CString("") << Q3CString("^.a") << Q3CString("") << Q3CString(""); QTest::newRow( "rem03" ) << Q3CString("") << Q3CString("^.a") << Q3CString(0) << Q3CString(""); QTest::newRow( "rem04" ) << Q3CString(0) << Q3CString("^.a") << Q3CString("") << Q3CString(0); QTest::newRow( "rem05" ) << Q3CString(0) << Q3CString("^.a") << Q3CString(0) << Q3CString(0); -#if QT_VERSION >= 0x030100 QTest::newRow( "rep00" ) << Q3CString("A <i>bon mot</i>.") << Q3CString("<i>([^<]*)</i>") << Q3CString("\\emph{\\1}") << Q3CString("A \\emph{bon mot}."); QTest::newRow( "rep01" ) << Q3CString("banana") << Q3CString("^.a()") << Q3CString("\\1") << Q3CString("nana"); QTest::newRow( "rep02" ) << Q3CString("banana") << Q3CString("(ba)") << Q3CString("\\1X\\1") << Q3CString("baXbanana"); QTest::newRow( "rep03" ) << Q3CString("banana") << Q3CString("(ba)(na)na") << Q3CString("\\2X\\1") << Q3CString("naXba"); -#endif } void tst_Q3CString::length() @@ -364,11 +350,7 @@ void tst_Q3CString::acc_01() QCOMPARE('X'+a,(Q3CString)"XABC"); a = (const char*)0; QVERIFY(a.isNull()); -#if QT_VERSION < 0x040000 - QVERIFY((const char*)a==0); -#else QVERIFY(*((const char *)a) == 0); -#endif { QFile f("COMPARE.txt"); @@ -420,11 +402,7 @@ void tst_Q3CString::constructor() QCOMPARE(a,ca); QVERIFY(a.isNull()); -#if QT_VERSION < 0x040000 - QVERIFY(a != (Q3CString)""); -#else QVERIFY(a == Q3CString("")); -#endif QCOMPARE(b,cb); QCOMPARE(c,cc); QCOMPARE(d,(Q3CString)"String D"); @@ -509,18 +487,6 @@ void tst_Q3CString::find() //QCOMPARE(a.find('G',-1),14); // -ve does what? Parameter should be uint? //QCOMPARE(a.find('G',-2),11); // -ve does what? Parameter should be uint? QCOMPARE(a.find('f'),10); -#if QT_VERSION < 0x040000 - // case sensitive find has been removed in 4.0 - QCOMPARE(a.find('f',0,FALSE),5); - QCOMPARE(a.find('g',0,TRUE),-1); - QCOMPARE(a.find("fgh",0,FALSE),5); - QCOMPARE(a.find("fgh",0,TRUE),-1); - QCOMPARE(a.find("EFG",5,TRUE),12); - QCOMPARE(a.find("EFG",5,FALSE),9); - QCOMPARE(a.find("EFG",4,TRUE),4); - QCOMPARE(a.find("EfG",4,FALSE),4); - QCOMPARE(a.find("EfG",4,TRUE),9); -#endif // QCOMPARE(a.find("efg",-1,FALSE),12); // -ve does what? Parameter should be uint? // QCOMPARE(a.find("efg",-2,FALSE),12); // -ve does what? Parameter should be uint? // QCOMPARE(a.find("efg",-3,FALSE),12); // -ve does what? Parameter should be uint? @@ -544,14 +510,6 @@ void tst_Q3CString::findRev() QCOMPARE(a.findRev('B'),1); QCOMPARE(a.findRev('B',1),1); QCOMPARE(a.findRev('B',0),-1); -#if QT_VERSION < 0x040000 - QCOMPARE(a.findRev("efg",99,FALSE),-1); -// QCOMPARE(a.findRev("efg",15,FALSE),-1); - QCOMPARE(a.findRev("efg",16,FALSE),-1); - QCOMPARE(a.findRev("efg",14,FALSE),12); - QCOMPARE(a.findRev("efg",12,FALSE),12); - QCOMPARE(a.findRev("efg",11,FALSE),9); -#endif // QCOMPARE(a.findRev(QRegExp("[EFG][EFG]"),14),13); // QCOMPARE(a.findRev(QRegExp("[EFG][EFG]"),11),11); } @@ -560,15 +518,6 @@ void tst_Q3CString::contains() { Q3CString a; a="ABCDEFGHIEfGEFG"; // 15 chars -#if QT_VERSION < 0x040000 - QCOMPARE(a.contains('A'),1); - QCOMPARE(a.contains('Z'),0); - QCOMPARE(a.contains('E'),3); - QCOMPARE(a.contains('F'),2); - QCOMPARE(a.contains('F',FALSE),3); - QCOMPARE(a.contains("FG"),2); - QCOMPARE(a.contains("FG",FALSE),3); -#else QVERIFY(a.contains('A')); QVERIFY(!a.contains('Z')); QVERIFY(a.contains('E')); @@ -579,7 +528,6 @@ void tst_Q3CString::contains() QCOMPARE(a.count('E'),3); QCOMPARE(a.count('F'),2); QCOMPARE(a.count("FG"),2); -#endif // QCOMPARE(a.contains(QRegExp("[FG][HI]")),1); // QCOMPARE(a.contains(QRegExp("[G][HE]")),2); } @@ -771,7 +719,6 @@ void tst_Q3CString::replace_uint_uint() void tst_Q3CString::replace_string() { -#if QT_VERSION >= 0x030100 QFETCH( Q3CString, string ); QFETCH( Q3CString, before ); QFETCH( Q3CString, after ); @@ -788,37 +735,6 @@ void tst_Q3CString::replace_string() Q3CString s3 = string; s3.replace( before, after ); QCOMPARE( s3, result ); - -#if QT_VERSION < 0x040000 - if ( !string.isNull() ) { - /* - I've changed the isNull() behavior in QString::replace() in - Qt 3.2, according to the philosophy that null and empty - should behave mostly the same. - */ - Q3CString s4 = string; - s4.replace( QRegExp(QRegExp::escape(before)), after ); - QVERIFY( s4 == result ); - } -#endif -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -#endif -} - -void tst_Q3CString::replace_regexp() -{ -#if QT_VERSION >= 0x040000 - QSKIP("This functionality has been removed in Qt 4.", SkipAll); -#else - QFETCH( Q3CString, string ); - QFETCH( Q3CString, regexp ); - QFETCH( Q3CString, after ); - QFETCH( Q3CString, result ); - - string.replace( QRegExp(regexp), after ); - QVERIFY( string == result ); -#endif } void tst_Q3CString::remove_uint_uint() diff --git a/tests/auto/q3header/tst_q3header.cpp b/tests/auto/q3header/tst_q3header.cpp index f0ad9d4..fe290e8 100644 --- a/tests/auto/q3header/tst_q3header.cpp +++ b/tests/auto/q3header/tst_q3header.cpp @@ -59,9 +59,7 @@ public slots: void cleanupTestCase(); private slots: void bug_setOffset(); -#if QT_VERSION >= 0x040101 void nullStringLabel(); -#endif private: Q3Header *testW; @@ -108,7 +106,6 @@ void tst_Q3Header::bug_setOffset() QCOMPARE( testW->offset(), offs ); } -#if QT_VERSION >= 0x040101 // Task 95640 void tst_Q3Header::nullStringLabel() { @@ -123,7 +120,6 @@ void tst_Q3Header::nullStringLabel() QCOMPARE(testW->label(testW->addLabel(QString())), QString()); QCOMPARE(testW->label(testW->addLabel(QString(""))), QString("")); } -#endif QTEST_MAIN(tst_Q3Header) #include "tst_q3header.moc" diff --git a/tests/auto/q3ptrlist/tst_q3ptrlist.cpp b/tests/auto/q3ptrlist/tst_q3ptrlist.cpp index 49b5a3e..c3d8b16 100644 --- a/tests/auto/q3ptrlist/tst_q3ptrlist.cpp +++ b/tests/auto/q3ptrlist/tst_q3ptrlist.cpp @@ -92,7 +92,6 @@ void tst_Q3PtrList::cleanup() void tst_Q3PtrList::replace() { -#if QT_VERSION >= 0x030100 Q3PtrList<int> list; int foo = 4; list.setAutoDelete( TRUE ); @@ -110,15 +109,10 @@ void tst_Q3PtrList::replace() int *p = new int(7); QCOMPARE( list.insert(2, p), (bool)TRUE ); QCOMPARE( list.replace(2, p), (bool)TRUE ); - -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -#endif } void tst_Q3PtrList::replaceStrDeep() { -#if QT_VERSION >= 0x030100 Q3StrList list; const char *str; @@ -137,14 +131,10 @@ void tst_Q3PtrList::replaceStrDeep() QCOMPARE( list.insert(2, str), (bool)TRUE ); QCOMPARE( list.replace(2, str), (bool)TRUE ); -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -#endif } void tst_Q3PtrList::replaceStrShallow() { -#if QT_VERSION >= 0x030100 Q3StrList list( FALSE ); char str1[] = "This is string 1"; char str2[] = "This is string 2"; @@ -166,9 +156,6 @@ void tst_Q3PtrList::replaceStrShallow() QCOMPARE( list.insert(2, str), (bool)TRUE ); QCOMPARE( list.replace(2, str), (bool)TRUE ); -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -#endif } void tst_Q3PtrList::take() diff --git a/tests/auto/q3table/tst_q3table.cpp b/tests/auto/q3table/tst_q3table.cpp index 2fab3eb..7db0a40 100644 --- a/tests/auto/q3table/tst_q3table.cpp +++ b/tests/auto/q3table/tst_q3table.cpp @@ -387,7 +387,6 @@ public: void tst_Q3Table::selectComboTableItem() { -// #if QT_VERSION >= 0x030100 #if 0 MyTable table(4,4,0,"subclassTestWidget"); // Test for task #25026 diff --git a/tests/auto/q3textedit/tst_q3textedit.cpp b/tests/auto/q3textedit/tst_q3textedit.cpp index 21bc8b5..1fcce7b 100644 --- a/tests/auto/q3textedit/tst_q3textedit.cpp +++ b/tests/auto/q3textedit/tst_q3textedit.cpp @@ -159,12 +159,10 @@ void tst_Q3TextEdit::getSetCheck() Q3TextDocument *var2 = new Q3TextDocument(0); obj1.setDocument(var2); QCOMPARE(obj1.document(), var2); -#if QT_VERSION >= 0x040200 // Should've done as QTextEdit, and created a new document, if you setDocument(0). // Unfortunately it doesn't, and we cannot change it. obj1.setDocument((Q3TextDocument *)0); QCOMPARE(obj1.document(), var2); -#endif // delete var2; // No delete, since Q3TextEdit takes ownership } diff --git a/tests/auto/q3textstream/tst_q3textstream.cpp b/tests/auto/q3textstream/tst_q3textstream.cpp index 7932b79..b13e83f 100644 --- a/tests/auto/q3textstream/tst_q3textstream.cpp +++ b/tests/auto/q3textstream/tst_q3textstream.cpp @@ -346,9 +346,6 @@ void tst_Q3TextStream::operator_shiftleft() QFETCH( QString, device ); QFETCH( QString, encoding ); QFETCH( QByteArray, encoded ); -#if QT_VERSION < 0x040000 - encoded.resize( encoded.size() - 1 ); -#endif if ( device == "file" ) { QFile outFile( "qtextstream.out" ); @@ -400,9 +397,6 @@ void tst_Q3TextStream::operator_shiftright() QFETCH( int, intVal ); QFETCH( QString, stringVal ); QFETCH( QByteArray, encoded ); -#if QT_VERSION < 0x040000 - encoded.resize( encoded.size() - 1 ); -#endif if ( device == "file" ) { QFile outFile( "qtextstream.out" ); @@ -1295,7 +1289,6 @@ void tst_Q3TextStream::write_Q3CString( Q3TextStream *s ) void tst_Q3TextStream::task28319() { /* -#if QT_VERSION >= 0x040000 // Specific test for task 28319 QFile f("28319.txt"); if (f.open(IO_WriteOnly)) { @@ -1324,9 +1317,6 @@ void tst_Q3TextStream::task28319() } else { QVERIFY(FALSE); } -#else - QSKIP( "A minor bug we don't want to fix in 3.2.", SkipAll); -#endif */ } diff --git a/tests/auto/q3timeedit/tst_q3timeedit.cpp b/tests/auto/q3timeedit/tst_q3timeedit.cpp index 967bb51..1cdd87c 100644 --- a/tests/auto/q3timeedit/tst_q3timeedit.cpp +++ b/tests/auto/q3timeedit/tst_q3timeedit.cpp @@ -130,10 +130,8 @@ void tst_Q3TimeEdit::init() QTime maximumTime(23, 59, 59); testWidget->setMinValue(minimumTime); testWidget->setMaxValue(maximumTime); -#if QT_VERSION >= 0x030100 // We don't want the locale impacting on the test testWidget->setDisplay(Q3TimeEdit::Hours | Q3TimeEdit::Minutes | Q3TimeEdit::Seconds); -#endif testWidget->setTime(QTime(11, 0, 0)); // make sure we start with the hour focused @@ -174,10 +172,8 @@ void tst_Q3TimeEdit::valueRange() QTime maximumTime(maximumHours, maximumMinutes, maximumSeconds); testWidget->setMinValue(minimumTime); testWidget->setMaxValue(maximumTime); -#if QT_VERSION >= 0x030100 // We don't want the locale impacting on the test testWidget->setDisplay(Q3TimeEdit::Hours | Q3TimeEdit::Minutes | Q3TimeEdit::Seconds); -#endif // When pressing Key_Up we want to check it goes to the minimum time testWidget->setTime(maximumTime); diff --git a/tests/auto/q3valuelist/tst_q3valuelist.cpp b/tests/auto/q3valuelist/tst_q3valuelist.cpp index 8abeee2..b10664a 100644 --- a/tests/auto/q3valuelist/tst_q3valuelist.cpp +++ b/tests/auto/q3valuelist/tst_q3valuelist.cpp @@ -296,7 +296,6 @@ void tst_Q3ValueList::beginEnd() QCOMPARE( *(cit1), 2 ); QCOMPARE( *(cit2), 200 ); -#if (QT_VERSION >= 0x030200) Q3ValueList<int> b; b.append( 1 ); Q3ValueList<int> b2 = b; @@ -305,7 +304,6 @@ void tst_Q3ValueList::beginEnd() b2.append( 2 ); QVERIFY( b.constBegin() != b2.constBegin() ); QVERIFY( b2.constBegin() == b2.constBegin() ); -#endif } void tst_Q3ValueList::pushing() @@ -593,11 +591,7 @@ void tst_Q3ValueList::opStreamOut() class ListVerifier : public Q3ValueList<int> { public: -#if QT_VERSION < 0x040000 - void* pointer() { return sh; } -#else const int* pointer() const { return &*begin(); } -#endif }; void tst_Q3ValueList::shared() { diff --git a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp index b613b81..c0ffea0 100644 --- a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -346,14 +346,11 @@ void tst_QAbstractItemModel::match() QCOMPARE(res.count(), 2); res = model.match(start, Qt::DisplayRole, QVariant(".*O.*"), -1, Qt::MatchRegExp | Qt::MatchCaseSensitive); QCOMPARE(res.count(), 0); - // MatchFixedString seems new in 4.2 -#if QT_VERSION >= 0x040200 res = model.match(start, Qt::DisplayRole, QVariant("BOAR"), -1, Qt::MatchFixedString); QCOMPARE(res.count(), 1); res = model.match(start, Qt::DisplayRole, QVariant("bat"), -1, Qt::MatchFixedString | Qt::MatchCaseSensitive); QCOMPARE(res.count(), 1); -#endif } typedef QPair<int, int> Position; @@ -582,7 +579,6 @@ void tst_QAbstractItemModel::dropMimeData_data() << (qStringTableRow("" , "" , "A")) << (qStringTableRow("" , "" , "B"))); } -#if QT_VERSION >= 0x040200 { QTest::newRow("2x 1x2 dropped at [3, 2] (different rows)") << (STRINGTABLE // source table @@ -624,7 +620,6 @@ void tst_QAbstractItemModel::dropMimeData_data() << (qStringTableRow("" , "" , "B")) << (qStringTableRow("" , "" , "H"))); } -#endif } void tst_QAbstractItemModel::dropMimeData() diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp index 086c551..3a845e1 100644 --- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp @@ -234,11 +234,8 @@ void tst_QAbstractItemView::getSetCheck() MyAbstractItemDelegate *var1 = new MyAbstractItemDelegate; obj1->setItemDelegate(var1); QCOMPARE((QAbstractItemDelegate*)var1, obj1->itemDelegate()); -#if QT_VERSION >= 0x040200 - // Itemviews in Qt < 4.2 have asserts for this. Qt >= 4.2 should handle this gracefully obj1->setItemDelegate((QAbstractItemDelegate *)0); QCOMPARE((QAbstractItemDelegate *)0, obj1->itemDelegate()); -#endif delete var1; // EditTriggers QAbstractItemView::editTriggers() @@ -279,26 +276,6 @@ void tst_QAbstractItemView::getSetCheck() obj1->setAlternatingRowColors(true); QCOMPARE(true, obj1->alternatingRowColors()); -#if QT_VERSION < 0x040200 - // int QAbstractItemView::horizontalStepsPerItem() - // void QAbstractItemView::setHorizontalStepsPerItem(int) - obj1->tst_setHorizontalStepsPerItem(0); - QCOMPARE(0, obj1->tst_horizontalStepsPerItem()); - obj1->tst_setHorizontalStepsPerItem(INT_MIN); - QCOMPARE(INT_MIN, obj1->tst_horizontalStepsPerItem()); - obj1->tst_setHorizontalStepsPerItem(INT_MAX); - QCOMPARE(INT_MAX, obj1->tst_horizontalStepsPerItem()); - - // int QAbstractItemView::verticalStepsPerItem() - // void QAbstractItemView::setVerticalStepsPerItem(int) - obj1->tst_setVerticalStepsPerItem(0); - QCOMPARE(0, obj1->tst_verticalStepsPerItem()); - obj1->tst_setVerticalStepsPerItem(INT_MIN); - QCOMPARE(INT_MIN, obj1->tst_verticalStepsPerItem()); - obj1->tst_setVerticalStepsPerItem(INT_MAX); - QCOMPARE(INT_MAX, obj1->tst_verticalStepsPerItem()); -#endif - // State QAbstractItemView::state() // void QAbstractItemView::setState(State) obj1->tst_setState(TestView::tst_State(TestView::NoState)); @@ -314,13 +291,11 @@ void tst_QAbstractItemView::getSetCheck() obj1->tst_setState(TestView::tst_State(TestView::CollapsingState)); QCOMPARE(TestView::tst_State(TestView::CollapsingState), obj1->tst_state()); -#if QT_VERSION >= 0x040200 // QWidget QAbstractScrollArea::viewport() // void setViewport(QWidget*) QWidget *vp = new QWidget; obj1->setViewport(vp); QCOMPARE(vp, obj1->viewport()); -#endif QCOMPARE(16, obj1->autoScrollMargin()); obj1->setAutoScrollMargin(20); diff --git a/tests/auto/qabstractslider/tst_qabstractslider.cpp b/tests/auto/qabstractslider/tst_qabstractslider.cpp index 9e3acb8..dc1c866 100644 --- a/tests/auto/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/qabstractslider/tst_qabstractslider.cpp @@ -864,11 +864,7 @@ void tst_QAbstractSlider::wheelEvent() QVERIFY(applicationInstance->sendEvent(slider,&event)); QCOMPARE(slider->sliderPosition(),expectedSliderPosition); int expectedSignalCount = (initialSliderPosition == expectedSliderPosition) ? 0 : 1; -#if QT_VERSION >= 0x040200 QCOMPARE(spy1.count(), expectedSignalCount); -#else - QCOMPARE(spy1.count(), 0); -#endif QCOMPARE(spy2.count(), expectedSignalCount); if (expectedSignalCount) QVERIFY(actionTriggeredTimeStamp < valueChangedTimeStamp); diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 1aca624..dc52416 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -218,8 +218,6 @@ public: tst_QAccessibility(); virtual ~tst_QAccessibility(); - - public slots: void initTestCase(); void cleanupTestCase(); @@ -409,15 +407,15 @@ public: QtTestAccessibleWidgetIface(QtTestAccessibleWidget *w): QAccessibleWidget(w) {} QString text(Text t, int control) const { - if (t == Help) - return QString::fromLatin1("Help yourself"); - return QAccessibleWidget::text(t, control); + if (t == Help) + return QString::fromLatin1("Help yourself"); + return QAccessibleWidget::text(t, control); } static QAccessibleInterface *ifaceFactory(const QString &key, QObject *o) { - if (key == "QtTestAccessibleWidget") - return new QtTestAccessibleWidgetIface(static_cast<QtTestAccessibleWidget*>(o)); - return 0; + if (key == "QtTestAccessibleWidget") + return new QtTestAccessibleWidgetIface(static_cast<QtTestAccessibleWidget*>(o)); + return 0; } }; #endif @@ -455,15 +453,15 @@ void tst_QAccessibility::cleanup() #ifdef QTEST_ACCESSIBILITY const EventList list = QTestAccessibility::events(); if (!list.isEmpty()) { - qWarning("%d accessibility event(s) were not handled in testfunction '%s':", list.count(), - QString(QTest::currentTestFunction()).toAscii().constData()); - for (int i = 0; i < list.count(); ++i) - qWarning(" %d: Object: %p Event: '%s' (%d) Child: %d", i + 1, list.at(i).object, - eventName(list.at(i).event).toAscii().constData(), list.at(i).event, list.at(i).child); + qWarning("%d accessibility event(s) were not handled in testfunction '%s':", list.count(), + QString(QTest::currentTestFunction()).toAscii().constData()); + for (int i = 0; i < list.count(); ++i) + qWarning(" %d: Object: %p Event: '%s' (%d) Child: %d", i + 1, list.at(i).object, + eventName(list.at(i).event).toAscii().constData(), list.at(i).event, list.at(i).child); } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -486,7 +484,7 @@ void tst_QAccessibility::eventTest() delete button; #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -505,7 +503,7 @@ void tst_QAccessibility::customWidget() delete iface; delete widget; #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -523,7 +521,7 @@ void tst_QAccessibility::deletedWidget() QVERIFY(!iface->isValid()); delete iface; #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -542,52 +540,52 @@ QWidget *tst_QAccessibility::createGUI() topLeft->setSpacing(2); grid->addWidget(topLeft, 0, 0); - Q3VButtonGroup *group1 = new Q3VButtonGroup("Title1:", topLeft, "group1"); - /*QPushButton *pb1 = */ new QPushButton("Button&1", group1, "pb1"); - Q3VButtonGroup *group2 = new Q3VButtonGroup("Title2:", topLeft, "group2"); - /*QPushButton *pb2 = */ new QPushButton("Button2", group2, "pb2"); + Q3VButtonGroup *group1 = new Q3VButtonGroup("Title1:", topLeft, "group1"); + /*QPushButton *pb1 = */ new QPushButton("Button&1", group1, "pb1"); + Q3VButtonGroup *group2 = new Q3VButtonGroup("Title2:", topLeft, "group2"); + /*QPushButton *pb2 = */ new QPushButton("Button2", group2, "pb2"); - Q3WidgetStack *stack = new Q3WidgetStack(topLeft, "stack"); - QLabel *page1 = new QLabel("Page 1", stack, "page1"); - stack->addWidget(page1); - QLabel *page2 = new QLabel("Page 2", stack, "page2"); - stack->addWidget(page2); - QLabel *page3 = new QLabel("Page 3", stack, "page3"); - stack->addWidget(page3); + Q3WidgetStack *stack = new Q3WidgetStack(topLeft, "stack"); + QLabel *page1 = new QLabel("Page 1", stack, "page1"); + stack->addWidget(page1); + QLabel *page2 = new QLabel("Page 2", stack, "page2"); + stack->addWidget(page2); + QLabel *page3 = new QLabel("Page 3", stack, "page3"); + stack->addWidget(page3); // topRight - controlling Q3VBox *topRight= new Q3VBox(toplevel, "topRight"); grid->addWidget(topRight, 0, 1); - QPushButton *pbOk = new QPushButton("Ok", topRight, "pbOk" ); - pbOk->setDefault(TRUE); - QSlider *slider = new QSlider(Qt::Horizontal, topRight, "slider"); - QLCDNumber *sliderLcd = new QLCDNumber(topRight, "sliderLcd"); - QSpinBox *spinBox = new QSpinBox(topRight, "spinBox"); + QPushButton *pbOk = new QPushButton("Ok", topRight, "pbOk" ); + pbOk->setDefault(TRUE); + QSlider *slider = new QSlider(Qt::Horizontal, topRight, "slider"); + QLCDNumber *sliderLcd = new QLCDNumber(topRight, "sliderLcd"); + QSpinBox *spinBox = new QSpinBox(topRight, "spinBox"); - connect(pbOk, SIGNAL(clicked()), toplevel, SLOT(close()) ); - connect(slider, SIGNAL(valueChanged(int)), sliderLcd, SLOT(display(int))); - connect(spinBox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); + connect(pbOk, SIGNAL(clicked()), toplevel, SLOT(close()) ); + connect(slider, SIGNAL(valueChanged(int)), sliderLcd, SLOT(display(int))); + connect(spinBox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); - spinBox->setValue(50); + spinBox->setValue(50); // bottomLeft - labeling and controlling Q3HBox *bottomLeft = new Q3HBox(toplevel, "bottomLeft"); grid->addWidget(bottomLeft, 1, 0); - QLabel *label = new QLabel("This is a &lineedit:", bottomLeft, "label"); - QLineEdit *lineedit = new QLineEdit(bottomLeft, "lineedit"); - label->setBuddy(lineedit); - QLabel *label2 = new QLabel(bottomLeft, "label2"); + QLabel *label = new QLabel("This is a &lineedit:", bottomLeft, "label"); + QLineEdit *lineedit = new QLineEdit(bottomLeft, "lineedit"); + label->setBuddy(lineedit); + QLabel *label2 = new QLabel(bottomLeft, "label2"); - connect(lineedit, SIGNAL(textChanged(const QString&)), label2, SLOT(setText(const QString&))); + connect(lineedit, SIGNAL(textChanged(const QString&)), label2, SLOT(setText(const QString&))); - Q3VButtonGroup *radiogroup = new Q3VButtonGroup("Exclusive &choices:", bottomLeft, "radiogroup"); - QLineEdit *frequency = new QLineEdit(radiogroup, "frequency"); - frequency->setText("100 Mhz"); - QRadioButton *radioAM = new QRadioButton("&AM", radiogroup, "radioAM"); - /* QRadioButton *radioFM = */ new QRadioButton("&FM", radiogroup, "radioFM"); - /* QRadioButton *radioSW = */ new QRadioButton("&Shortwave", radiogroup, "radioSW"); + Q3VButtonGroup *radiogroup = new Q3VButtonGroup("Exclusive &choices:", bottomLeft, "radiogroup"); + QLineEdit *frequency = new QLineEdit(radiogroup, "frequency"); + frequency->setText("100 Mhz"); + QRadioButton *radioAM = new QRadioButton("&AM", radiogroup, "radioAM"); + /* QRadioButton *radioFM = */ new QRadioButton("&FM", radiogroup, "radioFM"); + /* QRadioButton *radioSW = */ new QRadioButton("&Shortwave", radiogroup, "radioSW"); // bottomRight - ### empty Q3HBox *bottomRight = new Q3HBox(toplevel, "bottomRight"); @@ -626,23 +624,23 @@ void tst_QAccessibility::childAt() QObjectList children = toplevel->queryList("QWidget", 0, 0, 0); for (int c = 1; c <= children.count(); ++c) { - QWidget *child = qobject_cast<QWidget*>(children.at(c-1)); - QAccessibleInterface *acc_child = QAccessible::queryAccessibleInterface(child); - QVERIFY(acc_child); - QCOMPARE(acc_child->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, QAccessible::Child); - - QPoint center(child->mapToGlobal(child->rect().center())); - QRect childRect(child->geometry()); - childRect.moveCenter(center); - - QCOMPARE(acc_child->rect(0), childRect); - QCOMPARE(acc_toplevel->childAt(childRect.center().x(), childRect.center().y()), c); - QCOMPARE(acc_toplevel->childAt(childRect.left(), childRect.top()), c); - QCOMPARE(acc_toplevel->childAt(childRect.left(), childRect.bottom()), c); - QCOMPARE(acc_toplevel->childAt(childRect.right(), childRect.top()), c); - QCOMPARE(acc_toplevel->childAt(childRect.right(), childRect.bottom()), c); - - QCOMPARE(acc_toplevel->indexOfChild(acc_child), c); + QWidget *child = qobject_cast<QWidget*>(children.at(c-1)); + QAccessibleInterface *acc_child = QAccessible::queryAccessibleInterface(child); + QVERIFY(acc_child); + QCOMPARE(acc_child->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, QAccessible::Child); + + QPoint center(child->mapToGlobal(child->rect().center())); + QRect childRect(child->geometry()); + childRect.moveCenter(center); + + QCOMPARE(acc_child->rect(0), childRect); + QCOMPARE(acc_toplevel->childAt(childRect.center().x(), childRect.center().y()), c); + QCOMPARE(acc_toplevel->childAt(childRect.left(), childRect.top()), c); + QCOMPARE(acc_toplevel->childAt(childRect.left(), childRect.bottom()), c); + QCOMPARE(acc_toplevel->childAt(childRect.right(), childRect.top()), c); + QCOMPARE(acc_toplevel->childAt(childRect.right(), childRect.bottom()), c); + + QCOMPARE(acc_toplevel->indexOfChild(acc_child), c); delete acc_child; } @@ -650,7 +648,7 @@ void tst_QAccessibility::childAt() delete toplevel; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // !QT3_SUPPORT } @@ -694,7 +692,7 @@ void tst_QAccessibility::childCount() delete toplevel; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // !QT3_SUPPORT } @@ -716,33 +714,33 @@ void tst_QAccessibility::relationTo() QAccessibleInterface *acc_toplevel = QAccessible::queryAccessibleInterface(toplevel); - QAccessibleInterface *acc_topLeft = QAccessible::queryAccessibleInterface(topLeft); - QAccessibleInterface *acc_group1 = QAccessible::queryAccessibleInterface(topLeft->child("group1")); - QVERIFY(topLeft->child("group1")); - QAccessibleInterface *acc_pb1 = QAccessible::queryAccessibleInterface(topLeft->child("group1")->child("pb1")); - QAccessibleInterface *acc_group2 = QAccessible::queryAccessibleInterface(topLeft->child("group2")); - QAccessibleInterface *acc_pb2 = 0; - QAccessibleInterface *acc_stack = QAccessible::queryAccessibleInterface(topLeft->child("stack")); - QAccessibleInterface *acc_page1 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page1")); - QAccessibleInterface *acc_page2 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page2")); - QAccessibleInterface *acc_page3 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page3")); - QAccessibleInterface *acc_topRight = QAccessible::queryAccessibleInterface(topRight); - QAccessibleInterface *acc_pbOk = QAccessible::queryAccessibleInterface(topRight->child("pbOk")); - QAccessibleInterface *acc_slider = QAccessible::queryAccessibleInterface(topRight->child("slider")); - QAccessibleInterface *acc_spinBox = QAccessible::queryAccessibleInterface(topRight->child("spinBox")); - QAccessibleInterface *acc_sliderLcd = QAccessible::queryAccessibleInterface(topRight->child("sliderLcd")); - - QAccessibleInterface *acc_bottomLeft = QAccessible::queryAccessibleInterface(bottomLeft); - QAccessibleInterface *acc_label = QAccessible::queryAccessibleInterface(bottomLeft->child("label")); - QAccessibleInterface *acc_lineedit = QAccessible::queryAccessibleInterface(bottomLeft->child("lineedit")); - QAccessibleInterface *acc_label2 = QAccessible::queryAccessibleInterface(bottomLeft->child("label2")); - QAccessibleInterface *acc_radiogroup = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")); - QAccessibleInterface *acc_radioAM = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioAM")); - QAccessibleInterface *acc_radioFM = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioFM")); - QAccessibleInterface *acc_radioSW = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioSW")); - QAccessibleInterface *acc_frequency = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("frequency")); - - QAccessibleInterface *acc_bottomRight = QAccessible::queryAccessibleInterface(bottomRight); + QAccessibleInterface *acc_topLeft = QAccessible::queryAccessibleInterface(topLeft); + QAccessibleInterface *acc_group1 = QAccessible::queryAccessibleInterface(topLeft->child("group1")); + QVERIFY(topLeft->child("group1")); + QAccessibleInterface *acc_pb1 = QAccessible::queryAccessibleInterface(topLeft->child("group1")->child("pb1")); + QAccessibleInterface *acc_group2 = QAccessible::queryAccessibleInterface(topLeft->child("group2")); + QAccessibleInterface *acc_pb2 = 0; + QAccessibleInterface *acc_stack = QAccessible::queryAccessibleInterface(topLeft->child("stack")); + QAccessibleInterface *acc_page1 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page1")); + QAccessibleInterface *acc_page2 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page2")); + QAccessibleInterface *acc_page3 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page3")); + QAccessibleInterface *acc_topRight = QAccessible::queryAccessibleInterface(topRight); + QAccessibleInterface *acc_pbOk = QAccessible::queryAccessibleInterface(topRight->child("pbOk")); + QAccessibleInterface *acc_slider = QAccessible::queryAccessibleInterface(topRight->child("slider")); + QAccessibleInterface *acc_spinBox = QAccessible::queryAccessibleInterface(topRight->child("spinBox")); + QAccessibleInterface *acc_sliderLcd = QAccessible::queryAccessibleInterface(topRight->child("sliderLcd")); + + QAccessibleInterface *acc_bottomLeft = QAccessible::queryAccessibleInterface(bottomLeft); + QAccessibleInterface *acc_label = QAccessible::queryAccessibleInterface(bottomLeft->child("label")); + QAccessibleInterface *acc_lineedit = QAccessible::queryAccessibleInterface(bottomLeft->child("lineedit")); + QAccessibleInterface *acc_label2 = QAccessible::queryAccessibleInterface(bottomLeft->child("label2")); + QAccessibleInterface *acc_radiogroup = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")); + QAccessibleInterface *acc_radioAM = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioAM")); + QAccessibleInterface *acc_radioFM = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioFM")); + QAccessibleInterface *acc_radioSW = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioSW")); + QAccessibleInterface *acc_frequency = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("frequency")); + + QAccessibleInterface *acc_bottomRight = QAccessible::queryAccessibleInterface(bottomRight); QVERIFY(acc_toplevel); QVERIFY(acc_topLeft); @@ -769,49 +767,49 @@ void tst_QAccessibility::relationTo() // hierachy relations QCOMPARE(acc_toplevel->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Self); + QAccessible::Self); QCOMPARE(acc_toplevel->relationTo(1, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Child); + QAccessible::Child); QCOMPARE(acc_toplevel->relationTo(0, acc_toplevel, 1) & QAccessible::HierarchyMask, - QAccessible::Ancestor); + QAccessible::Ancestor); QCOMPARE(acc_toplevel->relationTo(0, acc_topLeft, 0) & QAccessible::HierarchyMask, - QAccessible::Ancestor); + QAccessible::Ancestor); QCOMPARE(acc_toplevel->relationTo(0, acc_topRight, 0) & QAccessible::HierarchyMask, - QAccessible::Ancestor); + QAccessible::Ancestor); QCOMPARE(acc_toplevel->relationTo(0, acc_bottomLeft, 0) & QAccessible::HierarchyMask, - QAccessible::Ancestor); + QAccessible::Ancestor); QCOMPARE(acc_toplevel->relationTo(0, acc_bottomRight, 0) & QAccessible::HierarchyMask, - QAccessible::Ancestor); + QAccessible::Ancestor); QCOMPARE(acc_toplevel->relationTo(0, acc_group1, 0) & QAccessible::HierarchyMask, - QAccessible::Ancestor); + QAccessible::Ancestor); QCOMPARE(acc_toplevel->relationTo(0, acc_page1, 0) & QAccessible::HierarchyMask, - QAccessible::Ancestor); + QAccessible::Ancestor); QCOMPARE(acc_group1->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Descendent); + QAccessible::Descendent); QCOMPARE(acc_stack->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Descendent); + QAccessible::Descendent); QCOMPARE(acc_page1->relationTo(0, acc_stack, 0) & QAccessible::HierarchyMask, - QAccessible::Child); + QAccessible::Child); QCOMPARE(acc_page1->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Descendent); + QAccessible::Descendent); QCOMPARE(acc_topLeft->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Child); + QAccessible::Child); QCOMPARE(acc_topRight->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Child); + QAccessible::Child); QCOMPARE(acc_bottomLeft->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Child); + QAccessible::Child); QCOMPARE(acc_bottomRight->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, - QAccessible::Child); + QAccessible::Child); QCOMPARE(acc_topLeft->relationTo(0, acc_topRight, 0) & QAccessible::HierarchyMask, - QAccessible::Sibling); + QAccessible::Sibling); QCOMPARE(acc_topLeft->relationTo(0, acc_bottomLeft, 0) & QAccessible::HierarchyMask, - QAccessible::Sibling); + QAccessible::Sibling); QCOMPARE(acc_topLeft->relationTo(0, acc_bottomRight, 0) & QAccessible::HierarchyMask, - QAccessible::Sibling); + QAccessible::Sibling); QCOMPARE(acc_pb1->relationTo(0, acc_pb2, 0), QAccessible::Unrelated); @@ -836,25 +834,25 @@ void tst_QAccessibility::relationTo() // logical relations - focus QCOMPARE(acc_radioAM->relationTo(0, acc_radioFM, 0) & QAccessible::FocusChild, - QAccessible::Unrelated); + QAccessible::Unrelated); QCOMPARE(acc_radioAM->relationTo(0, acc_radiogroup, 0) & QAccessible::FocusChild, - QAccessible::FocusChild); + QAccessible::FocusChild); QCOMPARE(acc_radioAM->relationTo(0, acc_bottomLeft, 0) & QAccessible::FocusChild, - QAccessible::FocusChild); + QAccessible::FocusChild); QCOMPARE(acc_radioAM->relationTo(0, acc_topLeft, 0) & QAccessible::FocusChild, - QAccessible::Unrelated); + QAccessible::Unrelated); QCOMPARE(acc_radioAM->relationTo(0, acc_toplevel, 0) & QAccessible::FocusChild, - QAccessible::FocusChild); + QAccessible::FocusChild); // logical relations - labels QCOMPARE(acc_label->relationTo(0, acc_lineedit, 0) & QAccessible::LogicalMask, - QAccessible::Label); + QAccessible::Label); QCOMPARE(acc_lineedit->relationTo(0, acc_label, 0) & QAccessible::LogicalMask, - QAccessible::Labelled); + QAccessible::Labelled); QCOMPARE(acc_label->relationTo(0, acc_radiogroup, 0) & QAccessible::LogicalMask, - QAccessible::Unrelated); + QAccessible::Unrelated); QCOMPARE(acc_lineedit->relationTo(0, acc_lineedit, 0) & QAccessible::LogicalMask, - QAccessible::Unrelated); + QAccessible::Unrelated); QEXPECT_FAIL("", "Make me accessible", Continue); QCOMPARE(acc_radiogroup->relationTo(0, acc_radioAM, 0) & QAccessible::LogicalMask, @@ -866,21 +864,21 @@ void tst_QAccessibility::relationTo() QCOMPARE(acc_radiogroup->relationTo(0, acc_radioSW, 0) & QAccessible::LogicalMask, QAccessible::Label | QAccessible::Controlled); QCOMPARE(acc_radiogroup->relationTo(0, acc_frequency, 0) & QAccessible::LogicalMask, - QAccessible::Label); + QAccessible::Label); QCOMPARE(acc_frequency->relationTo(0, acc_radiogroup, 0) & QAccessible::LogicalMask, - QAccessible::Labelled); + QAccessible::Labelled); QCOMPARE(acc_radiogroup->relationTo(0, acc_lineedit, 0) & QAccessible::LogicalMask, - QAccessible::Unrelated); + QAccessible::Unrelated); // logical relations - controller QCOMPARE(acc_pbOk->relationTo(0, acc_toplevel, 0) & QAccessible::LogicalMask, - QAccessible::Controller); + QAccessible::Controller); QCOMPARE(acc_slider->relationTo(0, acc_sliderLcd, 0) & QAccessible::LogicalMask, - QAccessible::Controller); + QAccessible::Controller); QCOMPARE(acc_spinBox->relationTo(0, acc_slider, 0) & QAccessible::LogicalMask, - QAccessible::Controller); + QAccessible::Controller); QCOMPARE(acc_lineedit->relationTo(0, acc_label2, 0) & QAccessible::LogicalMask, - QAccessible::Controller); + QAccessible::Controller); delete acc_toplevel; delete acc_topLeft; @@ -911,7 +909,7 @@ void tst_QAccessibility::relationTo() QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // !QT3_SUPPORT } @@ -934,8 +932,8 @@ void tst_QAccessibility::navigateGeometric() QtTestAccessibleWidget *aw = 0; int i; for (i = 0; i < 360; i += skip) { - aw = new QtTestAccessibleWidget(w, QString::number(i).toLatin1()); - aw->move( int(200.0 + 100.0 * sin(step * (double)i)), int(200.0 + 100.0 * cos(step * (double)i)) ); + aw = new QtTestAccessibleWidget(w, QString::number(i).toLatin1()); + aw->move( int(200.0 + 100.0 * sin(step * (double)i)), int(200.0 + 100.0 * cos(step * (double)i)) ); } aw = new QtTestAccessibleWidget(w, "Earth"); @@ -950,25 +948,24 @@ void tst_QAccessibility::navigateGeometric() QTest::qWait(100); #endif - // let one widget rotate around center for (i = 0; i < 360; i+=skip) { - aw->move( int(200.0 + 75.0 * sin(step * (double)i)), int(200.0 + 75.0 * cos(step * (double)i)) ); - - if (i < 45 || i > 315) { - QCOMPARE(iface->navigate(QAccessible::Down, 0, &target), 0); - } else if ( i < 135 ) { - QCOMPARE(iface->navigate(QAccessible::Right, 0, &target), 0); - } else if ( i < 225 ) { - QCOMPARE(iface->navigate(QAccessible::Up, 0, &target), 0); - } else { - QCOMPARE(iface->navigate(QAccessible::Left, 0, &target), 0); + aw->move( int(200.0 + 75.0 * sin(step * (double)i)), int(200.0 + 75.0 * cos(step * (double)i)) ); + + if (i < 45 || i > 315) { + QCOMPARE(iface->navigate(QAccessible::Down, 0, &target), 0); + } else if ( i < 135 ) { + QCOMPARE(iface->navigate(QAccessible::Right, 0, &target), 0); + } else if ( i < 225 ) { + QCOMPARE(iface->navigate(QAccessible::Up, 0, &target), 0); + } else { + QCOMPARE(iface->navigate(QAccessible::Left, 0, &target), 0); } - QVERIFY(target); - QVERIFY(target->isValid()); - QVERIFY(target->object()); - QCOMPARE(target->object()->objectName(), aw->objectName()); + QVERIFY(target); + QVERIFY(target->isValid()); + QVERIFY(target->object()); + QCOMPARE(target->object()->objectName(), aw->objectName()); delete target; target = 0; } @@ -1016,7 +1013,7 @@ void tst_QAccessibility::navigateGeometric() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1050,7 +1047,7 @@ void tst_QAccessibility::navigateSlider() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1092,43 +1089,43 @@ void tst_QAccessibility::navigateCovered() QVERIFY(iface3 == 0); for (int loop = 0; loop < 2; ++loop) { - for (int x = 0; x < w->width(); ++x) { - for (int y = 0; y < w->height(); ++y) { - w1->move(x, y); - if (w1->geometry().intersects(w2->geometry())) { - QVERIFY(iface1->relationTo(0, iface2, 0) & QAccessible::Covers); - QVERIFY(iface2->relationTo(0, iface1, 0) & QAccessible::Covered); - QCOMPARE(iface1->navigate(QAccessible::Covered, 1, &iface3), 0); - QVERIFY(iface3 != 0); - QVERIFY(iface3->isValid()); - QCOMPARE(iface3->object(), iface2->object()); + for (int x = 0; x < w->width(); ++x) { + for (int y = 0; y < w->height(); ++y) { + w1->move(x, y); + if (w1->geometry().intersects(w2->geometry())) { + QVERIFY(iface1->relationTo(0, iface2, 0) & QAccessible::Covers); + QVERIFY(iface2->relationTo(0, iface1, 0) & QAccessible::Covered); + QCOMPARE(iface1->navigate(QAccessible::Covered, 1, &iface3), 0); + QVERIFY(iface3 != 0); + QVERIFY(iface3->isValid()); + QCOMPARE(iface3->object(), iface2->object()); delete iface3; iface3 = 0; - QCOMPARE(iface2->navigate(QAccessible::Covers, 1, &iface3), 0); - QVERIFY(iface3 != 0); - QVERIFY(iface3->isValid()); - QCOMPARE(iface3->object(), iface1->object()); + QCOMPARE(iface2->navigate(QAccessible::Covers, 1, &iface3), 0); + QVERIFY(iface3 != 0); + QVERIFY(iface3->isValid()); + QCOMPARE(iface3->object(), iface1->object()); delete iface3; iface3 = 0; - } else { - QVERIFY(!(iface1->relationTo(0, iface2, 0) & QAccessible::Covers)); - QVERIFY(!(iface2->relationTo(0, iface1, 0) & QAccessible::Covered)); - QCOMPARE(iface1->navigate(QAccessible::Covered, 1, &iface3), -1); - QVERIFY(iface3 == 0); - QCOMPARE(iface1->navigate(QAccessible::Covers, 1, &iface3), -1); - QVERIFY(iface3 == 0); - QCOMPARE(iface2->navigate(QAccessible::Covered, 1, &iface3), -1); - QVERIFY(iface3 == 0); - QCOMPARE(iface2->navigate(QAccessible::Covers, 1, &iface3), -1); - QVERIFY(iface3 == 0); - } - } - } - if (!loop) { - // switch children for second loop - w2->raise(); - QAccessibleInterface *temp = iface1; - iface1 = iface2; - iface2 = temp; - } + } else { + QVERIFY(!(iface1->relationTo(0, iface2, 0) & QAccessible::Covers)); + QVERIFY(!(iface2->relationTo(0, iface1, 0) & QAccessible::Covered)); + QCOMPARE(iface1->navigate(QAccessible::Covered, 1, &iface3), -1); + QVERIFY(iface3 == 0); + QCOMPARE(iface1->navigate(QAccessible::Covers, 1, &iface3), -1); + QVERIFY(iface3 == 0); + QCOMPARE(iface2->navigate(QAccessible::Covered, 1, &iface3), -1); + QVERIFY(iface3 == 0); + QCOMPARE(iface2->navigate(QAccessible::Covers, 1, &iface3), -1); + QVERIFY(iface3 == 0); + } + } + } + if (!loop) { + // switch children for second loop + w2->raise(); + QAccessibleInterface *temp = iface1; + iface1 = iface2; + iface2 = temp; + } } delete iface1; iface1 = 0; delete iface2; iface2 = 0; @@ -1160,7 +1157,7 @@ void tst_QAccessibility::navigateCovered() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1263,7 +1260,7 @@ void tst_QAccessibility::navigateHierarchy() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1278,11 +1275,11 @@ void tst_QAccessibility::navigateControllers() #ifdef QTEST_ACCESSIBILITY { Q3VBox vbox; - QSlider slider(&vbox); - QSpinBox spinBox(&vbox); - QLCDNumber lcd1(&vbox); - QLCDNumber lcd2(&vbox); - QLabel label(&vbox); + QSlider slider(&vbox); + QSpinBox spinBox(&vbox); + QLCDNumber lcd1(&vbox); + QLCDNumber lcd2(&vbox); + QLabel label(&vbox); vbox.show(); slider.setObjectName("slider"); @@ -1359,7 +1356,7 @@ void tst_QAccessibility::navigateControllers() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // !QT3_SUPPORT } @@ -1374,24 +1371,24 @@ void tst_QAccessibility::navigateLabels() Q3VBox vbox; Q3HBox hbox(&vbox); - QLabel label(&hbox); + QLabel label(&hbox); label.setText("This is a lineedit:"); - QLineEdit lineedit(&hbox); + QLineEdit lineedit(&hbox); label.setBuddy(&lineedit); Q3VButtonGroup groupbox(&vbox); groupbox.setTitle("Be my children!"); QRadioButton radio(&groupbox); - QLabel label2(&groupbox); + QLabel label2(&groupbox); label2.setText("Another lineedit:"); - QLineEdit lineedit2(&groupbox); + QLineEdit lineedit2(&groupbox); label2.setBuddy(&lineedit2); Q3GroupBox groupbox2(&groupbox); groupbox2.setTitle("Some grand-children"); - QLineEdit grandchild(&groupbox2); + QLineEdit grandchild(&groupbox2); Q3GroupBox border(&vbox); - QLineEdit lineedit3(&border); + QLineEdit lineedit3(&border); vbox.show(); QTestAccessibility::clearEvents(); @@ -1492,7 +1489,7 @@ void tst_QAccessibility::navigateLabels() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // !QT3_SUPPORT } @@ -1571,7 +1568,7 @@ void tst_QAccessibility::accessibleName() delete toplevel; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1678,7 +1675,7 @@ void tst_QAccessibility::text() QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // !QT3_SUPPORT } @@ -1714,7 +1711,7 @@ void tst_QAccessibility::setText() QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif //QT3_SUPPORT } @@ -1749,7 +1746,7 @@ void tst_QAccessibility::hideShowTest() delete window; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1786,7 +1783,7 @@ void tst_QAccessibility::userActionCount() QCOMPARE(test->userActionCount(-1), 0); delete test; test = 0; #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1811,7 +1808,7 @@ void tst_QAccessibility::actionText() delete test; test = 0; #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -1820,7 +1817,7 @@ void tst_QAccessibility::doAction() #ifdef QTEST_ACCESSIBILITY QSKIP("TODO: Implement me", SkipAll); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2007,7 +2004,7 @@ void tst_QAccessibility::buttonTest() QTestAccessibility::clearEvents(); #else -// QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); +// QSKIP("Test needs accessibility support.", SkipAll); QSKIP("No action interface in Qt 4 yet.", SkipAll); #endif } @@ -2207,7 +2204,7 @@ void tst_QAccessibility::sliderTest() QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif //!QT3_SUPPORT } @@ -2305,7 +2302,7 @@ void tst_QAccessibility::scrollBarTest() QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2349,7 +2346,7 @@ void tst_QAccessibility::tabTest() delete interface; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2537,8 +2534,6 @@ void tst_QAccessibility::menuTest() } delete iface; - - // "New" item entry = interface->navigate(QAccessible::Child, 1, &iface); QCOMPARE(entry, 0); @@ -2569,11 +2564,6 @@ void tst_QAccessibility::menuTest() delete iface; - - -#if QT_VERSION < 0x040102 - QEXPECT_FAIL("", "Submenus don't open, task 99301", Continue); -#endif // move mouse pointer away, since that might influence the // subsequent tests QTest::mouseMove(&mw, QPoint(-1, -1)); @@ -2583,9 +2573,6 @@ void tst_QAccessibility::menuTest() interface->doAction(QAccessible::DefaultAction, 1); QTestEventLoop::instance().enterLoop(2); -#if defined (Q_OS_WIN) && QT_VERSION < 0x040300 && !defined(Q_OS_WINCE) - QEXPECT_FAIL("", "Don't expect the File menu to be visible in 4.2", Continue); -#endif QVERIFY(file->isVisible()); QVERIFY(fileNew->isVisible()); QVERIFY(!edit->isVisible()); @@ -2639,7 +2626,7 @@ void tst_QAccessibility::spinBoxTest() delete spinBox; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2666,7 +2653,7 @@ void tst_QAccessibility::doubleSpinBoxTest() delete doubleSpinBox; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2688,7 +2675,7 @@ void tst_QAccessibility::textEditTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2712,7 +2699,7 @@ void tst_QAccessibility::textBrowserTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2785,7 +2772,7 @@ void tst_QAccessibility::listViewTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2842,7 +2829,7 @@ void tst_QAccessibility::mdiAreaTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -2972,7 +2959,7 @@ void tst_QAccessibility::mdiSubWindowTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3037,7 +3024,7 @@ void tst_QAccessibility::lineEditTest() delete toplevel; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3098,7 +3085,7 @@ void tst_QAccessibility::workspaceTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3218,7 +3205,7 @@ void tst_QAccessibility::dialogButtonBoxTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3267,7 +3254,7 @@ void tst_QAccessibility::dialTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3281,7 +3268,7 @@ void tst_QAccessibility::rubberBandTest() delete interface; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3446,7 +3433,7 @@ void tst_QAccessibility::abstractScrollAreaTest() QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3467,7 +3454,7 @@ void tst_QAccessibility::scrollAreaTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3512,7 +3499,7 @@ void tst_QAccessibility::tableWidgetTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3630,7 +3617,7 @@ void tst_QAccessibility::tableViewTest() QCOMPARE(client->role(0), QAccessible::Client); QRect globalRect = client->rect(0); QVERIFY(globalRect.isValid()); - // make sure we don't hit the vertical header ##### + // make sure we don't hit the vertical header ##### QPoint p = globalRect.topLeft() + QPoint(8, 8); p.ry() += 50 * (y - 1); p.rx() += 100 * (x - 1); @@ -3678,7 +3665,7 @@ void tst_QAccessibility::tableViewTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3779,7 +3766,7 @@ void tst_QAccessibility::calendarWidgetTest() } QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // QT_NO_CALENDARWIDGET } @@ -3857,7 +3844,7 @@ void tst_QAccessibility::dockWidgetTest() delete mw; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif // QT_NO_DOCKWIDGET } @@ -3903,7 +3890,7 @@ void tst_QAccessibility::pushButtonTest() delete toplevel; QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif #endif //QT3_SUPPORT } @@ -3950,7 +3937,7 @@ void tst_QAccessibility::comboBoxTest() QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } @@ -3989,7 +3976,6 @@ void tst_QAccessibility::treeWidgetTest() QCOMPARE(entry, 0); QCOMPARE(accTreeItem2->text(QAccessible::Name, 0), QLatin1String("row: 1")); - // test selected/focused state QItemSelectionModel *selModel = tree->selectionModel(); QVERIFY(selModel); @@ -4015,10 +4001,9 @@ void tst_QAccessibility::treeWidgetTest() delete acc; delete w; - QTestAccessibility::clearEvents(); #else - QSKIP("Test needs Qt >= 0x040000 and accessibility support.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } diff --git a/tests/auto/qalgorithms/tst_qalgorithms.cpp b/tests/auto/qalgorithms/tst_qalgorithms.cpp index 9c2fa50..423cf69 100644 --- a/tests/auto/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/qalgorithms/tst_qalgorithms.cpp @@ -574,10 +574,8 @@ void tst_QAlgorithms::test_qLowerBound() QCOMPARE(qLowerBound(data.constBegin(), data.constEnd(), resultValue), data.constBegin() + resultIndex); QCOMPARE(qLowerBound(data.begin(), data.end(), resultValue), data.begin() + resultIndex); -#if QT_VERSION >= 0x040200 QCOMPARE(qLowerBound(data, resultValue), data.constBegin() + resultIndex); QCOMPARE(qLowerBound(data.constBegin(), data.constEnd(), resultValue, qLess<int>()), data.constBegin() + resultIndex); -#endif } void tst_QAlgorithms::test_qUpperBound_data() @@ -597,10 +595,8 @@ void tst_QAlgorithms::test_qUpperBound() QCOMPARE(qUpperBound(data.constBegin(), data.constEnd(), resultValue), data.constBegin() + resultIndex); QCOMPARE(qUpperBound(data.begin(), data.end(), resultValue), data.begin() + resultIndex); -#if QT_VERSION >= 0x040200 QCOMPARE(qUpperBound(data, resultValue), data.constBegin() + resultIndex); QCOMPARE(qUpperBound(data.constBegin(), data.constEnd(), resultValue, qLess<int>()), data.constBegin() + resultIndex); -#endif } void tst_QAlgorithms::test_qBinaryFind_data() @@ -618,10 +614,8 @@ void tst_QAlgorithms::test_qBinaryFind() QCOMPARE(*qBinaryFind(data.constBegin(), data.constEnd(), resultValue), resultValue); QCOMPARE(*qBinaryFind(data.begin(), data.end(), resultValue), resultValue); -#if QT_VERSION >= 0x040200 QCOMPARE(*qBinaryFind(data, resultValue), resultValue); QCOMPARE(*qBinaryFind(data.constBegin(), data.constEnd(), resultValue, qLess<int>()), resultValue); -#endif } void tst_QAlgorithms::qBinaryFindOneEntry() @@ -802,7 +796,6 @@ void tst_QAlgorithms::stableSortCorrectnessTest() void tst_QAlgorithms::convenienceAPI() { // Compile-test for QAlgorithm convenience functions. -#if QT_VERSION >= 0x040200 QList<int> list, list2; qCopy(list.begin(), list.end(), list2.begin()); @@ -844,7 +837,6 @@ void tst_QAlgorithms::convenienceAPI() QList<int *> pointerList; qDeleteAll(pointerList); qDeleteAll(pointerList.begin(), pointerList.end()); -#endif } template <typename DataType> diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp index bbcb087..ecdffda 100644 --- a/tests/auto/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/qbitarray/tst_qbitarray.cpp @@ -212,10 +212,8 @@ void tst_QBitArray::countBits() } QCOMPARE(bits.count(), numBits); -#if QT_VERSION >= 0x040100 QCOMPARE(bits.count(true), onBits); QCOMPARE(bits.count(false), numBits - onBits); -#endif } void tst_QBitArray::countBits2() @@ -314,7 +312,7 @@ void tst_QBitArray::toggleBit_data() } void tst_QBitArray::toggleBit() -{ +{ QFETCH(int,index); QFETCH(QBitArray, input); QFETCH(QBitArray, res); @@ -322,7 +320,6 @@ void tst_QBitArray::toggleBit() input.toggleBit(index); QCOMPARE(input, res); - } void tst_QBitArray::operator_andeq_data() @@ -331,33 +328,33 @@ void tst_QBitArray::operator_andeq_data() QTest::addColumn<QBitArray>("input2"); QTest::addColumn<QBitArray>("res"); - QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("00101100")); - QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("00001000")); - QTest::newRow( "data2" ) << QStringToQBitArray(QString("11011011111")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data2" ) << QStringToQBitArray(QString("11011011111")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("00001000000")); - QTest::newRow( "data3" ) << QStringToQBitArray(QString("11011011")) - << QStringToQBitArray(QString("00101100111")) + QTest::newRow( "data3" ) << QStringToQBitArray(QString("11011011")) + << QStringToQBitArray(QString("00101100111")) << QStringToQBitArray(QString("00001000000")); - QTest::newRow( "data4" ) << QStringToQBitArray(QString()) - << QStringToQBitArray(QString("00101100111")) + QTest::newRow( "data4" ) << QStringToQBitArray(QString()) + << QStringToQBitArray(QString("00101100111")) << QStringToQBitArray(QString("00000000000")); - QTest::newRow( "data5" ) << QStringToQBitArray(QString("00101100111")) - << QStringToQBitArray(QString()) + QTest::newRow( "data5" ) << QStringToQBitArray(QString("00101100111")) + << QStringToQBitArray(QString()) << QStringToQBitArray(QString("00000000000")); - QTest::newRow( "data6" ) << QStringToQBitArray(QString()) - << QStringToQBitArray(QString()) + QTest::newRow( "data6" ) << QStringToQBitArray(QString()) + << QStringToQBitArray(QString()) << QStringToQBitArray(QString()); } @@ -370,7 +367,6 @@ void tst_QBitArray::operator_andeq() input1&=input2; QCOMPARE(input1, res); - } void tst_QBitArray::operator_oreq_data() @@ -379,37 +375,37 @@ void tst_QBitArray::operator_oreq_data() QTest::addColumn<QBitArray>("input2"); QTest::addColumn<QBitArray>("res"); - QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("11111111")); - QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("11111111")); - QTest::newRow( "data2" ) << QStringToQBitArray(QString("01000010")) - << QStringToQBitArray(QString("10100001")) + QTest::newRow( "data2" ) << QStringToQBitArray(QString("01000010")) + << QStringToQBitArray(QString("10100001")) << QStringToQBitArray(QString("11100011")); - QTest::newRow( "data3" ) << QStringToQBitArray(QString("11011011")) - << QStringToQBitArray(QString("00101100000")) + QTest::newRow( "data3" ) << QStringToQBitArray(QString("11011011")) + << QStringToQBitArray(QString("00101100000")) << QStringToQBitArray(QString("11111111000")); - QTest::newRow( "data4" ) << QStringToQBitArray(QString("11011011111")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data4" ) << QStringToQBitArray(QString("11011011111")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("11111111111")); - QTest::newRow( "data5" ) << QStringToQBitArray(QString()) - << QStringToQBitArray(QString("00101100111")) + QTest::newRow( "data5" ) << QStringToQBitArray(QString()) + << QStringToQBitArray(QString("00101100111")) << QStringToQBitArray(QString("00101100111")); - QTest::newRow( "data6" ) << QStringToQBitArray(QString("00101100111")) - << QStringToQBitArray(QString()) + QTest::newRow( "data6" ) << QStringToQBitArray(QString("00101100111")) + << QStringToQBitArray(QString()) << QStringToQBitArray(QString("00101100111")); - - QTest::newRow( "data7" ) << QStringToQBitArray(QString()) - << QStringToQBitArray(QString()) + + QTest::newRow( "data7" ) << QStringToQBitArray(QString()) + << QStringToQBitArray(QString()) << QStringToQBitArray(QString()); } @@ -422,7 +418,6 @@ void tst_QBitArray::operator_oreq() input1|=input2; QCOMPARE(input1, res); - } void tst_QBitArray::operator_xoreq_data() @@ -430,36 +425,36 @@ void tst_QBitArray::operator_xoreq_data() QTest::addColumn<QBitArray>("input1"); QTest::addColumn<QBitArray>("input2"); QTest::addColumn<QBitArray>("res"); - QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("11010011")); - QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) + << QStringToQBitArray(QString("00101100")) << QStringToQBitArray(QString("11110111")); - QTest::newRow( "data2" ) << QStringToQBitArray(QString("01000010")) - << QStringToQBitArray(QString("10100001")) + QTest::newRow( "data2" ) << QStringToQBitArray(QString("01000010")) + << QStringToQBitArray(QString("10100001")) << QStringToQBitArray(QString("11100011")); - QTest::newRow( "data3" ) << QStringToQBitArray(QString("01000010")) - << QStringToQBitArray(QString("10100001101")) + QTest::newRow( "data3" ) << QStringToQBitArray(QString("01000010")) + << QStringToQBitArray(QString("10100001101")) << QStringToQBitArray(QString("11100011101")); - QTest::newRow( "data4" ) << QStringToQBitArray(QString("01000010111")) - << QStringToQBitArray(QString("101000011")) + QTest::newRow( "data4" ) << QStringToQBitArray(QString("01000010111")) + << QStringToQBitArray(QString("101000011")) << QStringToQBitArray(QString("11100011011")); - QTest::newRow( "data5" ) << QStringToQBitArray(QString()) - << QStringToQBitArray(QString("00101100111")) + QTest::newRow( "data5" ) << QStringToQBitArray(QString()) + << QStringToQBitArray(QString("00101100111")) << QStringToQBitArray(QString("00101100111")); - QTest::newRow( "data6" ) << QStringToQBitArray(QString("00101100111")) - << QStringToQBitArray(QString()) + QTest::newRow( "data6" ) << QStringToQBitArray(QString("00101100111")) + << QStringToQBitArray(QString()) << QStringToQBitArray(QString("00101100111")); - - QTest::newRow( "data7" ) << QStringToQBitArray(QString()) - << QStringToQBitArray(QString()) + + QTest::newRow( "data7" ) << QStringToQBitArray(QString()) + << QStringToQBitArray(QString()) << QStringToQBitArray(QString()); } @@ -472,7 +467,6 @@ void tst_QBitArray::operator_xoreq() input1^=input2; QCOMPARE(input1, res); - } @@ -481,37 +475,37 @@ void tst_QBitArray::operator_neg_data() QTest::addColumn<QBitArray>("input"); QTest::addColumn<QBitArray>("res"); - QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) + QTest::newRow( "data0" ) << QStringToQBitArray(QString("11111111")) << QStringToQBitArray(QString("00000000")); - QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) + QTest::newRow( "data1" ) << QStringToQBitArray(QString("11011011")) << QStringToQBitArray(QString("00100100")); - QTest::newRow( "data2" ) << QStringToQBitArray(QString("00000000")) + QTest::newRow( "data2" ) << QStringToQBitArray(QString("00000000")) << QStringToQBitArray(QString("11111111")); - QTest::newRow( "data3" ) << QStringToQBitArray(QString()) + QTest::newRow( "data3" ) << QStringToQBitArray(QString()) << QStringToQBitArray(QString()); - QTest::newRow( "data4" ) << QStringToQBitArray("1") + QTest::newRow( "data4" ) << QStringToQBitArray("1") << QStringToQBitArray("0"); - QTest::newRow( "data5" ) << QStringToQBitArray("0") + QTest::newRow( "data5" ) << QStringToQBitArray("0") << QStringToQBitArray("1"); - QTest::newRow( "data6" ) << QStringToQBitArray("01") + QTest::newRow( "data6" ) << QStringToQBitArray("01") << QStringToQBitArray("10"); - QTest::newRow( "data7" ) << QStringToQBitArray("1110101") + QTest::newRow( "data7" ) << QStringToQBitArray("1110101") << QStringToQBitArray("0001010"); - QTest::newRow( "data8" ) << QStringToQBitArray("01110101") + QTest::newRow( "data8" ) << QStringToQBitArray("01110101") << QStringToQBitArray("10001010"); - QTest::newRow( "data9" ) << QStringToQBitArray("011101010") + QTest::newRow( "data9" ) << QStringToQBitArray("011101010") << QStringToQBitArray("100010101"); - QTest::newRow( "data10" ) << QStringToQBitArray("0111010101111010") + QTest::newRow( "data10" ) << QStringToQBitArray("0111010101111010") << QStringToQBitArray("1000101010000101"); } @@ -521,9 +515,8 @@ void tst_QBitArray::operator_neg() QFETCH(QBitArray, res); input = ~input; - - QCOMPARE(input, res); + QCOMPARE(input, res); } void tst_QBitArray::datastream_data() @@ -554,7 +547,7 @@ void tst_QBitArray::datastream() QFETCH(QString, bitField); QFETCH(int, numBits); QFETCH(int, onBits); - + QBuffer buffer; QVERIFY(buffer.open(QBuffer::ReadWrite)); QDataStream stream(&buffer); @@ -566,11 +559,9 @@ void tst_QBitArray::datastream() } QCOMPARE(bits.count(), numBits); -#if QT_VERSION >= 0x040100 QCOMPARE(bits.count(true), onBits); QCOMPARE(bits.count(false), numBits - onBits); -#endif - + stream << bits << bits << bits; buffer.close(); @@ -583,10 +574,8 @@ void tst_QBitArray::datastream() stream2 >> array1 >> array2 >> array3; QCOMPARE(array1.count(), numBits); -#if QT_VERSION >= 0x040100 QCOMPARE(array1.count(true), onBits); QCOMPARE(array1.count(false), numBits - onBits); -#endif QCOMPARE(array1, bits); QCOMPARE(array2, bits); @@ -595,7 +584,7 @@ void tst_QBitArray::datastream() void tst_QBitArray::invertOnNull() const { - QBitArray a; + QBitArray a; QCOMPARE(a = ~a, QBitArray()); } @@ -605,28 +594,28 @@ void tst_QBitArray::operator_noteq_data() QTest::addColumn<QBitArray>("input2"); QTest::addColumn<bool>("res"); - QTest::newRow("data0") << QStringToQBitArray(QString("11111111")) - << QStringToQBitArray(QString("00101100")) + QTest::newRow("data0") << QStringToQBitArray(QString("11111111")) + << QStringToQBitArray(QString("00101100")) << true; - QTest::newRow("data1") << QStringToQBitArray(QString("11011011")) - << QStringToQBitArray(QString("11011011")) + QTest::newRow("data1") << QStringToQBitArray(QString("11011011")) + << QStringToQBitArray(QString("11011011")) << false; - QTest::newRow("data2") << QStringToQBitArray(QString()) - << QStringToQBitArray(QString("00101100111")) + QTest::newRow("data2") << QStringToQBitArray(QString()) + << QStringToQBitArray(QString("00101100111")) << true; - QTest::newRow("data3") << QStringToQBitArray(QString()) - << QStringToQBitArray(QString()) + QTest::newRow("data3") << QStringToQBitArray(QString()) + << QStringToQBitArray(QString()) << false; - QTest::newRow("data4") << QStringToQBitArray(QString("00101100")) - << QStringToQBitArray(QString("11111111")) + QTest::newRow("data4") << QStringToQBitArray(QString("00101100")) + << QStringToQBitArray(QString("11111111")) << true; - QTest::newRow("data5") << QStringToQBitArray(QString("00101100111")) - << QStringToQBitArray(QString()) + QTest::newRow("data5") << QStringToQBitArray(QString("00101100111")) + << QStringToQBitArray(QString()) << true; } diff --git a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp index c38fb66..15cca56 100644 --- a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp +++ b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp @@ -95,10 +95,7 @@ private slots: void checkedButton(); - // fixed for Qt 4.2.0 -#if QT_VERSION >= 0x040200 void task106609(); -#endif void task209485_removeFromGroupInEventHandler_data(); void task209485_removeFromGroupInEventHandler(); @@ -211,7 +208,6 @@ void tst_QButtonGroup::arrowKeyNavigation() void tst_QButtonGroup::exclusiveWithActions() { -#if QT_VERSION > 0x040100 QDialog dlg(0); QHBoxLayout layout(&dlg); QAction *action1 = new QAction("Action 1", &dlg); @@ -235,7 +231,7 @@ void tst_QButtonGroup::exclusiveWithActions() buttonGroup->addButton(toolButton2, 2); buttonGroup->addButton(toolButton3, 3); dlg.show(); - + QTest::mouseClick(toolButton1, Qt::LeftButton); QVERIFY(toolButton1->isChecked()); QVERIFY(action1->isChecked()); @@ -251,7 +247,7 @@ void tst_QButtonGroup::exclusiveWithActions() QVERIFY(!toolButton3->isChecked()); QVERIFY(!action1->isChecked()); QVERIFY(!action3->isChecked()); - + QTest::mouseClick(toolButton3, Qt::LeftButton); QVERIFY(toolButton3->isChecked()); QVERIFY(action3->isChecked()); @@ -259,7 +255,7 @@ void tst_QButtonGroup::exclusiveWithActions() QVERIFY(!toolButton2->isChecked()); QVERIFY(!action1->isChecked()); QVERIFY(!action2->isChecked()); - + QTest::mouseClick(toolButton2, Qt::LeftButton); QVERIFY(toolButton2->isChecked()); QVERIFY(action2->isChecked()); @@ -267,7 +263,6 @@ void tst_QButtonGroup::exclusiveWithActions() QVERIFY(!toolButton3->isChecked()); QVERIFY(!action1->isChecked()); QVERIFY(!action3->isChecked()); -#endif } void tst_QButtonGroup::exclusive() @@ -289,7 +284,7 @@ void tst_QButtonGroup::exclusive() buttonGroup->addButton(pushButton2, 2); buttonGroup->addButton(pushButton3, 3); dlg.show(); - + QTest::mouseClick(pushButton1, Qt::LeftButton); QVERIFY(pushButton1->isChecked()); QVERIFY(!pushButton2->isChecked()); @@ -299,12 +294,12 @@ void tst_QButtonGroup::exclusive() QVERIFY(pushButton2->isChecked()); QVERIFY(!pushButton1->isChecked()); QVERIFY(!pushButton3->isChecked()); - + QTest::mouseClick(pushButton3, Qt::LeftButton); QVERIFY(pushButton3->isChecked()); QVERIFY(!pushButton1->isChecked()); QVERIFY(!pushButton2->isChecked()); - + QTest::mouseClick(pushButton2, Qt::LeftButton); QVERIFY(pushButton2->isChecked()); QVERIFY(!pushButton1->isChecked()); @@ -363,7 +358,6 @@ void tst_QButtonGroup::testSignals() QVERIFY(releasedIdSpy.takeFirst().at(0).toInt() == 23); } -#if QT_VERSION >= 0x040200 void tst_QButtonGroup::task106609() { // task is: @@ -403,7 +397,6 @@ void tst_QButtonGroup::task106609() QCOMPARE(spy2.count(), 2); QCOMPARE(spy1.count(), 2); } -#endif void tst_QButtonGroup::checkedButton() { diff --git a/tests/auto/qcache/tst_qcache.cpp b/tests/auto/qcache/tst_qcache.cpp index f0d0454..2b61467 100644 --- a/tests/auto/qcache/tst_qcache.cpp +++ b/tests/auto/qcache/tst_qcache.cpp @@ -39,10 +39,8 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> - #include <qcache.h> //TESTED_CLASS= @@ -56,7 +54,6 @@ public: tst_QCache(); virtual ~tst_QCache(); - public slots: void initTestCase(); void cleanupTestCase(); @@ -344,7 +341,7 @@ void tst_QCache::remove() QCOMPARE(cache.totalCost(), 20); } - cache.setMaxCost(1); + cache.setMaxCost(1); QCOMPARE(cache.size(), 0); cache.remove("beta"); QCOMPARE(cache.size(), 0); @@ -377,7 +374,7 @@ void tst_QCache::take() QCOMPARE(cache.size(), 1); QCOMPARE(cache.totalCost(), 20); - cache.setMaxCost(1); + cache.setMaxCost(1); QCOMPARE(cache.size(), 0); QCOMPARE(cache.take("beta"), (Foo*)0); QCOMPARE(cache.size(), 0); @@ -389,15 +386,8 @@ struct KeyType KeyType(int x) : foo(x) {} - /* - Qt 4.0 and 4.1 require a default ctor and an operator=(). - */ -#if QT_VERSION < 0x040200 - KeyType() : foo(0) {} -#else private: KeyType &operator=(const KeyType &); -#endif }; struct ValueType diff --git a/tests/auto/qcheckbox/tst_qcheckbox.cpp b/tests/auto/qcheckbox/tst_qcheckbox.cpp index be1095a..9ffeb07 100644 --- a/tests/auto/qcheckbox/tst_qcheckbox.cpp +++ b/tests/auto/qcheckbox/tst_qcheckbox.cpp @@ -377,10 +377,8 @@ void tst_QCheckBox::onStateChanged( int state ) void tst_QCheckBox::stateChanged() { -#if QT_VERSION > 0x040101 QSignalSpy stateChangedSpy(testWidget, SIGNAL(stateChanged(int))); -#endif - connect(testWidget, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int))); + connect(testWidget, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int))); cur_state = -1; testWidget->setChecked( TRUE ); qApp->processEvents(); @@ -396,12 +394,10 @@ void tst_QCheckBox::stateChanged() qApp->processEvents(); QCOMPARE( cur_state, (int)1 ); -#if QT_VERSION > 0x040101 QCOMPARE(stateChangedSpy.count(), 3); testWidget->setCheckState(Qt::PartiallyChecked); qApp->processEvents(); QCOMPARE(stateChangedSpy.count(), 3); -#endif } void tst_QCheckBox::isToggleButton() diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 70059f2..6a87e3c 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -283,13 +283,9 @@ void tst_QComboBox::getSetCheck() QLineEdit *var8 = new QLineEdit(0); obj1.setLineEdit(var8); QCOMPARE(var8, obj1.lineEdit()); -#if QT_VERSION >= 0x040200 - // QComboBox in Qt < 4.2 have asserts for this, but handles the situation by ignoring it. - // Qt >= 4.2 should handle this gracefully (no asserts, but define behavior as keeping current) QTest::ignoreMessage(QtWarningMsg, "QComboBox::setLineEdit: cannot set a 0 line edit"); obj1.setLineEdit((QLineEdit *)0); QCOMPARE(var8, obj1.lineEdit()); -#endif // delete var8; // No delete, since QComboBox takes ownership // const QValidator * QComboBox::validator() @@ -306,13 +302,9 @@ void tst_QComboBox::getSetCheck() MyAbstractItemDelegate *var10 = new MyAbstractItemDelegate; obj1.setItemDelegate(var10); QCOMPARE(obj1.itemDelegate(), (QAbstractItemDelegate *)var10); -#if QT_VERSION >= 0x040200 - // QComboBox in Qt < 4.2 have asserts for this, but handles the situation by ignoring it. - // Qt >= 4.2 should handle this gracefully (no asserts, but define behavior as keeping current) QTest::ignoreMessage(QtWarningMsg, "QComboBox::setItemDelegate: cannot set a 0 delegate"); obj1.setItemDelegate((QAbstractItemDelegate *)0); QCOMPARE(obj1.itemDelegate(), (QAbstractItemDelegate *)var10); -#endif // delete var10; // No delete, since QComboBox takes ownership // QAbstractItemModel * QComboBox::model() @@ -320,13 +312,9 @@ void tst_QComboBox::getSetCheck() MyAbstractItemModel *var11 = new MyAbstractItemModel; obj1.setModel(var11); QCOMPARE(obj1.model(), (QAbstractItemModel *)var11); -#if QT_VERSION >= 0x040200 - // QComboBox in Qt < 4.2 have asserts for this, but handles the situation by ignoring it. - // Qt >= 4.2 should handle this gracefully (no asserts, but define behavior as keeping current) QTest::ignoreMessage(QtWarningMsg, "QComboBox::setModel: cannot set a 0 model"); obj1.setModel((QAbstractItemModel *)0); QCOMPARE(obj1.model(), (QAbstractItemModel *)var11); -#endif delete var11; obj1.model(); @@ -345,13 +333,9 @@ void tst_QComboBox::getSetCheck() MyAbstractItemView *var13 = new MyAbstractItemView; obj1.setView(var13); QCOMPARE(obj1.view(), (QAbstractItemView *)var13); -#if QT_VERSION >= 0x040200 - // QComboBox in Qt < 4.2 have asserts for this - // Qt >= 4.2 should handle this gracefully (no asserts, but define behavior as keeping current view) QTest::ignoreMessage(QtWarningMsg, "QComboBox::setView: cannot set a 0 view"); obj1.setView((QAbstractItemView *)0); QCOMPARE(obj1.view(), (QAbstractItemView *)var13); -#endif delete var13; // int QComboBox::currentIndex() @@ -512,13 +496,9 @@ void tst_QComboBox::sizeAdjustPolicy() testWidget->addItem("small"); QCOMPARE(testWidget->sizeHint(), content); testWidget->addItem("looooooooooooooooooooooong item"); -#if QT_VERSION >= 0x040200 // minimumContentsLength() > sizeof("looooooooooooooooooooooong item"), so the sizeHint() // stays the same QCOMPARE(testWidget->sizeHint(), content); -#else - QVERIFY(testWidget->sizeHint().width() > content.width()); -#endif // over 60 characters (cf. setMinimumContentsLength() call above) testWidget->addItem("loooooooooooooooooooooooooooooooooooooooooooooo" "ooooooooooooooooooooooooooooooooooooooooooooooo" @@ -535,10 +515,8 @@ void tst_QComboBox::sizeAdjustPolicy() content = testWidget->sizeHint(); while (testWidget->count()) testWidget->removeItem(0); -#if QT_VERSION >= 0x040200 QCOMPARE(testWidget->sizeHint(), content); testWidget->setMinimumContentsLength(0); -#endif QVERIFY(testWidget->sizeHint().width() < content.width()); } @@ -831,13 +809,9 @@ void tst_QComboBox::autoCompletionCaseSensitivity() QTest::keyClick(testWidget->lineEdit(), Qt::Key_B); qApp->processEvents(); -#if QT_VERSION < 0x040200 - // autocompletions are case-preserving in < 4.2 - QCOMPARE(testWidget->currentText(), QString("aBCDEF")); -#else // autocompletions preserve userkey-case from 4.2 QCOMPARE(testWidget->currentText(), QString("abCDEF")); -#endif + QTest::keyClick(testWidget->lineEdit(), Qt::Key_Enter); qApp->processEvents(); QCOMPARE(testWidget->currentText(), QString("aBCDEF")); // case restored to item's case diff --git a/tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp index 5665e6e..45a4301 100644 --- a/tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp +++ b/tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp @@ -211,11 +211,7 @@ void tst_QCommandLinkButton::setAutoRepeat() QVERIFY( !testWidget->isCheckable() ); // verify autorepeat is off by default. -#if QT_VERSION < 0x040000 - QButton tmp( 0 ); -#else QCommandLinkButton tmp( 0 ); -#endif tmp.setObjectName("tmp"); QVERIFY( !tmp.autoRepeat() ); diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index 9a984c8..ab6bad6 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -44,7 +44,6 @@ //TESTED_CLASS=QCss //TESTED_FILES=gui/text/qcssparser.cpp gui/text/qcssparser_p.h -#if QT_VERSION >= 0x040200 #include "private/qcssparser_p.h" class tst_CssParser : public QObject @@ -1592,13 +1591,13 @@ void tst_CssParser::quotedAndUnquotedIdentifiers() QCss::Parser parser("foo { font-style: \"italic\"; font-weight: bold }"); QCss::StyleSheet sheet; QVERIFY(parser.parse(&sheet)); - + QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count(), 1); QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) : *sheet.nameIndex.begin(); const QVector<QCss::Declaration> decls = rule.declarations; QCOMPARE(decls.size(), 2); - + QCOMPARE(decls.at(0).d->values.first().type, QCss::Value::String); QCOMPARE(decls.at(0).d->property, QLatin1String("font-style")); QCOMPARE(decls.at(0).d->values.first().toString(), QLatin1String("italic")); @@ -1610,6 +1609,3 @@ void tst_CssParser::quotedAndUnquotedIdentifiers() QTEST_MAIN(tst_CssParser) #include "tst_cssparser.moc" -#else -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp index a112c10..d7ca7bc 100644 --- a/tests/auto/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/qdatastream/tst_qdatastream.cpp @@ -163,10 +163,8 @@ private slots: void setVersion_data(); void setVersion(); -#if QT_VERSION >= 0x040100 void skipRawData_data(); void skipRawData(); -#endif void status_qint8_data(); void status_qint8(); @@ -2435,7 +2433,6 @@ private: int offset; }; -#if QT_VERSION >= 0x040100 void tst_QDataStream::skipRawData_data() { QTest::addColumn<QString>("deviceType"); @@ -2486,7 +2483,6 @@ void tst_QDataStream::skipRawData() delete dev; } -#endif #define TEST_qint(T, UT) \ void tst_QDataStream::status_##T() \ diff --git a/tests/auto/qdate/tst_qdate.cpp b/tests/auto/qdate/tst_qdate.cpp index 121167a..d4273d0 100644 --- a/tests/auto/qdate/tst_qdate.cpp +++ b/tests/auto/qdate/tst_qdate.cpp @@ -143,10 +143,8 @@ void tst_QDate::isValid_data() QTest::newRow("century leap") << 2100 << 2 << 29 << 0U << false; QTest::newRow("400-years leap") << 2000 << 2 << 29 << 2451604U << true; QTest::newRow("400-years leap 2") << 2400 << 2 << 29 << 2597701U << true; -#if QT_VERSION >= 0x040200 QTest::newRow("400-years leap 3") << 1600 << 2 << 29 << 2305507U << true; QTest::newRow("year 0") << 0 << 2 << 27 << 0U << false; -#endif // test the number of days in months: QTest::newRow("jan") << 2000 << 1 << 31 << 2451575U << true; @@ -177,7 +175,6 @@ void tst_QDate::isValid_data() QTest::newRow("idec") << 2000 << 12 << 32 << 0U << false; // the beginning of the Julian Day calendar: -#if QT_VERSION >= 0x040200 QTest::newRow("jd negative1") << -4714 << 1 << 1 << 0U << false; QTest::newRow("jd negative2") << -4713 << 1 << 1 << 0U << false; QTest::newRow("jd negative3") << -4713 << 1 << 2 << 1U << true; @@ -185,7 +182,6 @@ void tst_QDate::isValid_data() QTest::newRow("jd 0") << -4713 << 1 << 1 << 0U << false; QTest::newRow("jd 1") << -4713 << 1 << 2 << 1U << true; QTest::newRow("imminent overflow") << 11754508 << 12 << 13 << 4294967295U << true; -#endif } void tst_QDate::isValid() @@ -243,17 +239,12 @@ void tst_QDate::weekNumber_data() QTest::newRow( "data4" ) << 1 << 2001 << 2001 << 1 << 1; QTest::newRow( "data5" ) << 53 << 1998 << 1998 << 12 << 31; QTest::newRow( "data6" ) << 1 << 1985 << 1984 << 12 << 31; -#if QT_VERSION >= 0x030300 - // This is a bug that was fixed for 3.3 QTest::newRow( "data7" ) << 52 << 2006 << 2006 << 12 << 31; -#endif } void tst_QDate::weekNumber() { -#if QT_VERSION >= 0x030100 int yearNumber; -// int weekNumber; QFETCH( int, year ); QFETCH( int, month ); QFETCH( int, day ); @@ -262,9 +253,6 @@ void tst_QDate::weekNumber() QDate dt1( year, month, day ); QCOMPARE( dt1.weekNumber( &yearNumber ), expectedWeekNum ); QCOMPARE( yearNumber, expectedYearNum ); -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -#endif } void tst_QDate::weekNumber_invalid_data() @@ -281,14 +269,9 @@ void tst_QDate::weekNumber_invalid_data() void tst_QDate::weekNumber_invalid() { -#if QT_VERSION >= 0x030100 QDate dt; int yearNumber; -// int weekNumber; QCOMPARE( dt.weekNumber( &yearNumber ), 0 ); -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -#endif } void tst_QDate::addDays() @@ -616,14 +599,12 @@ void tst_QDate::fromString_data() QDate d( 1999, 11, 14 ); QTest::newRow( "data2" ) << d.toString( Qt::TextDate ) << d.toString( Qt::ISODate ) << d; -#if QT_VERSION >= 0x040200 QTest::newRow( "data3" ) << QString("xxx Jan 1 0999") << QString("0999-01-01") << QDate(999, 1, 1); QTest::newRow( "data3b" ) << QString("xxx Jan 1 999") << QString("0999-01-01") << QDate(999, 1, 1); QTest::newRow( "data4" ) << QString("xxx Jan 1 12345") << QString() << QDate(12345, 1, 1); QTest::newRow( "data5" ) << QString("xxx Jan 1 -0001") << QString() << QDate(-1, 1, 1); QTest::newRow( "data6" ) << QString("xxx Jan 1 -4712") << QString() << QDate(-4712, 1, 1); QTest::newRow( "data7" ) << QString("xxx Nov 25 -4713") << QString() << QDate(-4713, 11, 25); -#endif } void tst_QDate::fromString() @@ -647,9 +628,7 @@ void tst_QDate::toString_format_data() QTest::newRow( "data1" ) << QDate(2002,12,17) << QString("dd-MM-yyyy") << QString("17-12-2002"); QTest::newRow( "data2" ) << QDate(1995,5,20) << QString("M-yy") << QString("5-95"); QTest::newRow( "data3" ) << QDate(2002,12,17) << QString("dd") << QString("17"); -#if (QT_VERSION-0 >= 0x030200) QTest::newRow( "data4" ) << QDate() << QString("dd-mm-yyyy") << QString(); -#endif } void tst_QDate::toString_format() diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index 9e73d6d..69d8a62 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -220,18 +220,10 @@ void tst_QDateTime::isNull() dt1.setDate(QDate(2004, 1, 2)); QVERIFY(!dt1.isNull()); -#if QT_VERSION < 0x040100 - dt1.setDate(QDate()); - QVERIFY(dt1.isNull()); -#endif dt1.setTime(QTime(12, 34, 56)); QVERIFY(!dt1.isNull()); dt1.setTime(QTime()); -#if QT_VERSION >= 0x040100 QVERIFY(!dt1.isNull()); -#else - QVERIFY(dt1.isNull()); -#endif } void tst_QDateTime::isValid() @@ -1010,15 +1002,10 @@ void tst_QDateTime::toString_strformat_data() void tst_QDateTime::toString_strformat() { -#if (QT_VERSION-0 >= 0x030200) QFETCH( QDateTime, dt ); QFETCH( QString, format ); QFETCH( QString, str ); QCOMPARE( dt.toString( format ), str ); -#else - QSKIP( "No test implemented for < 3.2 yet", SkipAll); -#endif - } void tst_QDateTime::fromStringTextDate_data() @@ -1068,7 +1055,6 @@ void tst_QDateTime::fromStringTextDate_data() << 28 << 6 << 2005 << 7 << 57 << 30 << 110 << int(Qt::LocalTime); -#if QT_VERSION >= 0x040200 QTest::newRow("Year 0999") << QString("Tue Jun 17 08:00:10 0999") << int(Qt::TextDate) << 17 << 6 << 999 << 8 << 0 << 10 << 0 @@ -1088,7 +1074,6 @@ void tst_QDateTime::fromStringTextDate_data() << int(Qt::TextDate) << 1 << 1 << -4712 << 0 << 01 << 02 << 0 << int(Qt::LocalTime); -#endif } void tst_QDateTime::fromStringTextDate() diff --git a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp index 49f8922..81b35ac 100644 --- a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp +++ b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp @@ -41,9 +41,6 @@ #include <QtTest/QtTest> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else #include <QStandardItemModel> #include <qdebug.h> #include <qdesktopservices.h> @@ -172,5 +169,3 @@ void tst_qdesktopservices::storageLocationDoesNotEndWithSlash() QTEST_MAIN(tst_qdesktopservices) #include "tst_qdesktopservices.moc" -#endif - diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp index e77167e..a1cf1c1 100644 --- a/tests/auto/qdialog/tst_qdialog.cpp +++ b/tests/auto/qdialog/tst_qdialog.cpp @@ -375,14 +375,11 @@ void tst_QDialog::showAsTool() testWidget->activateWindow(); dialog.exec(); QTest::qWait(100); - if (testWidget->style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, testWidget)) { -#if defined(Q_WS_QWS) && QT_VERSION < 0x040400 - QEXPECT_FAIL(0, "Qtopia Core has messed up WStyle_Tool (task 126435)", Continue); -#endif - QCOMPARE(dialog.wasActive(), true); - } else { - QCOMPARE(dialog.wasActive(), false); - } + if (testWidget->style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, testWidget)) { + QCOMPARE(dialog.wasActive(), true); + } else { + QCOMPARE(dialog.wasActive(), false); + } } // Verify that pos() returns the same before and after show() @@ -392,10 +389,10 @@ void tst_QDialog::toolDialogPosition() #if defined(Q_OS_WINCE) QSKIP("No real support for Qt::Tool on WinCE", SkipAll); #endif - QDialog dialog(0, Qt::Tool); - dialog.move(QPoint(100,100)); + QDialog dialog(0, Qt::Tool); + dialog.move(QPoint(100,100)); const QPoint beforeShowPosition = dialog.pos(); - dialog.show(); + dialog.show(); const QPoint afterShowPosition = dialog.pos(); QCOMPARE(afterShowPosition, beforeShowPosition); } @@ -445,7 +442,7 @@ public slots: void tst_QDialog::throwInExec() { #ifdef Q_WS_MAC - QSKIP("Qt/Mac: Throwing exceptions in excec() is not supported.", SkipAll); + QSKIP("Qt/Mac: Throwing exceptions in exec() is not supported.", SkipAll); #endif int caughtExceptions = 0; try { diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index f680f46..91ce5b3 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -787,9 +787,7 @@ void tst_QDir::cd_data() #endif QTest::newRow("non existant") << "." << "../anonexistingdir" << false << QDir::currentPath(); QTest::newRow("self") << "." << (QString("../") + QFileInfo(QDir::currentPath()).fileName()) << true << QDir::currentPath(); -#if QT_VERSION > 0x040100 QTest::newRow("file") << "." << "qdir.pro" << false << ""; -#endif } void tst_QDir::cd() @@ -827,10 +825,8 @@ void tst_QDir::setNameFilters_data() << QString("foo. bar,foo.bar").split(","); QTest::newRow("files1") << appPath + "testdir/dir" << QString("*r.cpp *.pro").split(" ") << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(","); -#if QT_VERSION >= 0x040000 QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") << QString("file1.data,file2.data,file3.data").split(','); -#endif } void tst_QDir::setNameFilters() diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp index f6887da..2084535 100644 --- a/tests/auto/qdirmodel/tst_qdirmodel.cpp +++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp @@ -614,7 +614,6 @@ void tst_QDirModel::task196768_sorting() QCOMPARE(index.data(), index2.data()); } -#if QT_VERSION >= 0x040102 void tst_QDirModel::filter() { QDirModel model; @@ -625,7 +624,6 @@ void tst_QDirModel::filter() Q_ASSERT(!index2.isValid()); Q_ASSERT(model.rowCount(index) == 0); } -#endif void tst_QDirModel::task244669_remove() { diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp index 829e0b3..98e1859 100644 --- a/tests/auto/qfile/tst_qfile.cpp +++ b/tests/auto/qfile/tst_qfile.cpp @@ -76,10 +76,6 @@ #include "../network-settings.h" -#if QT_VERSION < 0x040200 -#define symLinkTarget readLink -#endif - Q_DECLARE_METATYPE(QFile::FileError) //TESTED_CLASS= @@ -990,12 +986,8 @@ void tst_QFile::link() #ifdef Q_OS_WIN // on windows links are always absolute QCOMPARE(info2.symLinkTarget(), info1.absoluteFilePath()); #else -#if QT_VERSION < 0x040101 - QCOMPARE(info2.symLinkTarget(), info1.filePath()); -#else QCOMPARE(info2.symLinkTarget(), info1.absoluteFilePath()); #endif -#endif #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) QString wd = getWorkingDirectoryForLink(info2.absoluteFilePath()); @@ -1061,19 +1053,12 @@ void tst_QFile::readBrokenLink() #ifdef Q_OS_WIN // on windows links are alway absolute QCOMPARE(info2.symLinkTarget(), info1.absoluteFilePath()); #else -#if QT_VERSION < 0x040101 - QCOMPARE(info2.symLinkTarget(), info1.filePath()); -#else QCOMPARE(info2.symLinkTarget(), info1.absoluteFilePath()); #endif -#endif QVERIFY(QFile::remove(info2.absoluteFilePath())); - -#if QT_VERSION >= 0x040101 QVERIFY(QFile::link("ole/..", "myLink2.lnk")); QCOMPARE(QFileInfo("myLink2.lnk").symLinkTarget(), QDir::currentPath()); -#endif } void tst_QFile::readTextFile_data() @@ -1281,10 +1266,6 @@ void tst_QFile::bufferedRead() QCOMPARE(file.pos(), qlonglong(2)); } -#if QT_VERSION <= 0x040100 - QCOMPARE(int(ftell(stdFile)), 2); -#endif - fclose(stdFile); } @@ -1604,12 +1585,7 @@ void tst_QFile::longFileName() } { QFile file(fileName); -#if QT_VERSION < 0x040100 -# ifdef Q_OS_WIN - QEXPECT_FAIL("244 chars", "Fixed in 4.1", Continue); - QEXPECT_FAIL("244 chars to absolutepath", "Fixed in 4.1", Continue); -# endif -#elif defined(Q_WS_WIN) +#if defined(Q_WS_WIN) #if !defined(Q_OS_WINCE) QT_WA({ if (false) ; }, { QEXPECT_FAIL("244 chars", "Full pathname must be less than 260 chars", Abort); @@ -1834,10 +1810,6 @@ void tst_QFile::removeOpenFile() void tst_QFile::fullDisk() { -#if QT_VERSION < 0x040102 - QSKIP("Fixed for 4.1.2", SkipAll); -#endif - QFile file("/dev/full"); if (!file.exists()) QSKIP("/dev/full doesn't exist on this system", SkipAll); @@ -1981,9 +1953,7 @@ void tst_QFile::virtualFile() // read all: data = f.readAll(); QVERIFY(f.pos() != 0); -#if QT_VERSION >= 0x040200 QVERIFY(!data.isEmpty()); -#endif // seeking QVERIFY(f.seek(1)); diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 87f9ba3..334acce 100644 --- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -42,10 +42,6 @@ #include <QCoreApplication> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <QFileSystemWatcher> #ifdef Q_OS_LINUX @@ -403,5 +399,3 @@ void tst_QFileSystemWatcher::removePaths() QTEST_MAIN(tst_QFileSystemWatcher) #include "tst_qfilesystemwatcher.moc" - -#endif diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp index 58e837e..e3a5ffc 100644 --- a/tests/auto/qfont/tst_qfont.cpp +++ b/tests/auto/qfont/tst_qfont.cpp @@ -537,9 +537,6 @@ void tst_QFont::insertAndRemoveSubstitutions() QStringList moreFonts; moreFonts << "Bar" << "Baz"; QFont::insertSubstitutions("BogusFontFamily", moreFonts); -#if (QT_VERSION <= 0x040102) - QEXPECT_FAIL("", "Uppercase/Lowercase issues fixed in 4.1.3 and beyond", Abort); -#endif QCOMPARE(QFont::substitutes("BogusFontFamily").count(), 3); QCOMPARE(QFont::substitutes("bogusfontfamily").count(), 3); diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp index 28f490a..9c42b49 100644 --- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp @@ -149,9 +149,7 @@ void tst_QFontDatabase::fixedPitch() if (!fdb.families().contains(font)) QSKIP( "Font not installed", SkipSingle); -#if QT_VERSION >= 0x030200 QCOMPARE(fdb.isFixedPitch(font), fixedPitch); -#endif QFont qfont(font); QFontInfo fi(qfont); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 09b209d..e501bc4 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -42,10 +42,6 @@ #include <QtTest/QtTest> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <private/qtextcontrol_p.h> #include <private/qgraphicsitem_p.h> #include <QAbstractTextDocumentLayout> @@ -6066,4 +6062,3 @@ void tst_QGraphicsItem::cacheMode() QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" -#endif diff --git a/tests/auto/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp b/tests/auto/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp index d43d0ae..6d20716 100644 --- a/tests/auto/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp +++ b/tests/auto/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp @@ -42,12 +42,7 @@ #include <QtTest/QtTest> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <qgraphicsitemanimation.h> - #include <QtCore/qtimeline.h> #include <QtGui/qmatrix.h> @@ -195,4 +190,3 @@ void tst_QGraphicsItemAnimation::setTimeLine() QTEST_MAIN(tst_QGraphicsItemAnimation) #include "tst_qgraphicsitemanimation.moc" -#endif diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 354d81a..da99c30 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -45,10 +45,6 @@ #include <ceconfig.h> #endif -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <QtGui> #include <math.h> @@ -3589,4 +3585,3 @@ void tst_QGraphicsScene::stickyFocus() QTEST_MAIN(tst_QGraphicsScene) #include "tst_qgraphicsscene.moc" -#endif diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 6b3a9d4..9368630 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -42,10 +42,6 @@ #include <QtTest/QtTest> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <qgraphicsitem.h> #include <qgraphicsscene.h> #include <qgraphicssceneevent.h> @@ -3149,4 +3145,3 @@ void tst_QGraphicsView::mouseTracking() QTEST_MAIN(tst_QGraphicsView) #include "tst_qgraphicsview.moc" -#endif diff --git a/tests/auto/qhash/tst_qhash.cpp b/tests/auto/qhash/tst_qhash.cpp index 9343504..f300eec 100644 --- a/tests/auto/qhash/tst_qhash.cpp +++ b/tests/auto/qhash/tst_qhash.cpp @@ -39,16 +39,10 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> - -#if QT_VERSION >= 0x040000 #include <qhash.h> #include <qmap.h> -#endif - - //TESTED_CLASS= //TESTED_FILES= @@ -65,7 +59,7 @@ private slots: void insert1(); void erase(); void key(); - + void count(); // copied from tst_QMap void clear(); // copied from tst_QMap void empty(); // copied from tst_QMap @@ -80,9 +74,7 @@ private slots: void qmultihash_specific(); void compare(); -#if QT_VERSION > 0x040100 void compare2(); -#endif // QT_VERSION void iterators(); // sligthly modified from tst_QMap void keys_values_uniqueKeys(); // slightly modified from tst_QMap void noNeedlessRehashes(); @@ -799,7 +791,6 @@ void tst_QHash::compare() QVERIFY(hash1 != hash2); } -#if QT_VERSION > 0x040100 void tst_QHash::compare2() { QHash<int, int> a; @@ -838,7 +829,6 @@ void tst_QHash::compare2() QVERIFY(!(a == b)); QVERIFY(!(b == a)); } -#endif // QT_VERSION //sligthly modified from tst_QMap void tst_QHash::iterators() @@ -996,9 +986,6 @@ void tst_QHash::rehash_isnt_quadratic() class Bar { public: -#if QT_VERSION < 0x040100 - Bar() : j(0) {} -#endif Bar(int i) : j(i) {} int j; @@ -1180,37 +1167,27 @@ QList<T> sorted(const QList<T> &list) void tst_QHash::keys_values_uniqueKeys() { QHash<QString, int> hash; -#if QT_VERSION >= 0x040200 QVERIFY(hash.uniqueKeys().isEmpty()); -#endif QVERIFY(hash.keys().isEmpty()); QVERIFY(hash.values().isEmpty()); hash.insertMulti("alpha", 1); QVERIFY(sorted(hash.keys()) == (QList<QString>() << "alpha")); -#if QT_VERSION >= 0x040200 QVERIFY(hash.keys() == hash.uniqueKeys()); -#endif QVERIFY(hash.values() == (QList<int>() << 1)); hash.insertMulti("beta", -2); QVERIFY(sorted(hash.keys()) == (QList<QString>() << "alpha" << "beta")); -#if QT_VERSION >= 0x040200 QVERIFY(hash.keys() == hash.uniqueKeys()); -#endif QVERIFY(sorted(hash.values()) == sorted(QList<int>() << 1 << -2)); hash.insertMulti("alpha", 2); -#if QT_VERSION >= 0x040200 QVERIFY(sorted(hash.uniqueKeys()) == (QList<QString>() << "alpha" << "beta")); -#endif QVERIFY(sorted(hash.keys()) == (QList<QString>() << "alpha" << "alpha" << "beta")); QVERIFY(sorted(hash.values()) == sorted(QList<int>() << 2 << 1 << -2)); hash.insertMulti("beta", 4); -#if QT_VERSION >= 0x040200 QVERIFY(sorted(hash.uniqueKeys()) == (QList<QString>() << "alpha" << "beta")); -#endif QVERIFY(sorted(hash.keys()) == (QList<QString>() << "alpha" << "alpha" << "beta" << "beta")); QVERIFY(sorted(hash.values()) == sorted(QList<int>() << 2 << 1 << 4 << -2)); } diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp index e4a798e..46bd8cd 100644 --- a/tests/auto/qhttp/tst_qhttp.cpp +++ b/tests/auto/qhttp/tst_qhttp.cpp @@ -253,11 +253,9 @@ void tst_QHttp::constructing() } -#if QT_VERSION >= 0x040102 { QHttpResponseHeader header(200); } -#endif } void tst_QHttp::invalidRequests() diff --git a/tests/auto/qicoimageformat/tst_qticoimageformat.cpp b/tests/auto/qicoimageformat/tst_qticoimageformat.cpp index 9fca6df..7d7f4ac 100644 --- a/tests/auto/qicoimageformat/tst_qticoimageformat.cpp +++ b/tests/auto/qicoimageformat/tst_qticoimageformat.cpp @@ -264,42 +264,35 @@ void tst_QtIcoImageFormat::nextImageDelay_data() { QTest::addColumn<QString>("fileName"); QTest::addColumn<int>("count"); - QTest::addColumn<int>("delay"); - - QTest::newRow("floppy (16px,32px - 16 colors)") << "valid/35FLOPPY.ICO" << 2 << 0; - QTest::newRow("16px,32px,48px - 256,16M colors") << "valid/abcardWindow.ico" << 6 << 0; - QTest::newRow("16px - 16 colors") << "valid/App.ico" << 1 << 0; - QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9 << 0; - QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3 << 0; - QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2 << 0; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3 << 0; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3 << 0; - QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << -1 << -1; - QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9 << 0; + + QTest::newRow("floppy (16px,32px - 16 colors)") << "valid/35FLOPPY.ICO" << 2; + QTest::newRow("16px,32px,48px - 256,16M colors") << "valid/abcardWindow.ico" << 6; + QTest::newRow("16px - 16 colors") << "valid/App.ico" << 1; + QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9; + QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3; + QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2; + QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3; + QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << -1; + QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9; } void tst_QtIcoImageFormat::nextImageDelay() { QFETCH(QString, fileName); QFETCH(int, count); - QFETCH(int, delay); - -#if QT_VERSION > 0x040001 - delay = 0; -#endif QImageReader reader(m_IconPath + "/" + fileName); if (count == -1) { - QCOMPARE(reader.nextImageDelay(), delay); - + QCOMPARE(reader.nextImageDelay(), 0); } else { int i; for (i = 0; i < count; i++) { - QVERIFY(reader.jumpToImage(i)); - QCOMPARE(reader.nextImageDelay(), delay); + QCOMPARE(reader.nextImageDelay(), 0); } } } + QTEST_MAIN(tst_QtIcoImageFormat) #include "tst_qticoimageformat.moc" diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index 7e515a5..4e9a880 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -186,10 +186,8 @@ void tst_QIcon::actualSize2() QFETCH(QSize, argument); QFETCH(QSize, result); -#if QT_VERSION >= 0x040200 QCOMPARE(icon.actualSize(argument), result); QCOMPARE(icon.pixmap(argument).size(), result); -#endif } void tst_QIcon::svgActualSize() diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index 132e373..ee4ece2 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -95,9 +95,8 @@ private slots: void rotate_data(); void rotate(); -#if QT_VERSION >= 0x040102 void copy(); -#endif + void setPixel_data(); void setPixel(); @@ -974,7 +973,6 @@ void tst_QImage::rotate() QCOMPARE(original, dest); } -#if QT_VERSION >= 0x040102 void tst_QImage::copy() { // Task 99250 @@ -983,7 +981,6 @@ void tst_QImage::copy() img.copy(QRect(1000,1,1,1)); } } -#endif void tst_QImage::setPixel_data() { diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index e256227..3841111 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -128,30 +128,22 @@ private slots: void physicalDpi_data(); void physicalDpi(); -#if QT_VERSION > 0x040100 void sizeBeforeRead_data(); void sizeBeforeRead(); -#endif -#if QT_VERSION > 0x040400 void imageFormatBeforeRead_data(); void imageFormatBeforeRead(); -#endif #if defined QTEST_HAVE_GIF void gifHandlerBugs(); #endif -#if QT_VERSION >= 0x040200 void readCorruptImage_data(); void readCorruptImage(); -#endif void readCorruptBmp(); -#if QT_VERSION >= 0x040200 void supportsOption_data(); void supportsOption(); -#endif #if defined QTEST_HAVE_TIFF void tiffCompression_data(); @@ -210,9 +202,7 @@ void tst_QImageReader::readImage_data() QTest::newRow("BMP: 4bpp RLE") << QString("4bpp-rle.bmp") << true << QByteArray("bmp"); QTest::newRow("BMP: 4bpp uncompressed") << QString("tst7.bmp") << true << QByteArray("bmp"); QTest::newRow("BMP: 16bpp") << QString("16bpp.bmp") << true << QByteArray("bmp"); -#if QT_VERSION >= 0x040200 QTest::newRow("BMP: negative height") << QString("negativeheight.bmp") << true << QByteArray("bmp"); -#endif QTest::newRow("XPM: marble") << QString("marble.xpm") << true << QByteArray("xpm"); QTest::newRow("PNG: kollada") << QString("kollada.png") << true << QByteArray("png"); QTest::newRow("PPM: teapot") << QString("teapot.ppm") << true << QByteArray("ppm"); @@ -604,7 +594,6 @@ void tst_QImageReader::supportsAnimation() QCOMPARE(io.supportsAnimation(), success); } -#if QT_VERSION > 0x040100 void tst_QImageReader::sizeBeforeRead_data() { imageFormat_data(); @@ -627,9 +616,7 @@ void tst_QImageReader::sizeBeforeRead() QVERIFY(!image.isNull()); QCOMPARE(size, image.size()); } -#endif // QT_VERSION -#if QT_VERSION > 0x040400 void tst_QImageReader::imageFormatBeforeRead_data() { imageFormat_data(); @@ -649,7 +636,6 @@ void tst_QImageReader::imageFormatBeforeRead() QCOMPARE(image.format(), fileFormat); } } -#endif #if defined QTEST_HAVE_GIF void tst_QImageReader::gifHandlerBugs() @@ -662,7 +648,6 @@ void tst_QImageReader::gifHandlerBugs() QVERIFY(count == 34); } -#if QT_VERSION >= 0x040102 // Task 95166 { QImageReader io1("images/bat1.gif"); @@ -675,9 +660,7 @@ void tst_QImageReader::gifHandlerBugs() QVERIFY(!im2.isNull()); QCOMPARE(im1, im2); } -#endif -#if QT_VERSION >= 0x040104 // Task 9994 { QImageReader io1("images/noclearcode.gif"); @@ -687,7 +670,6 @@ void tst_QImageReader::gifHandlerBugs() QVERIFY(!im1.isNull()); QVERIFY(!im2.isNull()); QCOMPARE(im1.convertToFormat(QImage::Format_ARGB32), im2.convertToFormat(QImage::Format_ARGB32)); } -#endif } #endif @@ -872,11 +854,7 @@ void tst_QImageReader::readFromFileAfterJunk() QVERIFY(!imageData.isNull()); int iterations = 10; -#if QT_VERSION < 0x040200 - if (format == "ppm" || format == "pbm" || format == "pgm" || format == "xpm" || format == "jpeg") -#else if (format == "ppm" || format == "pbm" || format == "pgm") -#endif iterations = 1; if (format == "mng" || !QImageWriter::supportedImageFormats().contains(format)) { @@ -1175,7 +1153,6 @@ void tst_QImageReader::readFromResources() QCOMPARE(QImageReader(fileName).read(), QImageReader(":/" + fileName).read()); } -#if QT_VERSION >= 0x040200 void tst_QImageReader::readCorruptImage_data() { QTest::addColumn<QString>("fileName"); @@ -1203,6 +1180,7 @@ void tst_QImageReader::readCorruptImage_data() QTest::newRow("corrupt tiff") << QString("images/corrupt-data.tif") << true << QString(""); #endif } + void tst_QImageReader::readCorruptImage() { QFETCH(QString, fileName); @@ -1214,14 +1192,12 @@ void tst_QImageReader::readCorruptImage() QVERIFY(reader.canRead()); QCOMPARE(reader.read().isNull(), shouldFail); } -#endif // QT_VERSION void tst_QImageReader::readCorruptBmp() { QCOMPARE(QImage("images/tst7.bmp").convertToFormat(QImage::Format_ARGB32_Premultiplied), QImage("images/tst7.png").convertToFormat(QImage::Format_ARGB32_Premultiplied)); } -#if QT_VERSION >= 0x040200 void tst_QImageReader::supportsOption_data() { QTest::addColumn<QString>("fileName"); @@ -1264,7 +1240,6 @@ void tst_QImageReader::supportsOption() foreach (QImageIOHandler::ImageOption option, allOptions) QVERIFY(!reader.supportsOption(option)); } -#endif #if defined QTEST_HAVE_TIFF void tst_QImageReader::tiffCompression_data() diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp index 6a8ff73..03a0665 100644 --- a/tests/auto/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/qiodevice/tst_qiodevice.cpp @@ -67,9 +67,7 @@ private slots: void constructing_QFile(); void read_QByteArray(); void unget(); -#if QT_VERSION >= 0x040100 void peek(); -#endif // QT_VERSION void getch(); void putch(); @@ -310,7 +308,6 @@ void tst_QIODevice::unget() } //-------------------------------------------------------------------- -#if QT_VERSION >= 0x040100 void tst_QIODevice::peek() { QBuffer buffer; @@ -348,7 +345,6 @@ void tst_QIODevice::peek() } QFile::remove("peektestfile"); } -#endif // QT_VERSION void tst_QIODevice::getch() { @@ -441,7 +437,6 @@ void tst_QIODevice::readLine() result = buffer.readLine(line.data(), linelen + 1); QCOMPARE(result, linelen); -#if QT_VERSION >= 0x0402000 // try with a line length limit QVERIFY(buffer.seek(0)); line = buffer.readLine(linelen + 100); @@ -451,7 +446,6 @@ void tst_QIODevice::readLine() QVERIFY(buffer.seek(0)); line = buffer.readLine(); QCOMPARE(line.size(), linelen); -#endif } QTEST_MAIN(tst_QIODevice) diff --git a/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp b/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp index c12c583..aa6939d 100644 --- a/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp +++ b/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp @@ -61,9 +61,6 @@ void tst_QItemEditorFactory::createEditor() void tst_QItemEditorFactory::createCustomEditor() { -#if QT_VERSION < 0x040200 - QSKIP("Needs Qt >= 4.2", SkipAll); -#else QItemEditorFactory editorFactory; QItemEditorCreatorBase *creator = new QStandardItemEditorCreator<QDoubleSpinBox>(); @@ -76,7 +73,6 @@ void tst_QItemEditorFactory::createCustomEditor() QCOMPARE(w->metaObject()->userProperty().type(), QVariant::Double); delete creator; -#endif } QTEST_MAIN(tst_QItemEditorFactory) diff --git a/tests/auto/qitemmodel/modelstotest.cpp b/tests/auto/qitemmodel/modelstotest.cpp index 61fc480..2cd6048 100644 --- a/tests/auto/qitemmodel/modelstotest.cpp +++ b/tests/auto/qitemmodel/modelstotest.cpp @@ -117,13 +117,8 @@ ModelsToTest::ModelsToTest() tests.append(test("QTableModel", ReadWrite, HasData)); tests.append(test("QTableModelEmpty", ReadWrite, Empty)); -#if QT_VERSION >= 0x040200 -#define TABLEFEATURE ReadWrite -#else -#define TABLEFEATURE ReadOnly -#endif - tests.append(test("QTreeModel", TABLEFEATURE, HasData)); - tests.append(test("QTreeModelEmpty", TABLEFEATURE, Empty)); + tests.append(test("QTreeModel", ReadWrite, HasData)); + tests.append(test("QTreeModelEmpty", ReadWrite, Empty)); tests.append(test("QSqlQueryModel", ReadOnly, HasData)); tests.append(test("QSqlQueryModelEmpty", ReadOnly, Empty)); diff --git a/tests/auto/qitemview/tst_qitemview.cpp b/tests/auto/qitemview/tst_qitemview.cpp index b248aa8..748bd50 100644 --- a/tests/auto/qitemview/tst_qitemview.cpp +++ b/tests/auto/qitemview/tst_qitemview.cpp @@ -230,19 +230,15 @@ void tst_QItemView::setupWithNoTestData() ViewsToTest testViews; QTest::addColumn<QString>("viewType"); QTest::addColumn<bool>("displays"); -#if QT_VERSION >= 0x040200 QTest::addColumn<int>("vscroll"); QTest::addColumn<int>("hscroll"); -#endif for (int i = 0; i < testViews.tests.size(); ++i) { QString view = testViews.tests.at(i).viewType; QString test = view + " ScrollPerPixel"; bool displayIndexes = (testViews.tests.at(i).display == ViewsToTest::DisplayRoot); QTest::newRow(test.toLatin1().data()) << view << displayIndexes -#if QT_VERSION >= 0x040200 << (int)QAbstractItemView::ScrollPerPixel << (int)QAbstractItemView::ScrollPerPixel -#endif ; } for (int i = 0; i < testViews.tests.size(); ++i) { @@ -250,10 +246,8 @@ void tst_QItemView::setupWithNoTestData() QString test = view + " ScrollPerItem"; bool displayIndexes = (testViews.tests.at(i).display == ViewsToTest::DisplayRoot); QTest::newRow(test.toLatin1().data()) << view << displayIndexes -#if QT_VERSION >= 0x040200 << (int)QAbstractItemView::ScrollPerItem << (int)QAbstractItemView::ScrollPerItem -#endif ; } } @@ -296,19 +290,17 @@ void tst_QItemView::nonDestructiveBasicTest() #ifdef Q_OS_IRIX QSKIP("This test takes too long to execute on IRIX", SkipAll); #endif - + #ifdef Q_OS_WINCE QTest::qWait(400); #endif QFETCH(QString, viewType); view = testViews->createView(viewType); -#if QT_VERSION >= 0x040200 QFETCH(int, vscroll); QFETCH(int, hscroll); view->setVerticalScrollMode((QAbstractItemView::ScrollMode)vscroll); view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll); -#endif // setSelectionModel() will assert //view->setSelectionModel(0); @@ -461,12 +453,10 @@ void tst_QItemView::spider() #endif QFETCH(QString, viewType); view = testViews->createView(viewType); -#if QT_VERSION >= 0x040200 QFETCH(int, vscroll); QFETCH(int, hscroll); view->setVerticalScrollMode((QAbstractItemView::ScrollMode)vscroll); view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll); -#endif view->setModel(treeModel); view->show(); #if defined(Q_OS_WINCE) @@ -498,12 +488,10 @@ void tst_QItemView::resize() // doesn't really catch theproblem. QFETCH(QString, viewType); view = testViews->createView(viewType); -#if QT_VERSION >= 0x040200 QFETCH(int, vscroll); QFETCH(int, hscroll); view->setVerticalScrollMode((QAbstractItemView::ScrollMode)vscroll); view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll); -#endif view->setModel(treeModel); view->show(); @@ -528,12 +516,10 @@ void tst_QItemView::visualRect() #endif QFETCH(QString, viewType); view = testViews->createView(viewType); -#if QT_VERSION >= 0x040200 QFETCH(int, vscroll); QFETCH(int, hscroll); view->setVerticalScrollMode((QAbstractItemView::ScrollMode)vscroll); view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll); -#endif QCOMPARE(view->visualRect(QModelIndex()), QRect()); // Add model @@ -664,12 +650,10 @@ void tst_QItemView::indexAt() #endif QFETCH(QString, viewType); view = testViews->createView(viewType); -#if QT_VERSION >= 0x040200 QFETCH(int, vscroll); QFETCH(int, hscroll); view->setVerticalScrollMode((QAbstractItemView::ScrollMode)vscroll); view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll); -#endif view->show(); view->setModel(treeModel); #if 0 @@ -700,12 +684,10 @@ void tst_QItemView::scrollTo() #endif QFETCH(QString, viewType); view = testViews->createView(viewType); -#if QT_VERSION >= 0x040200 QFETCH(int, vscroll); QFETCH(int, hscroll); view->setVerticalScrollMode((QAbstractItemView::ScrollMode)vscroll); view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll); -#endif view->setModel(treeModel); view->show(); diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index 33de82a..8fcee36 100644 --- a/tests/auto/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp @@ -181,9 +181,7 @@ void tst_QKeySequence::operatorQString_data() #ifndef Q_WS_MAC QTest::newRow( "Ctrl+Left" ) << int(Qt::CTRL) << int(Qt::Key_Left) << QString( "Ctrl+Left" ); -#if QT_VERSION > 0x040100 QTest::newRow( "Ctrl+," ) << int(Qt::CTRL) << int(Qt::Key_Comma) << QString( "Ctrl+," ); -#endif QTest::newRow( "Alt+Left" ) << int(Qt::ALT) << int(Qt::Key_Left) << QString( "Alt+Left" ); QTest::newRow( "Alt+Shift+Left" ) << int(Qt::ALT | Qt::SHIFT) << int(Qt::Key_Left) << QString( "Alt+Shift+Left" ); QTest::newRow( "Ctrl" ) << int(Qt::CTRL) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString( "Ctrl+\x0c5" ); @@ -192,9 +190,7 @@ void tst_QKeySequence::operatorQString_data() QTest::newRow( "Meta" ) << int(Qt::META) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString( "Meta+\x0c5" ); #else QTest::newRow( "Ctrl+Left" ) << int(Qt::CTRL) << int(Qt::Key_Left) << MacCtrl + macSymbolForQtKey(Qt::Key_Left); -#if QT_VERSION > 0x040100 QTest::newRow( "Ctrl+," ) << int(Qt::CTRL) << int(Qt::Key_Comma) << MacCtrl + ","; -#endif QTest::newRow( "Alt+Left" ) << int(Qt::ALT) << int(Qt::Key_Left) << MacAlt + macSymbolForQtKey(Qt::Key_Left); QTest::newRow( "Alt+Shift+Left" ) << int(Qt::ALT | Qt::SHIFT) << int(Qt::Key_Left) << MacAlt + MacShift + macSymbolForQtKey(Qt::Key_Left); QTest::newRow( "Ctrl" ) << int(Qt::CTRL) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacCtrl + "\x0c5"; @@ -385,10 +381,8 @@ void tst_QKeySequence::toString_data() QTest::newRow("Shift") << QString("Shift+\x0c5") << QString("Shift+\x0c5") << QString("Shift+\x0c5"); QTest::newRow("Meta") << QString("Meta+\x0c5") << QString("Meta+\x0c5") << QString("Meta+\x0c5"); QTest::newRow("Ctrl+Plus") << QString("Ctrl++") << QString("Ctrl++") << QString("Ctrl++"); -#if QT_VERSION > 0x040100 QTest::newRow("Ctrl+,") << QString("Ctrl+,") << QString("Ctrl+,") << QString("Ctrl+,"); QTest::newRow("Ctrl+,,Ctrl+,") << QString("Ctrl+,,Ctrl+,") << QString("Ctrl+,, Ctrl+,") << QString("Ctrl+,, Ctrl+,"); -#endif QTest::newRow("MultiKey") << QString("Alt+X, Ctrl+Y, Z") << QString("Alt+X, Ctrl+Y, Z") << QString("Alt+X, Ctrl+Y, Z"); @@ -406,10 +400,8 @@ void tst_QKeySequence::toString_data() QTest::newRow("Shift") << MacShift + "\x0c5" << QString("Shift+\x0c5") << MacShift + "\x0c5"; QTest::newRow("Meta") << MacMeta + "\x0c5" << QString("Meta+\x0c5") << MacMeta + "\x0c5"; QTest::newRow("Ctrl+Plus") << MacCtrl + "+" << QString("Ctrl++") << MacCtrl + "+"; -#if QT_VERSION > 0x040100 QTest::newRow("Ctrl+,") << MacCtrl + "," << QString("Ctrl+,") << MacCtrl + ","; QTest::newRow("Ctrl+,,Ctrl+,") << MacCtrl + ",, " + MacCtrl + "," << QString("Ctrl+,, Ctrl+,") << MacCtrl + ",, " + MacCtrl + ","; -#endif QTest::newRow("MultiKey") << MacAlt + "X, " + MacCtrl + "Y, Z" << QString("Alt+X, Ctrl+Y, Z") << MacAlt + "X, " + MacCtrl + "Y, Z"; QTest::newRow("Invalid") << QString("Ctrly") << QString("") << QString(""); diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp index 1783a3d..4580236 100644 --- a/tests/auto/qlabel/tst_qlabel.cpp +++ b/tests/auto/qlabel/tst_qlabel.cpp @@ -263,10 +263,8 @@ void tst_QLabel::setTextFormat() testWidget->setTextFormat( Qt::RichText ); QVERIFY( testWidget->textFormat() == Qt::RichText ); -#if QT_VERSION >= 0x030100 testWidget->setTextFormat( Qt::LogText ); QVERIFY( testWidget->textFormat() == Qt::LogText ); -#endif testWidget->setTextFormat( Qt::AutoText ); QVERIFY( testWidget->textFormat() == Qt::AutoText ); diff --git a/tests/auto/qlibrary/tst_qlibrary.cpp b/tests/auto/qlibrary/tst_qlibrary.cpp index dea0c54e..3e7e3f3 100644 --- a/tests/auto/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/qlibrary/tst_qlibrary.cpp @@ -187,7 +187,7 @@ void tst_QLibrary::version() QFETCH( int, loadversion ); QFETCH( int, resultversion ); -#if QT_VERSION >= 0x040200 && !defined(Q_OS_AIX) && !defined(Q_OS_WIN) +#if !defined(Q_OS_AIX) && !defined(Q_OS_WIN) QString currDir = QDir::currentPath(); QLibrary library( currDir + QLatin1Char('/') + lib, loadversion ); bool ok = library.load(); @@ -218,7 +218,6 @@ void tst_QLibrary::load_data() QTest::newRow("ok (libmylib ver. 1)") << currDir + "/libmylib" <<(bool)true; #endif -#if QT_VERSION >= 0x040103 # if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << (bool)true; QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << (bool)true; @@ -228,7 +227,6 @@ void tst_QLibrary::load_data() QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/libmylib.so2" << (bool)true; QTest::newRow( "ok03 (with non-standard suffix)" ) << currDir + "/system.trolltech.test.mylib.so" << (bool)true; # endif // Q_OS_UNIX -#endif // QT_VERSION } void tst_QLibrary::load() @@ -438,7 +436,7 @@ void tst_QLibrary::loadHints_data() QTest::addColumn<bool>("result"); QLibrary::LoadHints lh; -#if QT_VERSION >= 0x040300 && defined(Q_OS_AIX) +#if defined(Q_OS_AIX) if (QFile::exists("/usr/lib/libGL.a") || QFile::exists("/usr/X11R6/lib/libGL.a")) { # if QT_POINTER_SIZE == 4 QTest::newRow( "ok03 (Archive member)" ) << "libGL.a(shr.o)" << int(QLibrary::LoadArchiveMemberHint) << (bool)TRUE; @@ -446,9 +444,8 @@ void tst_QLibrary::loadHints_data() QTest::newRow( "ok03 (Archive member)" ) << "libGL.a(shr_64.o)" << int(QLibrary::LoadArchiveMemberHint) << (bool)TRUE; #endif } -#endif // QT_VERSION +#endif -#if QT_VERSION >= 0x040103 QString currDir = QDir::currentPath(); lh |= QLibrary::ResolveAllSymbolsHint; # if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) @@ -460,8 +457,6 @@ void tst_QLibrary::loadHints_data() QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/libmylib.so2" << int(lh) << (bool)TRUE; QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.so" << int(lh) << (bool)TRUE; # endif // Q_OS_UNIX -#endif // QT_VERSION - } void tst_QLibrary::loadHints() diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 8779831..ea1f79f 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -1466,14 +1466,10 @@ void tst_QLineEdit::textMask_data() void tst_QLineEdit::textMask() { -#if (QT_VERSION-0 >= 0x030303) QFETCH( QString, insertString ); testWidget->setInputMask( "#" ); testWidget->setText( insertString ); QCOMPARE( testWidget->text(), insertString ); -#else - QSKIP( "This test function tests a problem with masks that was fixed in 3.3", SkipAll); -#endif } void tst_QLineEdit::setText() diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index 4529bd5..b16a62a 100644 --- a/tests/auto/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp @@ -1039,11 +1039,6 @@ void tst_QMainWindow::toolBarArea() QMainWindow mw; QToolBar tb(&mw); -#if QT_VERSION <= 0x040103 - // this would assert in previous versions - QCOMPARE(mw.toolBarArea(&tb), Qt::ToolBarArea(0)); -#endif - for (int j = 0; j < areaCount; ++j) { Qt::ToolBarArea otherArea = areas[j]; @@ -1205,11 +1200,6 @@ void tst_QMainWindow::dockWidgetArea() QMainWindow mw; QDockWidget dw(&mw); -#if QT_VERSION <= 0x040103 - // this would assert in previous versions - QCOMPARE(mw.dockWidgetArea(&dw), Qt::DockWidgetArea(0)); -#endif - for (int j = 0; j < areaCount; ++j) { Qt::DockWidgetArea otherArea = areas[i]; diff --git a/tests/auto/qmake/testdata/functions/functions.pro b/tests/auto/qmake/testdata/functions/functions.pro index 5ee5f51..9ed92f96 100644 --- a/tests/auto/qmake/testdata/functions/functions.pro +++ b/tests/auto/qmake/testdata/functions/functions.pro @@ -51,15 +51,11 @@ include( infiletest.pro ) message( "FAILED: include function: $$DEFINES" ) } -lessThan(QT_VERSION, 40200) { - message( "SKIPPED: replace function only in 4.2" ) -} else { - #replace - VERSION=1.0.0 - VERSION_replaced=$$replace(VERSION,\.,_) - !isEqual(VERSION_replaced, 1_0_0) { - message( "FAILED: replace function: $$VERSION_replaced" ) - } +#replace +VERSION=1.0.0 +VERSION_replaced=$$replace(VERSION,\.,_) +!isEqual(VERSION_replaced, 1_0_0) { + message( "FAILED: replace function: $$VERSION_replaced" ) } #test functions diff --git a/tests/auto/qmap/tst_qmap.cpp b/tests/auto/qmap/tst_qmap.cpp index ce413c5..99efc80 100644 --- a/tests/auto/qmap/tst_qmap.cpp +++ b/tests/auto/qmap/tst_qmap.cpp @@ -728,37 +728,27 @@ void tst_QMap::iterators() void tst_QMap::keys_values_uniqueKeys() { QMap<QString, int> map; -#if QT_VERSION >= 0x040200 QVERIFY(map.uniqueKeys().isEmpty()); -#endif QVERIFY(map.keys().isEmpty()); QVERIFY(map.values().isEmpty()); map.insertMulti("alpha", 1); QVERIFY(map.keys() == (QList<QString>() << "alpha")); -#if QT_VERSION >= 0x040200 QVERIFY(map.uniqueKeys() == map.keys()); -#endif QVERIFY(map.values() == (QList<int>() << 1)); map.insertMulti("beta", -2); QVERIFY(map.keys() == (QList<QString>() << "alpha" << "beta")); -#if QT_VERSION >= 0x040200 QVERIFY(map.keys() == map.uniqueKeys()); -#endif QVERIFY(map.values() == (QList<int>() << 1 << -2)); map.insertMulti("alpha", 2); -#if QT_VERSION >= 0x040200 QVERIFY(map.uniqueKeys() == (QList<QString>() << "alpha" << "beta")); -#endif QVERIFY(map.keys() == (QList<QString>() << "alpha" << "alpha" << "beta")); QVERIFY(map.values() == (QList<int>() << 2 << 1 << -2)); map.insertMulti("beta", 4); -#if QT_VERSION >= 0x040200 QVERIFY(map.uniqueKeys() == (QList<QString>() << "alpha" << "beta")); -#endif QVERIFY(map.keys() == (QList<QString>() << "alpha" << "alpha" << "beta" << "beta")); QVERIFY(map.values() == (QList<int>() << 2 << 1 << 4 << -2)); } diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp index b3b7f33..3d04a0f 100644 --- a/tests/auto/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp @@ -257,11 +257,7 @@ private slots: void on_child1_destroyed() { ++invokeCount2; } }; -#if QT_VERSION >= 0x040200 #define FUNCTION(x) "QMetaObject::" x ": " -#else -#define FUNCTION(x) "QMetaObject::" x "(): " -#endif void tst_QMetaObject::connectSlotsByName() { diff --git a/tests/auto/qmetatype/tst_qmetatype.cpp b/tests/auto/qmetatype/tst_qmetatype.cpp index eccf7e6..d71f470 100644 --- a/tests/auto/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/qmetatype/tst_qmetatype.cpp @@ -127,7 +127,6 @@ protected: void tst_QMetaType::threadSafety() { -#if QT_VERSION >= 0x040100 MetaTypeTorturer t1; MetaTypeTorturer t2; MetaTypeTorturer t3; @@ -139,7 +138,6 @@ void tst_QMetaType::threadSafety() QVERIFY(t1.wait()); QVERIFY(t2.wait()); QVERIFY(t3.wait()); -#endif } namespace TestSpace diff --git a/tests/auto/qmovie/tst_qmovie.cpp b/tests/auto/qmovie/tst_qmovie.cpp index dd24f97..23b057b 100644 --- a/tests/auto/qmovie/tst_qmovie.cpp +++ b/tests/auto/qmovie/tst_qmovie.cpp @@ -71,9 +71,7 @@ private slots: void playMovie(); void jumpToFrame_data(); void jumpToFrame(); -#if QT_VERSION >= 0x040101 void changeMovieFile(); -#endif // QT_VERSION }; // Testing get/set functions @@ -201,7 +199,6 @@ void tst_QMovie::jumpToFrame() QVERIFY(movie.currentFrameNumber() == 0); } -#if QT_VERSION >= 0x040101 void tst_QMovie::changeMovieFile() { QMovie movie("animations/comicsecard.gif"); @@ -211,7 +208,5 @@ void tst_QMovie::changeMovieFile() QVERIFY(movie.currentFrameNumber() == -1); } -#endif // QT_VERSION - QTEST_MAIN(tst_QMovie) #include "tst_qmovie.moc" diff --git a/tests/auto/qmutexlocker/tst_qmutexlocker.cpp b/tests/auto/qmutexlocker/tst_qmutexlocker.cpp index cb5112d..cc3e144 100644 --- a/tests/auto/qmutexlocker/tst_qmutexlocker.cpp +++ b/tests/auto/qmutexlocker/tst_qmutexlocker.cpp @@ -194,9 +194,6 @@ void tst_QMutexLocker::unlockAndRelockTest() void tst_QMutexLocker::lockerStateTest() { -#if QT_VERSION < 0x040200 - QSKIP("QMutexLocker doesn't keep state in Qt < 4.2", SkipAll); -#else class LockerStateThread : public tst_QMutexLockerThread { public: @@ -233,7 +230,6 @@ void tst_QMutexLocker::lockerStateTest() delete thread; thread = 0; -#endif } QTEST_MAIN(tst_QMutexLocker) diff --git a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp index a28c49a..68ec414 100644 --- a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp +++ b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp @@ -42,8 +42,6 @@ #include <QtTest/QtTest> -#if QT_VERSION >= 0x040100 - #ifdef Q_OS_WIN #include <winsock2.h> #endif @@ -694,7 +692,3 @@ void tst_QNativeSocketEngine::receiveUrgentData() QTEST_MAIN(tst_QNativeSocketEngine) #include "tst_qnativesocketengine.moc" - -#else // QT_VERSION -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp index 6e5afd2..a246b04 100644 --- a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp +++ b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp @@ -42,10 +42,6 @@ #include <QtTest/QtTest> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <qcoreapplication.h> #include <qnetworkinterface.h> #include <qtcpsocket.h> @@ -210,5 +206,3 @@ void tst_QNetworkInterface::copyInvalidInterface() QTEST_MAIN(tst_QNetworkInterface) #include "tst_qnetworkinterface.moc" - -#endif diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 503118a..104b788 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -2236,9 +2236,6 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket_data() void tst_QNetworkReply::ioPutToFileFromLocalSocket() { -#if defined(Q_OS_WINCE) && QT_VERSION < 0x040500 - QSKIP("No local sockets on Windows CE for Qt 4.4", SkipAll); -#else QString socketname = "networkreplytest"; QLocalServer server; if (!server.listen(socketname)) { @@ -2276,7 +2273,6 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket() QCOMPARE(file.size(), qint64(data.size())); QByteArray contents = file.readAll(); QCOMPARE(contents, data); -#endif } void tst_QNetworkReply::ioPutToFileFromProcess_data() diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 096f1c5..fb46073 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -264,13 +264,9 @@ void tst_QObject::disconnect() QCOMPARE( r1->called(1), FALSE ); r1->reset(); -#if QT_VERSION >= 0x030100 QCOMPARE( ret, TRUE ); -#endif ret = QObject::disconnect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) ); -#if QT_VERSION >= 0x030100 QCOMPARE( ret, FALSE ); -#endif // disconnect all signals from s from all slots from r1 QObject::disconnect( s, 0, r1, 0 ); @@ -702,12 +698,10 @@ void tst_QObject::connectDisconnectNotify() QCOMPARE( s->org_signal, s->nw_signal ); QCOMPARE( s->org_signal.toLatin1(), QMetaObject::normalizedSignature(a_signal.toLatin1().constData()) ); -#if QT_VERSION > 0x040101 // Reconnect connect( (SenderObject*)s, a_signal.toLatin1(), (ReceiverObject*)r, a_slot.toLatin1() ); // Test disconnectNotify for a complete disconnect ((SenderObject*)s)->disconnect((ReceiverObject*)r); -#endif delete s; delete r; diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index fb8df2e..8b43f9b 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -2573,23 +2573,6 @@ void tst_QPainter::setOpacity() p.fillRect(imageRect, QColor(127, 127, 127)); p.end(); -#if defined(Q_WS_QWS) && (QT_VERSION < 0x040500) - // embedded has an optimized implementation in 4.4 - if ((dest.format() == QImage::Format_ARGB8555_Premultiplied || - dest.format() == QImage::Format_RGB555 || - dest.format() == QImage::Format_RGB666 || - dest.format() == QImage::Format_RGB888 || - dest.format() == QImage::Format_ARGB8565_Premultiplied) && - src.format() != QImage::Format_RGB32) - { - QColor c1 = expected.pixel(1, 1); - QColor c2 = dest.pixel(1, 1); - QVERIFY(qAbs(c1.red() - c2.red()) < 2); - QVERIFY(qAbs(c1.green() - c2.green()) < 2); - QVERIFY(qAbs(c1.blue() - c2.blue()) < 2); - QVERIFY(qAbs(c1.alpha() - c2.alpha()) < 2); - } else -#endif QCOMPARE(dest, expected); } diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp index 873fe59..38fb8d7 100644 --- a/tests/auto/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp @@ -84,11 +84,9 @@ private slots: void testOperatorEquals_fuzzy(); void testOperatorDatastream(); -#if QT_VERSION >= 0x040200 void testArcMoveTo_data(); void testArcMoveTo(); void setElementPositionAt(); -#endif void testOnPath_data(); void testOnPath(); diff --git a/tests/auto/qpicture/tst_qpicture.cpp b/tests/auto/qpicture/tst_qpicture.cpp index ddf37f7..dfa61c7 100644 --- a/tests/auto/qpicture/tst_qpicture.cpp +++ b/tests/auto/qpicture/tst_qpicture.cpp @@ -125,12 +125,10 @@ void tst_QPicture::boundingRect() // default value QVERIFY( !p1.boundingRect().isValid() ); -#if QT_VERSION >= 0x030100 QRect r1( 20, 30, 5, 15 ); p1.setBoundingRect( r1 ); QCOMPARE( p1.boundingRect(), r1 ); p1.setBoundingRect(QRect()); -#endif QPainter pt( &p1 ); pt.drawLine( 10, 20, 110, 80 ); diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp index 0febb87..a598bfc 100644 --- a/tests/auto/qprinter/tst_qprinter.cpp +++ b/tests/auto/qprinter/tst_qprinter.cpp @@ -121,9 +121,6 @@ void tst_QPrinter::getSetCheck() obj1.setCollateCopies(false); QCOMPARE(false, obj1.collateCopies()); obj1.setCollateCopies(true); -#if !defined(Q_OS_UNIX) && QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Apparently only the Unix (ps) printer supports collate at the moment", Continue); -#endif QCOMPARE(true, obj1.collateCopies()); obj1.setColorMode(QPrinter::GrayScale); @@ -185,9 +182,6 @@ void tst_QPrinter::getSetCheck() obj1.setFontEmbeddingEnabled(false); QCOMPARE(false, obj1.fontEmbeddingEnabled()); obj1.setFontEmbeddingEnabled(true); -#if !defined(Q_OS_UNIX) && QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Apparently only the Unix (ps) printer supports font embedding at the moment", Continue); -#endif QCOMPARE(true, obj1.fontEmbeddingEnabled()); // PageSize QPrinter::pageSize() @@ -255,20 +249,13 @@ void tst_QPrinter::cleanup() void tst_QPrinter::testPageSetupDialog() { -#if QT_VERSION < 0x040102 - QSKIP("QPrinter::OutputFormat doesn't exist in Qt 4.0.x and test crashes on < 4.1.2"); -#else - // Make sure this doesn't crash at least { QPrinter printer; QPageSetupDialog dialog(&printer); } -#endif } - - void tst_QPrinter::testPageSize() { #if defined (Q_WS_WIN) @@ -332,10 +319,6 @@ void tst_QPrinter::testPageRectAndPaperRect_data() void tst_QPrinter::testPageRectAndPaperRect() { -#if QT_VERSION <= 0x040100 - QEXPECT_FAIL("", "Fixed in Qt 4.1.1", Continue); -#endif - QFETCH(bool, withPainter); QFETCH(int, orientation); QFETCH(int, resolution); @@ -529,9 +512,6 @@ void tst_QPrinter::testMulitpleSets() QPrinter::PageSize printerPageSize = QPrinter::PageSize(pageSize); QPrinter printer(mode); printer.setFullPage(true); -#if QT_VERSION < 0x040103 - QEXPECT_FAIL("", "Fixed in Qt 4.1.3", SkipAll); -#endif int paperWidth, paperHeight; //const int Tolerance = 2; diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index ef78c2e..ba034ee 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -267,11 +267,9 @@ void tst_QProcess::simpleStart() //----------------------------------------------------------------------------- void tst_QProcess::startDetached() { -#if QT_VERSION >= 0x040200 QProcess proc; QVERIFY(proc.startDetached("testProcessNormal/testProcessNormal", QStringList() << "arg1" << "arg2")); -#endif QCOMPARE(QProcess::startDetached("nonexistingexe"), false); } diff --git a/tests/auto/qpushbutton/tst_qpushbutton.cpp b/tests/auto/qpushbutton/tst_qpushbutton.cpp index 34dd313..27dec9d 100644 --- a/tests/auto/qpushbutton/tst_qpushbutton.cpp +++ b/tests/auto/qpushbutton/tst_qpushbutton.cpp @@ -206,11 +206,7 @@ void tst_QPushButton::setAutoRepeat() QVERIFY( !testWidget->isCheckable() ); // verify autorepeat is off by default. -#if QT_VERSION < 0x040000 - QButton tmp( 0 ); -#else QPushButton tmp( 0 ); -#endif tmp.setObjectName("tmp"); QVERIFY( !tmp.autoRepeat() ); diff --git a/tests/auto/qreadlocker/tst_qreadlocker.cpp b/tests/auto/qreadlocker/tst_qreadlocker.cpp index c650ff5..a37f93c 100644 --- a/tests/auto/qreadlocker/tst_qreadlocker.cpp +++ b/tests/auto/qreadlocker/tst_qreadlocker.cpp @@ -189,9 +189,6 @@ void tst_QReadLocker::unlockAndRelockTest() void tst_QReadLocker::lockerStateTest() { -#if QT_VERSION < 0x040200 - QSKIP("QReadLocker doesn't keep state in Qt < 4.2", SkipAll); -#else class LockerStateThread : public tst_QReadLockerThread { public: @@ -228,7 +225,6 @@ void tst_QReadLocker::lockerStateTest() delete thread; thread = 0; -#endif } QTEST_MAIN(tst_QReadLocker) diff --git a/tests/auto/qrect/tst_qrect.cpp b/tests/auto/qrect/tst_qrect.cpp index ed605a3..7e8d9c3 100644 --- a/tests/auto/qrect/tst_qrect.cpp +++ b/tests/auto/qrect/tst_qrect.cpp @@ -432,14 +432,12 @@ void tst_QRect::normalized_data() QTest::newRow( "NegativePointQRect" ) << getQRectCase( NegativePointQRect ) << QRect( -10, -10, 5, 5 ); QTest::newRow( "NullQRect" ) << getQRectCase( NullQRect ) << getQRectCase( NullQRect ); QTest::newRow( "EmptyQRect" ) << getQRectCase( EmptyQRect ) << getQRectCase( EmptyQRect ); -#if QT_VERSION > 0x040001 QTest::newRow( "Task80908") << QRect(100, 200, 100, 0) << QRect(100, 200, 100, 0); // Since "NegativeSizeQRect passes, I expect both of these to pass too. // This passes, since height() returns -1 before normalization QTest::newRow( "Task85023") << QRect(QPoint(100,201), QPoint(199,199)) << QRect(QPoint(100,199), QPoint(199,201)); // This, on the other hand height() returns 0 before normalization. QTest::newRow( "Task85023.1") << QRect(QPoint(100,200), QPoint(199,199)) << QRect(QPoint(100,199), QPoint(199,200)); -#endif QTest::newRow( "Task188109" ) << QRect(QPoint(263, 113), QPoint(136, 112)) << QRect(QPoint(136, 113), QPoint(263, 112)); } @@ -1733,14 +1731,12 @@ void tst_QRect::newSetTopLeft_data() void tst_QRect::newSetTopLeft() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( QPoint, topLeft ); QFETCH( QRect, nr ); r.setTopLeft( topLeft ); QCOMPARE( r, nr ); -#endif } void tst_QRect::newSetBottomRight_data() @@ -1961,7 +1957,6 @@ void tst_QRect::newSetBottomRight_data() void tst_QRect::newSetBottomRight() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( QPoint, bottomRight ); QFETCH( QRect, nr ); @@ -1969,7 +1964,6 @@ void tst_QRect::newSetBottomRight() r.setBottomRight( bottomRight ); QCOMPARE( r, nr ); -#endif } void tst_QRect::newSetTopRight_data() @@ -2190,7 +2184,6 @@ void tst_QRect::newSetTopRight_data() void tst_QRect::newSetTopRight() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( QPoint, topRight ); QFETCH( QRect, nr ); @@ -2198,7 +2191,6 @@ void tst_QRect::newSetTopRight() r.setTopRight( topRight ); QCOMPARE( r, nr ); -#endif } void tst_QRect::newSetBottomLeft_data() @@ -2419,7 +2411,6 @@ void tst_QRect::newSetBottomLeft_data() void tst_QRect::newSetBottomLeft() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( QPoint, bottomLeft ); QFETCH( QRect, nr ); @@ -2427,7 +2418,6 @@ void tst_QRect::newSetBottomLeft() r.setBottomLeft( bottomLeft ); QCOMPARE( r, nr ); -#endif } void tst_QRect::topLeft_data() @@ -2787,7 +2777,6 @@ void tst_QRect::newMoveLeft_data() void tst_QRect::newMoveLeft() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( int, left ); QFETCH( QRect, nr ); @@ -2795,7 +2784,6 @@ void tst_QRect::newMoveLeft() r.moveLeft( left ); QCOMPARE( r, nr ); -#endif } void tst_QRect::newMoveTop_data() @@ -2958,7 +2946,6 @@ void tst_QRect::newMoveTop_data() void tst_QRect::newMoveTop() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( int, top ); QFETCH( QRect, nr ); @@ -2966,7 +2953,6 @@ void tst_QRect::newMoveTop() r.moveTop( top ); QCOMPARE( r, nr ); -#endif } void tst_QRect::newMoveRight_data() @@ -3114,7 +3100,6 @@ void tst_QRect::newMoveRight_data() void tst_QRect::newMoveRight() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( int, right ); QFETCH( QRect, nr ); @@ -3122,7 +3107,6 @@ void tst_QRect::newMoveRight() r.moveRight( right ); QCOMPARE( r, nr ); -#endif } void tst_QRect::newMoveBottom_data() @@ -3270,7 +3254,6 @@ void tst_QRect::newMoveBottom_data() void tst_QRect::newMoveBottom() { -#if QT_VERSION >= 0x030100 QFETCH( QRect, r ); QFETCH( int, bottom ); QFETCH( QRect, nr ); @@ -3278,7 +3261,6 @@ void tst_QRect::newMoveBottom() r.moveBottom( bottom ); QCOMPARE( r, nr ); -#endif } void tst_QRect::newMoveTopLeft_data() @@ -3468,7 +3450,6 @@ void tst_QRect::newMoveTopLeft_data() void tst_QRect::newMoveTopLeft() { -#if QT_VERSION >= 0x030100 QFETCH(QRect,r); QFETCH(QPoint,topLeft); QFETCH(QRect,nr); @@ -3476,7 +3457,6 @@ void tst_QRect::newMoveTopLeft() r.moveTopLeft(topLeft); QCOMPARE(r,nr); -#endif } void tst_QRect::newMoveBottomRight_data() @@ -3666,7 +3646,6 @@ void tst_QRect::newMoveBottomRight_data() void tst_QRect::newMoveBottomRight() { -#if QT_VERSION >= 0x030100 QFETCH(QRect,r); QFETCH(QPoint,bottomRight); QFETCH(QRect,nr); @@ -3674,11 +3653,9 @@ void tst_QRect::newMoveBottomRight() r.moveBottomRight(bottomRight); QCOMPARE(r,nr); -#endif } - void tst_QRect::translate_data() { QTest::addColumn<QRect>("r"); @@ -3720,10 +3697,8 @@ void tst_QRect::translate() } - void tst_QRect::moveTop() { -#if QT_VERSION >= 0x030100 { QRect r( 10, 10, 100, 100 ); r.moveTop( 3 ); @@ -3742,12 +3717,10 @@ void tst_QRect::moveTop() r.moveTop( -22 ); QCOMPARE( r, QRectF(10, -22, 100, 100) ); } -#endif } void tst_QRect::moveBottom() { -#if QT_VERSION >= 0x030100 { QRect r( 10, -22, 100, 100 ); r.moveBottom( 104 ); @@ -3758,12 +3731,10 @@ void tst_QRect::moveBottom() r.moveBottom( 104 ); QCOMPARE( r, QRectF(10, 4, 100, 100) ); } -#endif } void tst_QRect::moveLeft() { -#if QT_VERSION >= 0x030100 { QRect r( 10, 5, 100, 100 ); r.moveLeft( 11 ); @@ -3774,12 +3745,10 @@ void tst_QRect::moveLeft() r.moveLeft( 11 ); QCOMPARE( r, QRectF(11, 5, 100, 100) ); } -#endif } void tst_QRect::moveRight() { -#if QT_VERSION >= 0x030100 { QRect r( 11, 5, 100, 100 ); r.moveRight( 106 ); @@ -3790,7 +3759,6 @@ void tst_QRect::moveRight() r.moveRight( 106 ); QCOMPARE( r, QRectF(6, 5, 100, 100) ); } -#endif } void tst_QRect::moveTopLeft() @@ -3851,7 +3819,6 @@ void tst_QRect::moveBottomRight() void tst_QRect::setTopLeft() { -#if QT_VERSION >= 0x030100 { QRect r( 20, 10, 200, 100 ); r.setTopLeft( QPoint(5, 7) ); @@ -3862,12 +3829,10 @@ void tst_QRect::setTopLeft() r.setTopLeft( QPoint(5, 7) ); QCOMPARE( r, QRectF(5, 7, 215, 103) ); } -#endif } void tst_QRect::setTopRight() { -#if QT_VERSION >= 0x030100 { QRect r( 20, 10, 200, 100 ); r.setTopRight( QPoint(225, 7) ); @@ -3878,12 +3843,10 @@ void tst_QRect::setTopRight() r.setTopRight( QPoint(225, 7) ); QCOMPARE( r, QRectF(20, 7, 205, 103) ); } -#endif } void tst_QRect::setBottomLeft() { -#if QT_VERSION >= 0x030100 { QRect r( 20, 10, 200, 100 ); r.setBottomLeft( QPoint(5, 117) ); @@ -3894,12 +3857,10 @@ void tst_QRect::setBottomLeft() r.setBottomLeft( QPoint(5, 117) ); QCOMPARE( r, QRectF(5, 10, 215, 107) ); } -#endif } void tst_QRect::setBottomRight() { -#if QT_VERSION >= 0x030100 { QRect r( 20, 10, 200, 100 ); r.setBottomRight( QPoint(225, 117) ); @@ -3910,7 +3871,6 @@ void tst_QRect::setBottomRight() r.setBottomRight( QPoint(225, 117) ); QCOMPARE( r, QRectF(20, 10, 205, 107) ); } -#endif } void tst_QRect::operator_amp() diff --git a/tests/auto/qregexp/tst_qregexp.cpp b/tests/auto/qregexp/tst_qregexp.cpp index 2968a8e..999166e 100644 --- a/tests/auto/qregexp/tst_qregexp.cpp +++ b/tests/auto/qregexp/tst_qregexp.cpp @@ -557,7 +557,6 @@ void tst_QRegExp::setMinimal() void tst_QRegExp::exactMatch() { -#if QT_VERSION >= 0x030100 QRegExp rx_d( "\\d" ); QRegExp rx_s( "\\s" ); QRegExp rx_w( "\\w" ); @@ -570,9 +569,7 @@ void tst_QRegExp::exactMatch() bool is_d = ( ch.category() == QChar::Number_DecimalDigit ); bool is_s = ch.isSpace(); bool is_w = ( ch.isLetterOrNumber() -#if QT_VERSION >= 0x040200 || ch.isMark() -#endif || ch == '_' ); QVERIFY( rx_d.exactMatch(QString(ch)) == is_d ); @@ -582,7 +579,6 @@ void tst_QRegExp::exactMatch() QVERIFY( rx_S.exactMatch(QString(ch)) != is_s ); QVERIFY( rx_W.exactMatch(QString(ch)) != is_w ); } -#endif } void tst_QRegExp::capturedTexts() @@ -593,13 +589,11 @@ void tst_QRegExp::capturedTexts() QCOMPARE(rx1.cap(0), QString("aaa")); QCOMPARE(rx1.cap(1), QString("aaa")); -#if QT_VERSION >= 0x040200 QRegExp rx2("a*(a*)", Qt::CaseSensitive, QRegExp::RegExp2); rx2.exactMatch("aaa"); QCOMPARE(rx2.matchedLength(), 3); QCOMPARE(rx2.cap(0), QString("aaa")); QCOMPARE(rx2.cap(1), QString("")); -#endif QRegExp rx3("(?:a|aa)(a*)", Qt::CaseSensitive, QRegExp::RegExp); rx3.exactMatch("aaa"); @@ -607,13 +601,11 @@ void tst_QRegExp::capturedTexts() QCOMPARE(rx3.cap(0), QString("aaa")); QCOMPARE(rx3.cap(1), QString("aa")); -#if QT_VERSION >= 0x040200 QRegExp rx4("(?:a|aa)(a*)", Qt::CaseSensitive, QRegExp::RegExp2); rx4.exactMatch("aaa"); QCOMPARE(rx4.matchedLength(), 3); QCOMPARE(rx4.cap(0), QString("aaa")); QCOMPARE(rx4.cap(1), QString("a")); -#endif QRegExp rx5("(a)*(a*)", Qt::CaseSensitive, QRegExp::RegExp); rx5.exactMatch("aaa"); @@ -622,14 +614,12 @@ void tst_QRegExp::capturedTexts() QCOMPARE(rx5.cap(1), QString("a")); QCOMPARE(rx5.cap(2), QString("aa")); -#if QT_VERSION >= 0x040200 QRegExp rx6("(a)*(a*)", Qt::CaseSensitive, QRegExp::RegExp2); rx6.exactMatch("aaa"); QCOMPARE(rx6.matchedLength(), 3); QCOMPARE(rx6.cap(0), QString("aaa")); QCOMPARE(rx6.cap(1), QString("a")); QCOMPARE(rx6.cap(2), QString("")); -#endif QRegExp rx7("([A-Za-z_])([A-Za-z_0-9]*)"); rx7.setCaseSensitivity(Qt::CaseSensitive); @@ -689,7 +679,6 @@ void tst_QRegExp::indexIn() } } -#if QT_VERSION >= 0x040200 // same as above, but with RegExp2 { QRegExp rx( regexpStr, Qt::CaseSensitive, QRegExp::RegExp2 ); @@ -707,7 +696,6 @@ void tst_QRegExp::indexIn() QCOMPARE( mycaps[i], caps[i] ); } } -#endif } void tst_QRegExp::lastIndexIn() @@ -746,7 +734,6 @@ void tst_QRegExp::lastIndexIn() } } -#if QT_VERSION >= 0x040200 { QRegExp rx( regexpStr, Qt::CaseSensitive, QRegExp::RegExp2 ); QVERIFY( rx.isValid() ); @@ -766,7 +753,6 @@ void tst_QRegExp::lastIndexIn() } } } -#endif } void tst_QRegExp::matchedLength() @@ -1161,10 +1147,8 @@ void tst_QRegExp::prepareEngineOptimization() QRegExp rx4("foo", Qt::CaseInsensitive, QRegExp::RegExp); QVERIFY(rx4.isValid()); -#if QT_VERSION >= 0x040200 QRegExp rx5("foo", Qt::CaseInsensitive, QRegExp::RegExp2); QVERIFY(rx5.isValid()); -#endif QRegExp rx6("foo", Qt::CaseInsensitive, QRegExp::FixedString); QVERIFY(rx6.isValid()); @@ -1175,10 +1159,8 @@ void tst_QRegExp::prepareEngineOptimization() QRegExp rx8("][", Qt::CaseInsensitive, QRegExp::RegExp); QVERIFY(!rx8.isValid()); -#if QT_VERSION >= 0x040200 QRegExp rx9("][", Qt::CaseInsensitive, QRegExp::RegExp2); QVERIFY(!rx9.isValid()); -#endif QRegExp rx10("][", Qt::CaseInsensitive, QRegExp::Wildcard); QVERIFY(!rx10.isValid()); diff --git a/tests/auto/qregion/tst_qregion.cpp b/tests/auto/qregion/tst_qregion.cpp index 8ec4c28..eba07f2 100644 --- a/tests/auto/qregion/tst_qregion.cpp +++ b/tests/auto/qregion/tst_qregion.cpp @@ -145,12 +145,7 @@ void tst_QRegion::rects() { QRect rect( 10, -20, 30, 40 ); QRegion region( rect ); -#if QT_VERSION < 0x040000 - QCOMPARE( region.rects().count(), (uint)1 ); -#else QCOMPARE( region.rects().count(), 1 ); -#endif - QCOMPARE( region.rects()[0], rect ); } { @@ -200,11 +195,7 @@ void tst_QRegion::setRects() QRegion region; QRect rect( 10, -20, 30, 40 ); region.setRects( &rect, 1 ); -#if QT_VERSION < 0x040000 - QCOMPARE( region.rects().count(), (uint)1 ); -#else QCOMPARE( region.rects().count(), 1 ); -#endif QCOMPARE( region.rects()[0], rect ); } } @@ -374,9 +365,7 @@ void tst_QRegion::bitmapRegion() QVERIFY( region.contains( QPoint( 0, 10 ) ) ); // Mid-left QVERIFY( region.contains( QPoint( 10, 0 ) ) ); // Mid-top -#if ( QT_VERSION >= 0x030100 ) QVERIFY( region.contains( QPoint( 19, 10 ) ) ); // Mid-right -#endif QVERIFY( region.contains( QPoint( 10, 19 ) ) ); // Mid-bottom } } @@ -627,11 +616,9 @@ void tst_QRegion::operator_minus_data() QTest::addColumn<QRegion>("subtract"); QTest::addColumn<QRegion>("expected"); -#if !defined(Q_WS_X11) || QT_VERSION >= 0x040300 QTest::newRow("empty 0") << QRegion() << QRegion() << QRegion(); QTest::newRow("empty 1") << QRegion() << QRegion(QRect(10, 10, 10, 10)) << QRegion(); -#endif QTest::newRow("empty 2") << QRegion(QRect(10, 10, 10, 10)) << QRegion() << QRegion(QRect(10, 10, 10, 10)); diff --git a/tests/auto/qset/tst_qset.cpp b/tests/auto/qset/tst_qset.cpp index f4b0e93..41e6ebd 100644 --- a/tests/auto/qset/tst_qset.cpp +++ b/tests/auto/qset/tst_qset.cpp @@ -654,9 +654,6 @@ void tst_QSet::stlIterator() void tst_QSet::stlMutableIterator() { -#if QT_VERSION < 0x040200 - QSKIP("Needs Qt >= 4.2", SkipAll); -#else QSet<QString> set1; for (int i = 0; i < 25000; ++i) set1.insert(QString::number(i)); @@ -714,7 +711,6 @@ void tst_QSet::stlMutableIterator() #endif QVERIFY(*i == "foo"); } -#endif } void tst_QSet::javaIterator() @@ -803,9 +799,6 @@ void tst_QSet::javaIterator() void tst_QSet::javaMutableIterator() { -#if QT_VERSION < 0x040200 - QSKIP("Needs Qt >= 4.2", SkipAll); -#else QSet<QString> set1; for (int k = 0; k < 25000; ++k) set1.insert(QString::number(k)); @@ -891,7 +884,6 @@ void tst_QSet::javaMutableIterator() QVERIFY(set2.isEmpty()); QVERIFY(set3.isEmpty()); } -#endif } void tst_QSet::makeSureTheComfortFunctionsCompile() diff --git a/tests/auto/qsettings/tst_qsettings.cpp b/tests/auto/qsettings/tst_qsettings.cpp index 9524eb3..c478c63 100644 --- a/tests/auto/qsettings/tst_qsettings.cpp +++ b/tests/auto/qsettings/tst_qsettings.cpp @@ -240,7 +240,6 @@ static QString settingsPath(const char *path = "") return QDir::toNativeSeparators(tempPath + "/tst_QSettings/" + QLatin1String(path)); } -#if QT_VERSION >= 0x040100 static bool readCustom1File(QIODevice &device, QSettings::SettingsMap &map) { QDataStream in(&device); @@ -297,7 +296,6 @@ static bool writeCustom3File(QIODevice &device, const QSettings::SettingsMap &ma out << "OK"; return true; } -#endif static void populateWithFormats() { @@ -305,15 +303,12 @@ static void populateWithFormats() QTest::newRow("native") << QSettings::NativeFormat; QTest::newRow("ini") << QSettings::IniFormat; -#if QT_VERSION >= 0x040100 QTest::newRow("custom1") << QSettings::CustomFormat1; QTest::newRow("custom2") << QSettings::CustomFormat2; -#endif } tst_QSettings::tst_QSettings() { -#if QT_VERSION >= 0x040100 QSettings::Format custom1 = QSettings::registerFormat("custom1", readCustom1File, writeCustom1File); QSettings::Format custom2 = QSettings::registerFormat("custom2", readCustom2File, writeCustom2File #ifndef QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER @@ -322,7 +317,6 @@ tst_QSettings::tst_QSettings() ); QVERIFY(custom1 == QSettings::CustomFormat1); QVERIFY(custom2 == QSettings::CustomFormat2); -#endif } void tst_QSettings::init() @@ -1138,9 +1132,9 @@ void tst_QSettings::testVariantTypes() l4 << QVariant(m2) << QVariant(l2) << QVariant(l3); testVal("key13", l4, QVariantList, List); - // With Qt 4.2 we store key sequences as strings instead of binary variant blob, for improved + // We store key sequences as strings instead of binary variant blob, for improved // readability in the resulting format. - if (format >= QSettings::InvalidFormat || QT_VERSION < 0x040200) { + if (format >= QSettings::InvalidFormat) { testVal("keysequence", QKeySequence(Qt::ControlModifier + Qt::Key_F1), QKeySequence, KeySequence); } else { testVal("keysequence", QKeySequence(Qt::ControlModifier + Qt::Key_F1), QString, String); @@ -2637,14 +2631,12 @@ void tst_QSettings::testCaseSensitivity() case QSettings::IniFormat: cs = false; break; -#if QT_VERSION >= 0x040100 case QSettings::CustomFormat1: cs = true; break; case QSettings::CustomFormat2: cs = false; break; -#endif default: ; } @@ -3543,7 +3535,6 @@ void tst_QSettings::allKeys() } } -#if QT_VERSION >= 0x040100 void tst_QSettings::registerFormat() { QSettings settings1(QSettings::IniFormat, QSettings::UserScope, "software.org", "KillerAPP"); @@ -3641,7 +3632,6 @@ void tst_QSettings::setPath() TEST_PATH(i == 0, "custom2", CustomFormat2, SystemScope, "iota") } } -#endif void tst_QSettings::setDefaultFormat() { diff --git a/tests/auto/qsizef/tst_qsizef.cpp b/tests/auto/qsizef/tst_qsizef.cpp index 7668491..c1a827b 100644 --- a/tests/auto/qsizef/tst_qsizef.cpp +++ b/tests/auto/qsizef/tst_qsizef.cpp @@ -72,29 +72,6 @@ private slots: void transpose(); }; -#if QT_VERSION < 0x040100 -namespace QTest -{ - // Qt < 4.1 didn't do fuzzy comparisons - template<> - inline bool compare(QSizeF const &t1, QSizeF const &t2, const char *file, int line) - { - char msg[1024]; - msg[0] = '\0'; - bool isOk = true; - if ((qAbs(t1.width() - t2.width()) > 0.000000000001) || (qAbs(t1.height() - t2.height()) > 0.000000000001)) { - qt_snprintf(msg, 1024, "Compared values of type QSizeF are not the same (fuzzy compare).\n" - " Actual : w: %lf h: %lf \n" - " Expected: w: %lf h: %lf", t1.width(), t1.height(), t2.width(), t2.height()); - isOk = false; - } else { - qt_snprintf(msg, 1024, "QCOMPARE('%lf %lf', QSizeF)", t1.width(), t1.height()); - } - return compare_helper(isOk, msg, file, line); - } -} -#endif - tst_QSizeF::tst_QSizeF() { } diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index ee9daef..18aa5fc 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -132,6 +132,7 @@ private slots: void task248868_staticSorting(); void task248868_dynamicSorting(); void task250023_fetchMore(); + void task251296_hiddenChildren(); protected: void buildHierarchy(const QStringList &data, QAbstractItemModel *model); @@ -1508,9 +1509,6 @@ void tst_QSortFilterProxyModel::insertAfterSelect() QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, p); QVERIFY(view.selectionModel()->selectedIndexes().size() > 0); model.insertRows(5, 1, QModelIndex()); -#if QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Selections are not kept in versions < 4.2", Abort); -#endif QVERIFY(view.selectionModel()->selectedIndexes().size() > 0); // Should still have a selection } @@ -1532,9 +1530,6 @@ void tst_QSortFilterProxyModel::removeAfterSelect() QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, p); QVERIFY(view.selectionModel()->selectedIndexes().size() > 0); model.removeRows(5, 1, QModelIndex()); -#if QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Selections are not kept in versions < 4.2", Abort); -#endif QVERIFY(view.selectionModel()->selectedIndexes().size() > 0); // Should still have a selection } @@ -2602,7 +2597,11 @@ class QtTestModel: public QAbstractItemModel } void fetchMore(const QModelIndex &idx) { + if (fetched.contains(idx)) + return; + beginInsertRows(idx, 0, rows-1); fetched.insert(idx); + endInsertRows(); } bool hasChildren(const QModelIndex & = QModelIndex()) const { @@ -2613,7 +2612,7 @@ class QtTestModel: public QAbstractItemModel return fetched.contains(parent) ? rows : 0; } int columnCount(const QModelIndex& parent = QModelIndex()) const { - return fetched.contains(parent) ? cols : 0; + return cols; } QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const @@ -2677,6 +2676,47 @@ void tst_QSortFilterProxyModel::task250023_fetchMore() QCOMPARE(proxy.columnCount(idx), 10); } +void tst_QSortFilterProxyModel::task251296_hiddenChildren() +{ + QStandardItemModel model; + QSortFilterProxyModel proxy; + proxy.setSourceModel(&model); + proxy.setDynamicSortFilter(true); + + QStandardItem *itemA = new QStandardItem("A VISIBLE"); + model.appendRow(itemA); + QStandardItem *itemB = new QStandardItem("B VISIBLE"); + itemA->appendRow(itemB); + QStandardItem *itemC = new QStandardItem("C"); + itemA->appendRow(itemC); + proxy.setFilterRegExp("VISIBLE"); + + QCOMPARE(proxy.rowCount(QModelIndex()) , 1); + QPersistentModelIndex indexA = proxy.index(0,0); + QCOMPARE(proxy.data(indexA).toString(), QString::fromLatin1("A VISIBLE")); + + QCOMPARE(proxy.rowCount(indexA) , 1); + QPersistentModelIndex indexB = proxy.index(0, 0, indexA); + QCOMPARE(proxy.data(indexB).toString(), QString::fromLatin1("B VISIBLE")); + + itemA->setText("A"); + QCOMPARE(proxy.rowCount(QModelIndex()), 0); + QVERIFY(!indexA.isValid()); + QVERIFY(!indexB.isValid()); + + itemB->setText("B"); + itemA->setText("A VISIBLE"); + itemC->setText("C VISIBLE"); + + QCOMPARE(proxy.rowCount(QModelIndex()), 1); + indexA = proxy.index(0,0); + QCOMPARE(proxy.data(indexA).toString(), QString::fromLatin1("A VISIBLE")); + + QCOMPARE(proxy.rowCount(indexA) , 1); + QModelIndex indexC = proxy.index(0, 0, indexA); + QCOMPARE(proxy.data(indexC).toString(), QString::fromLatin1("C VISIBLE")); +} + QTEST_MAIN(tst_QSortFilterProxyModel) #include "tst_qsortfilterproxymodel.moc" diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 8d77589..074f16f 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -179,6 +179,10 @@ private slots: void task_217003(); #endif + void task_250026_data() { generic_data("QODBC"); } + void task_250026(); + + private: // returns all database connections void generic_data(const QString &engine=QString()); @@ -293,6 +297,7 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) #ifdef NOT_READY_YET tablenames << qTableName( "Planet" ); #endif + tablenames << qTableName( "task_250026" ); tst_Databases::safeDropTables( db, tablenames ); } @@ -2677,5 +2682,34 @@ void tst_QSqlQuery::task_217003() } #endif +void tst_QSqlQuery::task_250026() +{ + QString data258, data1026; + QFETCH( QString, dbName ); + QSqlDatabase db = QSqlDatabase::database( dbName ); + CHECK_DATABASE( db ); + QSqlQuery q( db ); + + QString tableName = qTableName( "task_250026" ); + + if ( !q.exec( "create table " + tableName + " (longfield varchar(1100))" ) ) { + qDebug() << "Error" << q.lastError(); + QSKIP( "Db doesn't support \"1100\" as a size for fields", SkipSingle ); + } + + data258.fill( 'A', 258 ); + data1026.fill( 'A', 1026 ); + QVERIFY_SQL( q, prepare( "insert into " + tableName + "(longfield) VALUES (:longfield)" ) ); + q.bindValue( "longfield", data258 ); + QVERIFY_SQL( q, exec() ); + q.bindValue( "longfield", data1026 ); + QVERIFY_SQL( q, exec() ); + QVERIFY_SQL( q, exec( "select * from " + tableName ) ); + QVERIFY_SQL( q, next() ); + QCOMPARE( q.value( 0 ).toString().length(), data258.length() ); + QVERIFY_SQL( q, next() ); + QCOMPARE( q.value( 0 ).toString().length(), data1026.length() ); +} + QTEST_MAIN( tst_QSqlQuery ) #include "tst_qsqlquery.moc" diff --git a/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp index a3322ab..84bda92 100644 --- a/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -115,7 +115,6 @@ private slots: void checkChildren(); void data(); void clear(); -#if QT_VERSION >= 0x040200 void sort_data(); void sort(); void sortRole_data(); @@ -133,10 +132,9 @@ private slots: void useCase1(); void useCase2(); void useCase3(); -#endif void rootItemFlags(); - void treeDragAndDrop(); + void treeDragAndDrop(); private: QAbstractItemModel *m_model; @@ -144,7 +142,7 @@ private: QVector<QModelIndex> rcParent; QVector<int> rcFirst; QVector<int> rcLast; - + //return true if models have the same structure, and all child have the same text bool compareModels(QStandardItemModel *model1, QStandardItemModel *model2); //return true if models have the same structure, and all child have the same text @@ -154,9 +152,7 @@ private: static const int defaultSize = 3; Q_DECLARE_METATYPE(QModelIndex) -#if QT_VERSION >= 0x040200 Q_DECLARE_METATYPE(QStandardItem*) -#endif Q_DECLARE_METATYPE(Qt::Orientation) Q_DECLARE_METATYPE(QVariantList) @@ -181,9 +177,7 @@ tst_QStandardItemModel::~tst_QStandardItemModel() void tst_QStandardItemModel::init() { qRegisterMetaType<QModelIndex>("QModelIndex"); -#if QT_VERSION >= 0x040200 qRegisterMetaType<QStandardItem*>("QStandardItem*"); -#endif qRegisterMetaType<Qt::Orientation>("Qt::Orientation"); m_model = new QStandardItemModel(defaultSize, defaultSize); @@ -768,7 +762,6 @@ void tst_QStandardItemModel::clear() QCOMPARE(model.hasChildren(), false); } -#if QT_VERSION >= 0x040200 void tst_QStandardItemModel::sort_data() { QTest::addColumn<int>("sortOrder"); @@ -1383,8 +1376,6 @@ void tst_QStandardItemModel::useCase3() delete childItem; } -#endif // QT_VERSION >= 0x040200 - void tst_QStandardItemModel::rootItemFlags() { QStandardItemModel model(6, 4); @@ -1426,7 +1417,7 @@ bool tst_QStandardItemModel::compareItems(QStandardItem *item1, QStandardItem *i } for (int row = 0; row < item1->columnCount(); row++) for (int col = 0; col < item1->columnCount(); col++) { - + if (!compareItems(item1->child(row, col), item2->child(row, col))) return false; } @@ -1438,19 +1429,19 @@ static QStandardItem *itemFromText(QStandardItem *parent, const QString &text) QStandardItem *item = 0; for(int i = 0; i < parent->columnCount(); i++) for(int j = 0; j < parent->rowCount(); j++) { - + QStandardItem *child = parent->child(j, i); - + if(!child) continue; - + if (child->text() == text) { if (item) { return 0; } item = child; } - + QStandardItem *candidate = itemFromText(child, text); if(candidate) { if (item) { @@ -1470,9 +1461,9 @@ static QModelIndex indexFromText(QStandardItemModel *model, const QString &text) } -struct FriendlyTreeView : public QTreeView +struct FriendlyTreeView : public QTreeView { - friend class tst_QStandardItemModel; + friend class tst_QStandardItemModel; Q_DECLARE_PRIVATE(QTreeView) }; @@ -1480,7 +1471,7 @@ void tst_QStandardItemModel::treeDragAndDrop() { const int nRow = 5; const int nCol = 3; - + QStandardItemModel model; QStandardItemModel checkModel; @@ -1489,13 +1480,13 @@ void tst_QStandardItemModel::treeDragAndDrop() for (int c = 0 ; c < nCol; c ++) colItems1 << new QStandardItem(QString("item %1 - %0").arg(c).arg(i)); model.appendRow(colItems1); - + for (int j = 0; j < nRow; ++j) { QList<QStandardItem *> colItems2; for (int c = 0 ; c < nCol; c ++) colItems2 << new QStandardItem(QString("item %1/%2 - %0").arg(c).arg(i).arg(j)); colItems1.at(0)->appendRow(colItems2); - + for (int k = 0; k < nRow; ++k) { QList<QStandardItem *> colItems3; for (int c = 0 ; c < nCol; c ++) @@ -1504,21 +1495,19 @@ void tst_QStandardItemModel::treeDragAndDrop() } } } - - - + for (int i = 0; i < nRow; ++i) { QList<QStandardItem *> colItems1; for (int c = 0 ; c < nCol; c ++) colItems1 << new QStandardItem(QString("item %1 - %0").arg(c).arg(i)); checkModel.appendRow(colItems1); - + for (int j = 0; j < nRow; ++j) { QList<QStandardItem *> colItems2; for (int c = 0 ; c < nCol; c ++) colItems2 << new QStandardItem(QString("item %1/%2 - %0").arg(c).arg(i).arg(j)); colItems1.at(0)->appendRow(colItems2); - + for (int k = 0; k < nRow; ++k) { QList<QStandardItem *> colItems3; for (int c = 0 ; c < nCol; c ++) @@ -1527,9 +1516,9 @@ void tst_QStandardItemModel::treeDragAndDrop() } } } - + QVERIFY(compareModels(&model, &checkModel)); - + FriendlyTreeView view; view.setModel(&model); view.expandAll(); @@ -1556,7 +1545,7 @@ void tst_QStandardItemModel::treeDragAndDrop() if(model.dropMimeData(data, Qt::MoveAction, 0, 0, indexFromText(&model, "item 4 - 0"))) view.d_func()->clearOrRemove(); delete data; - + QVERIFY(!compareModels(&model, &checkModel)); //the model must be different at this point QStandardItem *item4 = itemFromText(checkModel.invisibleRootItem(), "item 4 - 0"); item4->insertRow(0, checkModel.takeRow(1)); @@ -1564,7 +1553,6 @@ void tst_QStandardItemModel::treeDragAndDrop() QVERIFY(compareModels(&model, &checkModel)); } - // // step2 drag "item 3" and "item 3/0" into "item 4" // @@ -1572,10 +1560,10 @@ void tst_QStandardItemModel::treeDragAndDrop() selection->clear(); selection->select(QItemSelection(indexFromText(&model, QString("item 3 - 0")), indexFromText(&model, QString("item 3 - %0").arg(nCol-1))), QItemSelectionModel::Select); - + selection->select(QItemSelection(indexFromText(&model, QString("item 3/0 - 0")), indexFromText(&model, QString("item 3/0 - %0").arg(nCol-1))), QItemSelectionModel::Select); - + //code based from QAbstractItemView::startDrag and QAbstractItemView::dropEvent QModelIndexList indexes = view.selectedIndexes(); QMimeData *data = model.mimeData(indexes); diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp index e31e0db..cb30f83 100644 --- a/tests/auto/qstyle/tst_qstyle.cpp +++ b/tests/auto/qstyle/tst_qstyle.cpp @@ -70,10 +70,7 @@ #include <qlineedit.h> #include <qmdiarea.h> - -#if QT_VERSION >= 0x040200 #include <QCleanlooksStyle> -#endif #ifdef Q_WS_MAC #include <QMacStyle> @@ -343,7 +340,7 @@ void tst_QStyle::testPlastiqueStyle() void tst_QStyle::testCleanlooksStyle() { -#if QT_VERSION >= 0x040200 && !defined(QT_NO_STYLE_CLEANLOOKS) +#if !defined(QT_NO_STYLE_CLEANLOOKS) QCleanlooksStyle cstyle; testAllFunctions(&cstyle); lineUpLayoutTest(&cstyle); @@ -365,7 +362,7 @@ void tst_QStyle::testWindowsXPStyle() QWindowsXPStyle xpstyle; testAllFunctions(&xpstyle); lineUpLayoutTest(&xpstyle); -#else +#else QSKIP("No WindowsXP style", SkipAll); #endif } diff --git a/tests/auto/qsvgdevice/tst_qsvgdevice.cpp b/tests/auto/qsvgdevice/tst_qsvgdevice.cpp index 713b3fa..4f16e7e 100644 --- a/tests/auto/qsvgdevice/tst_qsvgdevice.cpp +++ b/tests/auto/qsvgdevice/tst_qsvgdevice.cpp @@ -332,11 +332,7 @@ void tst_QSvgDevice::playPaint( QPainter *p, const QString &type ) qDrawShadePanel(p,4000,5000,4000,2000,palette.active(),false,200,&br); qDrawShadeRect(p,2000,2000,4000,2000,palette.active(),true,100,0,&br); } - } -#if !defined (Q_WS_WIN) && (QT_VERSION < 0x030200) - // This will fail on X11 with 3.1, fixed in 3.2 -#else - else if (type=="clipRect") { + } else if (type=="clipRect") { p->setClipRect(15,25,10,10); p->drawEllipse(10,20,50,70); } else if (type=="multipleClipRects") { @@ -344,9 +340,7 @@ void tst_QSvgDevice::playPaint( QPainter *p, const QString &type ) p->drawEllipse(10,20,50,70); p->setClipRect(100,200,20,20); p->drawEllipse(110,220,50,70); - } -#endif - else if (type == "qsimplerichtext") { + } else if (type == "qsimplerichtext") { p->setPen(QColor(0,0,0)); p->setBrush(Qt::NoBrush); QRect rect1(10, 10, 100, 50); diff --git a/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp index 7ce30aa..8c5da7b 100644 --- a/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp +++ b/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp @@ -42,10 +42,6 @@ #include <QtTest/QtTest> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <qcoreapplication.h> #include <qdebug.h> #include <qsystemtrayicon.h> @@ -150,4 +146,3 @@ void tst_QSystemTrayIcon::lastWindowClosed() QTEST_MAIN(tst_QSystemTrayIcon) #include "tst_qsystemtrayicon.moc" -#endif diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp index 9364af4..f5155ae 100644 --- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp @@ -144,7 +144,6 @@ void tst_QTemporaryFile::fileTemplate_data() void tst_QTemporaryFile::fileTemplate() { -#if QT_VERSION >= 0x040200 QFETCH(QString, constructorTemplate); QFETCH(QString, suffix); QFETCH(QString, fileTemplate); @@ -157,7 +156,6 @@ void tst_QTemporaryFile::fileTemplate() QCOMPARE(file.fileName().right(suffix.length()), suffix); file.close(); -#endif } @@ -234,9 +232,6 @@ void tst_QTemporaryFile::write() void tst_QTemporaryFile::openCloseOpenClose() { -#if QT_VERSION < 0x040101 - QSKIP("Until Qt 4.1.1, QTemporaryFile would create a new name every time open() was called.", SkipSingle); -#endif QString fileName; { // Create a temp file @@ -248,7 +243,7 @@ void tst_QTemporaryFile::openCloseOpenClose() QVERIFY(QFile::exists(fileName)); file.close(); - // Check that it still exists after being closed + // Check that it still exists after being closed QVERIFY(QFile::exists(fileName)); QVERIFY(!file.isOpen()); QVERIFY(file.open()); diff --git a/tests/auto/qtextcursor/tst_qtextcursor.cpp b/tests/auto/qtextcursor/tst_qtextcursor.cpp index 48212a4..86b253f 100644 --- a/tests/auto/qtextcursor/tst_qtextcursor.cpp +++ b/tests/auto/qtextcursor/tst_qtextcursor.cpp @@ -124,9 +124,7 @@ private slots: void selectWordWithSeparators_data(); void selectWordWithSeparators(); void startOfWord(); -#if QT_VERSION >= 0x040100 void selectBlock(); -#endif void selectVisually(); void insertText(); @@ -1228,13 +1226,9 @@ void tst_QTextCursor::selectWord() cursor.movePosition(QTextCursor::EndOfBlock); cursor.select(QTextCursor::WordUnderCursor); -#if QT_VERSION < 0x040200 - QVERIFY(!cursor.hasSelection()); -#else QVERIFY(cursor.hasSelection()); QCOMPARE(cursor.selectionStart(), 17); QCOMPARE(cursor.selectionEnd(), 22); -#endif } void tst_QTextCursor::selectWordWithSeparators_data() @@ -1269,7 +1263,6 @@ void tst_QTextCursor::startOfWord() QCOMPARE(cursor.position(), 0); } -#if QT_VERSION >= 0x040100 void tst_QTextCursor::selectBlock() { cursor.insertText("foobar"); @@ -1295,7 +1288,6 @@ void tst_QTextCursor::selectBlock() QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter); QCOMPARE(cursor.block().text(), QString("blah")); } -#endif void tst_QTextCursor::selectVisually() { @@ -1551,7 +1543,6 @@ void tst_QTextCursor::update() void tst_QTextCursor::disallowSettingObjectIndicesOnCharFormats() { -#if QT_VERSION >= 0x040200 QTextCharFormat fmt; fmt.setObjectIndex(42); cursor.insertText("Hey", fmt); @@ -1581,7 +1572,6 @@ void tst_QTextCursor::disallowSettingObjectIndicesOnCharFormats() cursor = table->cellAt(0, 0).firstCursorPosition(); QVERIFY(!cursor.isNull()); QCOMPARE(cursor.blockCharFormat().objectIndex(), table->objectIndex()); -#endif } void tst_QTextCursor::blockAndColumnNumber() diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 58cc019..4ef5299 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -193,14 +193,9 @@ void tst_QTextDocument::getSetCheck() QPointer<MyAbstractTextDocumentLayout> var1 = new MyAbstractTextDocumentLayout(0); obj1.setDocumentLayout(var1); QCOMPARE(static_cast<QAbstractTextDocumentLayout *>(var1), obj1.documentLayout()); -#if QT_VERSION >= 0x040200 - // QTextDocument in Qt < 4.2 crashes on this. Qt >= 4.2 should handle this gracefully obj1.setDocumentLayout((QAbstractTextDocumentLayout *)0); QVERIFY(var1.isNull()); QVERIFY(obj1.documentLayout()); -#else - delete var1; -#endif // bool QTextDocument::useDesignMetrics() // void QTextDocument::setUseDesignMetrics(bool) @@ -672,18 +667,6 @@ void tst_QTextDocument::toHtml_data() << QString("<p DEFAULTBLOCKSTYLE><span style=\" font-size:40pt;\">Blah</span></p>"); } -#if QT_VERSION < 0x040200 - { - CREATE_DOC_AND_CURSOR(); - - QTextCharFormat fmt; - fmt.setProperty(QTextFormat::FontSizeIncrement, 2); - cursor.insertText("Blah", fmt); - - QTest::newRow("logical-font-size") << QTextDocumentFragment(&doc) - << QString("<p DEFAULTBLOCKSTYLE><font size=\"5\">Blah</font></p>"); - } -#else { CREATE_DOC_AND_CURSOR(); @@ -694,7 +677,6 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("logical-font-size") << QTextDocumentFragment(&doc) << QString("<p DEFAULTBLOCKSTYLE><span style=\" font-size:x-large;\">Blah</span></p>"); } -#endif { CREATE_DOC_AND_CURSOR(); @@ -892,13 +874,8 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("simpletable") << QTextDocumentFragment(&doc) << QString("<table border=\"1\" cellspacing=\"2\">" -#if QT_VERSION >= 0x040200 "\n<tr>\n<td></td>\n<td></td></tr>" "\n<tr>\n<td></td>\n<td></td></tr>" -#else - "<tr><td></td><td></td></tr>" - "<tr><td></td><td></td></tr>" -#endif "</table>"); } @@ -911,11 +888,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("tablespans") << QTextDocumentFragment(&doc) << QString("<table border=\"1\" cellspacing=\"2\">" -#if QT_VERSION >= 0x040200 "\n<tr>\n<td colspan=\"2\"></td>\n<td colspan=\"2\"></td></tr>" -#else - "<tr><td colspan=\"2\"></td><td colspan=\"2\"></td></tr>" -#endif "</table>"); } @@ -961,7 +934,6 @@ void tst_QTextDocument::toHtml_data() "</table>"); } -#if QT_VERSION >= 0x040200 { CREATE_DOC_AND_CURSOR(); @@ -977,7 +949,6 @@ void tst_QTextDocument::toHtml_data() "\n<tr>\n<td></td>\n<td></td></tr>" "</table>"); } -#endif { CREATE_DOC_AND_CURSOR(); @@ -988,13 +959,8 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("nestedtable") << QTextDocumentFragment(&doc) << QString("<table border=\"1\" cellspacing=\"2\">" -#if QT_VERSION >= 0x040200 "\n<tr>\n<td></td>\n<td>\n<table border=\"1\" cellspacing=\"2\">\n<tr>\n<td>\n<p DEFAULTBLOCKSTYLE>Hey</p></td></tr></table></td></tr>" "\n<tr>\n<td></td>\n<td></td></tr>" -#else - "<tr><td></td><td><table border=\"1\" cellspacing=\"2\"><tr><td><p DEFAULTBLOCKSTYLE>Hey</p></td></tr></table></td></tr>" - "<tr><td></td><td></td></tr>" -#endif "</table>"); } @@ -1011,11 +977,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("colwidths") << QTextDocumentFragment(&doc) << QString("<table border=\"1\" cellspacing=\"2\">" -#if QT_VERSION >= 0x040200 "\n<tr>\n<td></td>\n<td width=\"30%\"></td>\n<td width=\"40\"></td></tr>" -#else - "<tr><td></td><td width=\"30%\"></td><td width=\"40\"></td></tr>" -#endif "</table>"); } @@ -1032,11 +994,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("cellproperties") << QTextDocumentFragment(&doc) << QString("<table border=\"1\" cellspacing=\"2\">" -#if QT_VERSION >= 0x040200 "\n<tr>\n<td bgcolor=\"#ffffff\"></td></tr>" -#else - "<tr><td bgcolor=\"#ffffff\"></td></tr>" -#endif "</table>"); } @@ -1111,9 +1069,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("blockmargins") << QTextDocumentFragment(&doc) << -#if QT_VERSION >= 0x040100 QString("EMPTYBLOCK") + -#endif QString("<p style=\" margin-top:10px; margin-bottom:20px; margin-left:30px; margin-right:40px; -qt-block-indent:0; text-indent:0px;\">Blah</p>"); } @@ -1129,11 +1085,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("lists") << QTextDocumentFragment(&doc) << QString("EMPTYBLOCK") + -#if QT_VERSION >= 0x040200 QString("<ul style=\"-qt-list-indent: 1;\"><li DEFAULTBLOCKSTYLE>Blubb</li>\n<li DEFAULTBLOCKSTYLE>Blah</li></ul>"); -#else - QString("<ul style=\"-qt-list-indent: 1;\"><li DEFAULTBLOCKSTYLE>Blubb<li DEFAULTBLOCKSTYLE>Blah</ul>"); -#endif } { @@ -1156,11 +1108,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("charfmt-for-list-item") << QTextDocumentFragment(&doc) << QString("EMPTYBLOCK") + -#if QT_VERSION >= 0x040200 QString("<ul style=\"-qt-list-indent: 1;\"><li DEFAULTBLOCKSTYLE>Blubb</li>\n<li style=\" color:#0000ff;\" DEFAULTBLOCKSTYLE><span style=\" color:#ff0000;\">Blah</span></li></ul>"); -#else - QString("<ul style=\"-qt-list-indent: 1;\"><li DEFAULTBLOCKSTYLE>Blubb<li style=\" color:#0000ff;\" DEFAULTBLOCKSTYLE><span style=\" color:#ff0000;\">Blah</span></ul>"); -#endif } { @@ -1174,9 +1122,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("block-indent") << QTextDocumentFragment(&doc) << -#if QT_VERSION >= 0x040100 QString("EMPTYBLOCK") + -#endif QString("<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:3; text-indent:30px;\">Test</p>"); } @@ -1192,11 +1138,7 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("list-indent") << QTextDocumentFragment(&doc) << QString("EMPTYBLOCK") + -#if QT_VERSION >= 0x040200 QString("<ul style=\"-qt-list-indent: 4;\"><li DEFAULTBLOCKSTYLE>Blah</li></ul>"); -#else - QString("<ul style=\"-qt-list-indent: 4;\"><li DEFAULTBLOCKSTYLE>Blah</ul>"); -#endif } { @@ -1217,11 +1159,7 @@ void tst_QTextDocument::toHtml_data() // if you press enter twice in an empty textedit and then insert 'Test' // you actually get three visible paragraphs, two empty leading ones and // a third with the actual text. the corresponding html representation - // therefore should also contain three paragraphs. that only works in >= 4.1, - // 4.0.x needs this additional block. -#if QT_VERSION < 0x040100 - cursor.insertBlock(); -#endif + // therefore should also contain three paragraphs. cursor.insertBlock(); QTextCharFormat fmt; @@ -1232,16 +1170,10 @@ void tst_QTextDocument::toHtml_data() fmt.setProperty(QTextFormat::FontSizeIncrement, 2); cursor.insertText("Test", fmt); -#if QT_VERSION < 0x040200 - QTest::newRow("blockcharfmt") << QTextDocumentFragment(&doc) - << QString("EMPTYBLOCK<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#00ff00;\"><font size=\"4\"><font size=\"5\">Test</font></font></p>"); -#else QTest::newRow("blockcharfmt") << QTextDocumentFragment(&doc) << QString("EMPTYBLOCK<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:x-large; color:#00ff00;\">Test</span></p>"); -#endif } -#if QT_VERSION >= 0x040100 { CREATE_DOC_AND_CURSOR(); @@ -1254,7 +1186,6 @@ void tst_QTextDocument::toHtml_data() QTest::newRow("blockcharfmt2") << QTextDocumentFragment(&doc) << QString("<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#0000ff;\">Test</span></p>"); } -#endif { QTest::newRow("horizontal-ruler") << QTextDocumentFragment::fromHtml("<hr />") @@ -1285,11 +1216,7 @@ void tst_QTextDocument::toHtml_data() cursor = mainFrame->lastCursorPosition(); QTest::newRow("frame") << QTextDocumentFragment(&doc) -#if QT_VERSION >= 0x040200 << QString("<table border=\"1\" style=\"-qt-table-type: frame; float: right; margin-top:2px; margin-bottom:2px; margin-left:2px; margin-right:2px;\" width=\"100\" height=\"50\" bgcolor=\"#00ff00\">\n<tr>\n<td style=\"border: none;\">\n<p DEFAULTBLOCKSTYLE>Hello World</p></td></tr></table>"); -#else - << QString("<table border=\"1\" style=\"-qt-table-type: frame; float: right; margin-top:2px; margin-bottom:2px; margin-left:2px; margin-right:2px;\" width=\"100\" height=\"50\" bgcolor=\"#00ff00\"><tr><td style=\"border: none;\"><p DEFAULTBLOCKSTYLE>Hello World</p></td></tr></table>"); -#endif } { @@ -1993,11 +1920,7 @@ void tst_QTextDocument::resolvedFontInEmptyFormat() void tst_QTextDocument::defaultRootFrameMargin() { -#if QT_VERSION >= 0x040200 && QT_VERSION <= 0x040400 - QCOMPARE(doc->rootFrame()->frameFormat().margin(), 2.0); -#else QCOMPARE(doc->rootFrame()->frameFormat().margin(), 4.0); -#endif } class TestDocument : public QTextDocument @@ -2415,7 +2338,6 @@ void tst_QTextDocument::documentCleanup() void tst_QTextDocument::characterAt() { -#if QT_VERSION >= 0x040500 QTextDocument doc; QTextCursor cursor(&doc); QString text("12345\n67890"); @@ -2432,7 +2354,6 @@ void tst_QTextDocument::characterAt() c = QChar(QChar::ParagraphSeparator); QCOMPARE(doc.characterAt(i), c); } -#endif } void tst_QTextDocument::revisions() diff --git a/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index bace7b4..6edaee3 100644 --- a/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -2217,9 +2217,6 @@ void tst_QTextDocumentFragment::defaultFont() void tst_QTextDocumentFragment::html_spanBackgroundColor() { setHtml("<span style=\"background-color: blue\">Foo</span>"); -#if QT_VERSION <= 0x040100 - QEXPECT_FAIL("", "Fixed in >= 4.1.1", Continue); -#endif QVERIFY(doc->begin().begin().fragment().charFormat().background().color() == QColor(Qt::blue)); } @@ -2251,9 +2248,6 @@ void tst_QTextDocumentFragment::html_brokenTitle() void tst_QTextDocumentFragment::html_blockVsInline() { -#if QT_VERSION <= 0x040100 - QEXPECT_FAIL("", "Fixed in >= 4.1.1", Abort); -#endif { setHtml("<html><body><div><b>Foo<div>Bar"); QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold); @@ -2314,15 +2308,8 @@ void tst_QTextDocumentFragment::html_tbody() QTextTable *table = cursor.currentTable(); QVERIFY(table); QCOMPARE(table->columns(), 1); -#if QT_VERSION <= 0x040100 - QEXPECT_FAIL("", "Fixed in >= 4.1.1", Abort); -#endif QCOMPARE(table->rows(), 2); - -#if QT_VERISON >= 0x040200 QVERIFY(table->format().headerRowCount(), 1); -#endif - QCOMPARE(table->cellAt(0, 0).firstCursorPosition().block().text(), QString("First Cell")); QCOMPARE(table->cellAt(1, 0).firstCursorPosition().block().text(), QString("Second Cell")); } @@ -2380,7 +2367,6 @@ void tst_QTextDocumentFragment::html_nestedTables() void tst_QTextDocumentFragment::html_rowSpans() { -#if QT_VERSION > 0x040100 setHtml("" "<table border=\"1\" width=\"100%\">" " <tr>" @@ -2413,7 +2399,6 @@ void tst_QTextDocumentFragment::html_rowSpans() QCOMPARE(table->cellAt(3, 0).firstCursorPosition().block().text(), QString("blubb")); QCOMPARE(table->cellAt(3, 1).firstCursorPosition().block().text(), QString("baz")); -#endif } void tst_QTextDocumentFragment::html_rowSpans2() diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index 534c7b0..4ea3e2f 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -182,9 +182,6 @@ void tst_QTextLayout::init() testFont.setFamily("__Qt__Box__Engine__"); testFont.setPixelSize(TESTFONT_SIZE); testFont.setWeight(QFont::Normal); -#if defined(Q_WS_MAC) && QT_VERSION < 0x040200 - QSKIP("QTestFontEngine is not supported on the mac right now", SkipAll); -#endif QCOMPARE(QFontMetrics(testFont).width('a'), testFont.pixelSize()); } diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp index f70082d..c60e0bf 100644 --- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp @@ -533,7 +533,7 @@ void tst_QScriptEngine::bengali() void tst_QScriptEngine::gurmukhi() { -#if QT_VERSION >= 0x040001 && defined(Q_WS_X11) +#if defined(Q_WS_X11) { if (QFontDatabase().families(QFontDatabase::Gurmukhi).contains("Lohit Punjabi")) { QFont f("Lohit Punjabi"); diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp index 5a6cce8..358b4b6 100644 --- a/tests/auto/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/qtextstream/tst_qtextstream.cpp @@ -100,10 +100,8 @@ private slots: void readLineFromTextDevice_data(); void readLineFromTextDevice(); void readLineUntilNull(); -#if QT_VERSION >= 0x040103 void readLineMaxlen_data(); void readLineMaxlen(); -#endif void readLinesFromBufferCRCR(); // all @@ -220,13 +218,11 @@ private slots: void utf8IncompleteAtBufferBoundary_data(); void utf8IncompleteAtBufferBoundary(); -#if QT_VERSION >= 0x040100 // status void status_real_read_data(); void status_real_read(); void status_integer_read(); void status_word_read(); -#endif // use case tests void useCase1(); diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp index 6b6197a..235d63b 100644 --- a/tests/auto/qthread/tst_qthread.cpp +++ b/tests/auto/qthread/tst_qthread.cpp @@ -326,10 +326,6 @@ void tst_QThread::isRunning() void tst_QThread::setPriority() { -#if QT_VERSION < 0x040100 - QSKIP("QThread::setPriority() was introduced in 4.1.0, you are testing " QT_VERSION_STR, - SkipAll); -#else Simple_Thread thread; // cannot change the priority, since the thread is not running @@ -401,7 +397,6 @@ void tst_QThread::setPriority() QTest::ignoreMessage(QtWarningMsg, "QThread::setPriority: Cannot set priority, thread is not running"); thread.setPriority(QThread::TimeCriticalPriority); QCOMPARE(thread.priority(), QThread::InheritPriority); -#endif } void tst_QThread::priority() diff --git a/tests/auto/qtime/tst_qtime.cpp b/tests/auto/qtime/tst_qtime.cpp index ea4700d..cc91e9d 100644 --- a/tests/auto/qtime/tst_qtime.cpp +++ b/tests/auto/qtime/tst_qtime.cpp @@ -254,11 +254,7 @@ void tst_QTime::isNull() QTime t1; QVERIFY( t1.isNull() ); QTime t2(0,0,0); -#if QT_VERSION >= 0x040100 QVERIFY( !t2.isNull() ); -#else - QVERIFY( t2.isNull() ); -#endif QTime t3(0,0,1); QVERIFY( !t3.isNull() ); QTime t4(0,0,0,1); @@ -270,11 +266,7 @@ void tst_QTime::isNull() void tst_QTime::isValid() { QTime t1; -#if QT_VERSION >= 0x040100 QVERIFY( !t1.isValid() ); -#else - QVERIFY( t1.isValid() ); -#endif QTime t2(24,0,0,0); QVERIFY( !t2.isValid() ); QTime t3(23,60,0,0); @@ -599,11 +591,7 @@ void tst_QTime::fromString_data() QTest::newRow( "data0" ) << QString("00:00:00") << QTime(0,0,0,0) << QTime(0,0,0,0); QTest::newRow( "data1" ) << QString("10:12:34") << QTime(10,12,34,0) << QTime(10,12,34,0); QTest::newRow( "data2" ) << QString("19:03:54.998601") << QTime(19, 3, 54, 999) << QTime(19, 3, 54, 999); -#if QT_VERSION >= 0x040200 QTest::newRow( "data3" ) << QString("19:03:54.999601") << QTime(19, 3, 54, 999) << QTime(19, 3, 54, 999); -#else - QTest::newRow( "data3" ) << QString("19:03:54.999601") << QTime() << QTime(); -#endif } void tst_QTime::fromString() @@ -671,9 +659,7 @@ void tst_QTime::toString_format_data() QTest::newRow( "data2" ) << QTime(10,12,34,45) << QString("hh:m:ss:z") << QString("10:12:34:45"); QTest::newRow( "data3" ) << QTime(10,12,34,45) << QString("hh:ss ap") << QString("10:34 am"); QTest::newRow( "data4" ) << QTime(22,12,34,45) << QString("hh:zzz AP") << QString("10:045 PM"); -#if (QT_VERSION-0 >= 0x030200) QTest::newRow( "data5" ) << QTime(230,230,230,230) << QString("hh:mm:ss") << QString(); -#endif } void tst_QTime::toString_format() diff --git a/tests/auto/qtimeline/tst_qtimeline.cpp b/tests/auto/qtimeline/tst_qtimeline.cpp index e35f406..9576193 100644 --- a/tests/auto/qtimeline/tst_qtimeline.cpp +++ b/tests/auto/qtimeline/tst_qtimeline.cpp @@ -42,10 +42,6 @@ #include <QtTest/QtTest> -#if QT_VERSION < 0x040200 -QTEST_NOOP_MAIN -#else - #include <qtimeline.h> //TESTED_CLASS= @@ -705,5 +701,3 @@ void tst_QTimeLine::resume() QTEST_MAIN(tst_QTimeLine) #include "tst_qtimeline.moc" - -#endif //QT_VERSION diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index a96dbac..37cb5b0 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -475,11 +475,7 @@ void tst_QTreeView::construction() QCOMPARE(view.iconSize(), QSize()); QCOMPARE(view.indexAt(QPoint()), QModelIndex()); QVERIFY(!view.indexWidget(QModelIndex())); -#if QT_VERSION >= 0x040400 QVERIFY(qobject_cast<QStyledItemDelegate *>(view.itemDelegate())); -#else - QVERIFY(qobject_cast<QItemDelegate *>(view.itemDelegate())); -#endif QVERIFY(!view.itemDelegateForColumn(-1)); QVERIFY(!view.itemDelegateForColumn(0)); QVERIFY(!view.itemDelegateForColumn(1)); @@ -1004,11 +1000,7 @@ void tst_QTreeView::itemDelegate() { QTreeView view; -#if QT_VERSION >= 0x040400 QVERIFY(qobject_cast<QStyledItemDelegate *>(view.itemDelegate())); -#else - QVERIFY(qobject_cast<QItemDelegate *>(view.itemDelegate())); -#endif QPointer<QAbstractItemDelegate> oldDelegate = view.itemDelegate(); otherItemDelegate = new QItemDelegate; @@ -1683,9 +1675,16 @@ void tst_QTreeView::moveCursor() view.setColumnHidden(0, true); QVERIFY(view.isColumnHidden(0)); view.show(); + qApp->setActiveWindow(&view); - QModelIndex actual = view.moveCursor(PublicView::MoveDown, Qt::NoModifier); + //here the first visible index should be selected + //because the view got the focus QModelIndex expected = model.index(1, 1, QModelIndex()); + QCOMPARE(view.currentIndex(), expected); + + //then pressing down should go to the next line + QModelIndex actual = view.moveCursor(PublicView::MoveDown, Qt::NoModifier); + expected = model.index(2, 1, QModelIndex()); QCOMPARE(actual, expected); view.setRowHidden(0, QModelIndex(), false); @@ -1865,14 +1864,8 @@ void tst_QTreeView::indexBelow() i = view.indexBelow(i); QVERIFY(i.isValid()); QCOMPARE(i.row(), 1); -#if QT_VERSION >= 0x040100 i = view.indexBelow(i); QVERIFY(!i.isValid()); -#else - // Qt 4.0.x returns the bottom index - i = view.indexBelow(i); - QVERIFY(i.isValid()); -#endif } void tst_QTreeView::clicked() diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp index b21b240..c3595c2 100644 --- a/tests/auto/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp @@ -1555,9 +1555,6 @@ void tst_QTreeWidget::keyboardNavigation() void tst_QTreeWidget::scrollToItem() { -#if QT_VERSION < 0x040100 - QSKIP("This behaviour will be merged from main in 4.1.0.", SkipAll); -#else // Check if all parent nodes of the item found are expanded. // Reported in task #78761 QTreeWidgetItem *bar; @@ -1586,7 +1583,6 @@ void tst_QTreeWidget::scrollToItem() QVERIFY(testWidget->isItemExpanded(bar)); bar = bar->parent(); QVERIFY(testWidget->isItemExpanded(bar)); -#endif } // From task #85413 @@ -2087,7 +2083,6 @@ void tst_QTreeWidget::itemWidget() } } -#if QT_VERSION >= 0x040200 void tst_QTreeWidget::insertItemsWithSorting_data() { QTest::addColumn<int>("sortOrder"); @@ -2259,8 +2254,6 @@ void tst_QTreeWidget::insertExpandedItemsWithSorting_data() << (QStringList() << "h" << "g" << "f" << "e"); } - - // From Task 134978 void tst_QTreeWidget::insertExpandedItemsWithSorting() { @@ -2421,7 +2414,6 @@ void tst_QTreeWidget::changeDataWithSorting() QCOMPARE(dataChangedSpy.count(), 1); QCOMPARE(layoutChangedSpy.count(), reorderingExpected ? 1 : 0); } -#endif // QT_VERSION void tst_QTreeWidget::itemOperatorLessThan() { @@ -2599,7 +2591,6 @@ void tst_QTreeWidget::removeSelectedItem() QCOMPARE(selModel->isSelected(w->model()->index(0,0)), false); delete w; - } class AnotherTreeWidget : public QTreeWidget diff --git a/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp index 49abc6d..e4572c0 100644 --- a/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp +++ b/tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp @@ -42,8 +42,6 @@ #include <QtTest/QtTest> -#if QT_VERSION >= 0x040100 - #include <qtreewidget.h> #include <qtreewidgetitemiterator.h> #include <qapplication.h> @@ -61,7 +59,6 @@ public: tst_QTreeWidgetItemIterator(); ~tst_QTreeWidgetItemIterator(); - public slots: void initTestCase(); void cleanupTestCase(); @@ -136,7 +133,7 @@ void tst_QTreeWidgetItemIterator::initTestCase() case 9: top->setFlags(Qt::ItemIsEnabled);break; case 10: top->setFlags(Qt::ItemIsEnabled);break; - case 11: + case 11: top->setFlags(0); break; @@ -982,7 +979,6 @@ void tst_QTreeWidgetItemIterator::postdecrement() } - void tst_QTreeWidgetItemIterator::plus_eq_data() { QTest::addColumn<int>("start"); @@ -1146,9 +1142,9 @@ void tst_QTreeWidgetItemIterator::updateIteratorAfterDeletedItem_and_ContinueIte QTest::addColumn<int>("grandChildItems"); // Populate the tree data // we have one iterator pointing to an item in the tree. // This iterator will be updated if we delete the item it is pointing to. - // + // QTest::addColumn<int>("removeindex"); // The index of the node we want to remove - QTest::addColumn<int>("iterator_initial_index"); // The new expected index of + QTest::addColumn<int>("iterator_initial_index"); // The new expected index of QTest::addColumn<int>("iterator_advance_after_removal"); QTest::addColumn<QString>("iterator_new_value"); // The new current item value of the iterator QTest::newRow("Remove 13, it points to 25, it-=1. We should get top0,child2,grandchild2") << 3 << 3 << 3 << 13 << 25 << -1 << QString("top0,child2,grandchild2"); @@ -1245,7 +1241,3 @@ void tst_QTreeWidgetItemIterator::initializeIterator() QTEST_MAIN(tst_QTreeWidgetItemIterator) #include "tst_qtreewidgetitemiterator.moc" - -#else -QTEST_NOOP_MAIN -#endif diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp index 57e779c..e79be38 100644 --- a/tests/auto/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp @@ -522,9 +522,6 @@ void tst_QUdpSocket::bindMode() #endif } -#if QT_VERSION < 0x040100 - QSKIP("QUdpSocket::BindMode was added in Qt 4.1.", SkipAll); -#else QUdpSocket socket; QVERIFY2(socket.bind(), socket.errorString().toLatin1().constData()); QUdpSocket socket2; @@ -550,7 +547,6 @@ void tst_QUdpSocket::bindMode() QVERIFY(!socket2.bind(socket.localPort())); QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); #endif -#endif } void tst_QUdpSocket::writeDatagramToNonExistingPeer_data() diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index 3b938f2..5a79792 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -1129,11 +1129,7 @@ void tst_QUrl::setUrl() check("host",ulong.host(),"swww.gad.de"); check("path",ulong.path(),"/servlet/CookieAccepted"); -#if QT_VERSION < 300 - qt_set_locale_codec( KGlobal::charsets()->codecForName( "iso-8859-1" ) ); -#else QTextCodec::setCodecForLocale( KGlobal::charsets()->codecForName( "iso-8859-1" ) ); -#endif // UTF8 tests KURL uloc("/home/dfaure/konqtests/Matériel"); check("locale8bit",uloc.url().latin1(),"file:/home/dfaure/konqtests/Mat%E9riel"); // escaping the letter would be correct too @@ -1155,11 +1151,7 @@ void tst_QUrl::setUrl() uloc = KURL::fromPathOrURL( "" ); check("fromPathOrURL url", uloc.isValid()?"valid":"malformed", "malformed"); -#if QT_VERSION < 300 - qt_set_locale_codec( KGlobal::charsets()->codecForName( "koi8-r" ) ); -#else QTextCodec::setCodecForLocale( KGlobal::charsets()->codecForName( "koi8-r" ) ); -#endif baseURL = "file:/home/coolo"; KURL russian = baseURL.directory(false, true) + QString::fromLocal8Bit( "ÆÇÎ7" ); check( "russian", russian.url(), "file:/home/%C6%C7%CE7" ); diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index 78d597e..d15f9c8 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -2414,13 +2414,9 @@ void tst_QVariant::url() void tst_QVariant::globalColor() { -#if QT_VERSION >= 0x040200 QVariant variant(Qt::blue); QVERIFY(variant.type() == QVariant::Color); QVERIFY(qVariantValue<QColor>(variant) == QColor(Qt::blue)); -#else - QSKIP("Implemented/fixed in 4.2", SkipSingle); -#endif } void tst_QVariant::variantMap() diff --git a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp index b2305cb..1e0136f 100644 --- a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp @@ -161,9 +161,6 @@ public: void tst_QWaitCondition::wait_QMutex() { -#if defined(Q_OS_WIN32) && QT_VERSION < 0x030200 - QSKIP("Known race-conditions cause sporadic failures", SkipAll); -#else int x; for (int i = 0; i < iterations; ++i) { { @@ -240,7 +237,6 @@ void tst_QWaitCondition::wait_QMutex() } } } -#endif } void tst_QWaitCondition::wait_QReadWriteLock() @@ -446,9 +442,6 @@ int wake_Thread_2::count = 0; void tst_QWaitCondition::wakeOne() { -#if defined(Q_OS_WIN32) && QT_VERSION < 0x030200 - QSKIP("Known race-conditions cause sporadic failures", SkipAll); -#else int x; // wake up threads, one at a time for (int i = 0; i < iterations; ++i) { @@ -597,7 +590,7 @@ void tst_QWaitCondition::wakeOne() // QReadWriteLock QReadWriteLock readWriteLock; - wake_Thread_2 rwthread[ThreadCount]; + wake_Thread_2 rwthread[ThreadCount]; readWriteLock.lockForWrite(); for (x = 0; x < ThreadCount; ++x) { @@ -641,14 +634,10 @@ void tst_QWaitCondition::wakeOne() QCOMPARE(wake_Thread_2::count, 0); } -#endif } void tst_QWaitCondition::wakeAll() { -#if defined(Q_OS_WIN32) && QT_VERSION < 0x030200 - QSKIP("Known race-conditions cause sporadic failures", SkipAll); -#else int x; for (int i = 0; i < iterations; ++i) { QMutex mutex; @@ -715,7 +704,6 @@ void tst_QWaitCondition::wakeAll() QCOMPARE(exited, ThreadCount); QCOMPARE(wake_Thread_2::count, 0); } -#endif } class wait_RaceConditionThread : public QThread diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index cdffcc0..a557563 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -2576,9 +2576,6 @@ void tst_QWidget::setGeometry() void tst_QWidget::windowOpacity() { -#if defined(Q_WS_X11) && QT_VERSION < 0x040200 - QSKIP("QWidget::windowOpacity is broken in Qt < 4.2 on X11", SkipAll); -#else #ifdef Q_OS_WINCE QSKIP( "Windows CE does not support windowOpacity", SkipAll); #endif @@ -2588,43 +2585,27 @@ void tst_QWidget::windowOpacity() // Initial value should be 1.0 QCOMPARE(widget.windowOpacity(), 1.0); // children should always return 1.0 -#if QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Prior to 4.2, all children widgets returned 0.0", Continue); -#endif QCOMPARE(child.windowOpacity(), 1.0); widget.setWindowOpacity(0.0); QCOMPARE(widget.windowOpacity(), 0.0); child.setWindowOpacity(0.0); -#if QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Prior to 4.2, all children widgets returned 0.0", Continue); -#endif QCOMPARE(child.windowOpacity(), 1.0); widget.setWindowOpacity(1.0); QCOMPARE(widget.windowOpacity(), 1.0); child.setWindowOpacity(1.0); -#if QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Prior to 4.2, all children widgets returned 0.0", Continue); -#endif QCOMPARE(child.windowOpacity(), 1.0); widget.setWindowOpacity(2.0); QCOMPARE(widget.windowOpacity(), 1.0); child.setWindowOpacity(2.0); -#if QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Prior to 4.2, all children widgets returned 0.0", Continue); -#endif QCOMPARE(child.windowOpacity(), 1.0); widget.setWindowOpacity(-1.0); QCOMPARE(widget.windowOpacity(), 0.0); child.setWindowOpacity(-1.0); -#if QT_VERSION < 0x040200 - QEXPECT_FAIL("", "Prior to 4.2, all children widgets returned 0.0", Continue); -#endif QCOMPARE(child.windowOpacity(), 1.0); -#endif } class UpdateWidget : public QWidget @@ -5333,7 +5314,7 @@ void tst_QWidget::subtractOpaqueSiblings() { #ifdef QT_MAC_USE_COCOA QSKIP("Cocoa only has rect granularity.", SkipAll); -#elif defined(Q_WIDGET_USE_DIRTYLIST) || (QT_VERSION >= 0x040400) +#else QWidget w; w.setGeometry(50, 50, 300, 300); diff --git a/tests/auto/qwmatrix/tst_qwmatrix.cpp b/tests/auto/qwmatrix/tst_qwmatrix.cpp index 47fd41f..4a816a8 100644 --- a/tests/auto/qwmatrix/tst_qwmatrix.cpp +++ b/tests/auto/qwmatrix/tst_qwmatrix.cpp @@ -299,16 +299,12 @@ void tst_QWMatrix::mapping_data() void tst_QWMatrix::mapRect() { -#if QT_VERSION >= 0x030100 QFETCH( QMatrix, matrix ); QFETCH( QRect, src ); // qDebug( "got src: %d/%d (%d/%d), matrix=[ %f %f %f %f %f %f ]", -// src.x(), src.y(), src.width(), src.height(), -// matrix.m11(), matrix.m12(), matrix.m21(), matrix.m22(), matrix.dx(), matrix.dy() ); +// src.x(), src.y(), src.width(), src.height(), +// matrix.m11(), matrix.m12(), matrix.m21(), matrix.m22(), matrix.dx(), matrix.dy() ); QTEST( QPolygon( matrix.mapRect(src) ), "res" ); -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -#endif } void tst_QWMatrix::operator_star_qrect() @@ -349,7 +345,6 @@ void tst_QWMatrix::operator_star_qwmatrix() void tst_QWMatrix::assignments() { -#if QT_VERSION >= 0x040000 QMatrix m; m.scale(2, 3); m.rotate(45); @@ -371,24 +366,16 @@ void tst_QWMatrix::assignments() QCOMPARE(m.m22(), c2.m22()); QCOMPARE(m.dx(), c2.dx()); QCOMPARE(m.dy(), c2.dy()); -#else - QSKIP( "Not tested with Qt versions < 4.0", SkipAll); -#endif } void tst_QWMatrix::mapToPolygon() { -#if QT_VERSION >= 0x030100 QFETCH( QMatrix, matrix ); QFETCH( QRect, src ); QFETCH( QPolygon, res ); QCOMPARE( matrix.mapToPolygon( src ), res ); -#else - QSKIP( "Not tested with Qt versions < 3.1", SkipAll); -// qDebug("passing test; transformations are broken in 3.0.x" ); -#endif } diff --git a/tests/auto/qwritelocker/tst_qwritelocker.cpp b/tests/auto/qwritelocker/tst_qwritelocker.cpp index 21bfa8a..258309d 100644 --- a/tests/auto/qwritelocker/tst_qwritelocker.cpp +++ b/tests/auto/qwritelocker/tst_qwritelocker.cpp @@ -189,9 +189,6 @@ void tst_QWriteLocker::unlockAndRelockTest() void tst_QWriteLocker::lockerStateTest() { -#if QT_VERSION < 0x040200 - QSKIP("QWriteLocker doesn't keep state in Qt < 4.2", SkipAll); -#else class LockerStateThread : public tst_QWriteLockerThread { public: @@ -228,7 +225,6 @@ void tst_QWriteLocker::lockerStateTest() delete thread; thread = 0; -#endif } QTEST_MAIN(tst_QWriteLocker) diff --git a/tests/auto/rcc/tst_rcc.cpp b/tests/auto/rcc/tst_rcc.cpp index 3297b2b..57649b4 100644 --- a/tests/auto/rcc/tst_rcc.cpp +++ b/tests/auto/rcc/tst_rcc.cpp @@ -59,8 +59,6 @@ public: private slots: void rcc_data(); void rcc(); - -private: }; @@ -68,18 +66,9 @@ QString findExpectedFile(const QString &base) { QString expectedrccfile = base; - if (QT_VERSION >= 0x040500 && QFileInfo(expectedrccfile + QLatin1String(".450")).exists()) + // Must be updated with each minor release. + if (QFileInfo(expectedrccfile + QLatin1String(".450")).exists()) expectedrccfile += QLatin1String(".450"); - else if (QT_VERSION >= 0x040400 && QFileInfo(expectedrccfile + QLatin1String(".440")).exists()) - expectedrccfile += QLatin1String(".440"); - else if (QT_VERSION >= 0x040300 && QFileInfo(expectedrccfile + QLatin1String(".430")).exists()) - expectedrccfile += QLatin1String(".430"); - else if (QT_VERSION >= 0x040200 && QFileInfo(expectedrccfile + QLatin1String(".420")).exists()) - expectedrccfile += QLatin1String(".420"); - else if (QT_VERSION >= 0x040100 && QFileInfo(expectedrccfile + QLatin1String(".410")).exists()) - expectedrccfile += QLatin1String(".410"); - else if (QT_VERSION >= 0x040000 && QFileInfo(expectedrccfile + QLatin1String(".400")).exists()) - expectedrccfile += QLatin1String(".400"); return expectedrccfile; } diff --git a/tests/benchmarks/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/qimagereader/tst_qimagereader.cpp index ae7ecb2..1b5acb4 100644 --- a/tests/benchmarks/qimagereader/tst_qimagereader.cpp +++ b/tests/benchmarks/qimagereader/tst_qimagereader.cpp @@ -102,9 +102,7 @@ tst_QImageReader::tst_QImageReader() images << QPair<QString, QByteArray>(QLatin1String("4bpp-rle.bmp"), QByteArray("bmp")); images << QPair<QString, QByteArray>(QLatin1String("tst7.bmp"), QByteArray("bmp")); images << QPair<QString, QByteArray>(QLatin1String("16bpp.bmp"), QByteArray("bmp")); -#if QT_VERSION >= 0x040200 images << QPair<QString, QByteArray>(QLatin1String("negativeheight.bmp"), QByteArray("bmp")); -#endif images << QPair<QString, QByteArray>(QLatin1String("marble.xpm"), QByteArray("xpm")); images << QPair<QString, QByteArray>(QLatin1String("kollada.png"), QByteArray("png")); images << QPair<QString, QByteArray>(QLatin1String("teapot.ppm"), QByteArray("ppm")); diff --git a/tests/benchmarks/qobject/main.cpp b/tests/benchmarks/qobject/main.cpp index cd8b142..65833b8 100644 --- a/tests/benchmarks/qobject/main.cpp +++ b/tests/benchmarks/qobject/main.cpp @@ -42,12 +42,7 @@ #include <QtGui> #include <qtest.h> #include "object.h" - -#if QT_VERSION >= 0x040000 -# include <qcoreapplication.h> -#else -# include <qapplication.h> -#endif +#include <qcoreapplication.h> #include <qdatetime.h> enum { @@ -58,7 +53,7 @@ enum { class QObjectBenchmark : public QObject { Q_OBJECT -private slots: +private slots: void signal_slot_benchmark(); void signal_slot_benchmark_data(); void qproperty_benchmark_data(); @@ -82,13 +77,8 @@ void QObjectBenchmark::signal_slot_benchmark() Object singleObject; Object multiObject; -#if QT_VERSION >= 0x040000 singleObject.setObjectName("single"); multiObject.setObjectName("multi"); -#else - singleObject.setName("single"); - multiObject.setName("double"); -#endif singleObject.connect(&singleObject, SIGNAL(signal0()), SLOT(slot0())); diff --git a/tests/benchmarks/qpainter/tst_qpainter.cpp b/tests/benchmarks/qpainter/tst_qpainter.cpp index af2c412..60c099b 100644 --- a/tests/benchmarks/qpainter/tst_qpainter.cpp +++ b/tests/benchmarks/qpainter/tst_qpainter.cpp @@ -700,11 +700,7 @@ void tst_QPainter::compositionModes_data() QTest::addColumn<QSize>("size"); QTest::addColumn<QColor>("color"); -#if QT_VERSION >= 0x040500 const int n = QPainter::RasterOp_SourceAndNotDestination; -#else - const int n = QPainter::CompositionMode_Exclusion; -#endif for (int i = 0; i <= n; ++i) { QString title("%1:%2"); QTest::newRow(qPrintable(title.arg(i).arg("10x10:opaque"))) @@ -732,9 +728,7 @@ void tst_QPainter::compositionModes() src.fill(color); QPixmap dest(size); -#if QT_VERSION >= 0x040500 if (mode < QPainter::RasterOp_SourceOrDestination) -#endif color.setAlpha(127); // porter-duff needs an alpha channel dest.fill(color); |