diff options
Diffstat (limited to 'tests/auto')
7 files changed, 45 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index df7b397481..6fa222dd72 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -82,6 +82,12 @@ QT_END_NAMESPACE # include <qplatformdefs.h> #endif +#ifdef Q_OS_QNX +#ifdef open +#undef open +#endif +#endif + #include <stdio.h> #include <errno.h> diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index c4453fd5f2..f94c8eac4f 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -45,6 +45,7 @@ #include <qstandardpaths.h> #include <qfileinfo.h> #include <qsysinfo.h> +#include <qregexp.h> #ifdef Q_OS_UNIX #include <unistd.h> @@ -72,6 +73,7 @@ private slots: void testCustomRuntimeDirectory(); void testAllWritableLocations_data(); void testAllWritableLocations(); + void testCleanPath(); private: #ifdef Q_XDG_PLATFORM @@ -430,6 +432,18 @@ void tst_qstandardpaths::testAllWritableLocations() QCOMPARE(loc.endsWith(QLatin1Char('/')), false); } +void tst_qstandardpaths::testCleanPath() +{ + const QRegExp filter(QStringLiteral("\\\\")); + QVERIFY(filter.isValid()); + for (int i = 0; i <= QStandardPaths::GenericCacheLocation; ++i) { + const QStringList paths = QStandardPaths::standardLocations(QStandardPaths::StandardLocation(i)); + QVERIFY2(paths.filter(filter).isEmpty(), + qPrintable(QString::fromLatin1("Backslash found in %1 %2") + .arg(i).arg(paths.join(QLatin1Char(','))))); + } +} + QTEST_MAIN(tst_qstandardpaths) #include "tst_qstandardpaths.moc" diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index 5fb8df3f59..085dfd0461 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -718,6 +718,8 @@ void tst_QStandardItemModel::checkChildren() QVERIFY(!model.hasChildren()); QCOMPARE(model.rowCount(), 0); QCOMPARE(model.columnCount(), 1); + + QVERIFY(!model.index(0,0).sibling(100,100).isValid()); } void tst_QStandardItemModel::data() diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp index 6c5c90d737..3bae5d5103 100644 --- a/tests/auto/opengl/qgl/tst_qgl.cpp +++ b/tests/auto/opengl/qgl/tst_qgl.cpp @@ -78,7 +78,6 @@ private slots: void shareRegister(); void textureCleanup(); #endif - void graphicsViewClipping(); void partialGLWidgetUpdates_data(); void partialGLWidgetUpdates(); void glWidgetWithAlpha(); @@ -98,6 +97,7 @@ private slots: void destroyFBOAfterContext(); void threadImages(); void nullRectCrash(); + void graphicsViewClipping(); }; tst_QGL::tst_QGL() @@ -865,7 +865,11 @@ void tst_QGL::graphicsViewClipping() scene.setSceneRect(view.viewport()->rect()); - QVERIFY(QTest::qWaitForWindowActive(&view)); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + #ifdef Q_OS_MAC + // The black rectangle jumps from the center to the upper left for some reason. + QTest::qWait(100); + #endif QImage image = viewport->grabFrameBuffer(); QImage expected = image; diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index c1927c9d1f..78fce7661e 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -5430,7 +5430,7 @@ void tst_QWidget::setToolTip() QScopedPointer<QWidget> popup(new QWidget(0, Qt::Popup)); popup->setObjectName(QString::fromLatin1("tst_qwidget setToolTip #%1").arg(pass)); popup->setWindowTitle(popup->objectName()); - popup->resize(150, 50); + popup->setGeometry(50, 50, 150, 50); QFrame *frame = new QFrame(popup.data()); frame->setGeometry(0, 0, 50, 50); frame->setFrameStyle(QFrame::Box | QFrame::Plain); diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 210e52f0aa..3fa669c1fb 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -3902,6 +3902,11 @@ void tst_QLineEdit::inputMethod() // removing focus allows input method to commit preedit testWidget->setText(""); testWidget->activateWindow(); + // TODO setFocus should not be necessary here, because activateWindow + // should focus it, and the window is the QLineEdit. But the test can fail + // on Windows if we don't do this. If each test had a unique QLineEdit + // instance, maybe such problems would go away. + testWidget->setFocus(); QTRY_VERIFY(testWidget->hasFocus()); QTRY_COMPARE(qApp->focusObject(), testWidget); diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp index 5ad9aa7690..0696aa11d2 100644 --- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp @@ -113,7 +113,9 @@ void tst_QProgressBar::minMaxSameValue() QProgressBar bar; bar.setRange(10, 10); bar.setValue(10); + bar.move(300, 300); bar.show(); + QVERIFY(QTest::qWaitForWindowExposed(&bar)); } void tst_QProgressBar::destroyIndeterminate() @@ -123,7 +125,9 @@ void tst_QProgressBar::destroyIndeterminate() // it's deleted. QPointer<QProgressBar> bar = new QProgressBar; bar->setMaximum(0); + bar->move(300, 300); bar->show(); + QVERIFY(QTest::qWaitForWindowExposed(bar.data())); QEventLoop loop; QTimer::singleShot(500, bar, SLOT(deleteLater())); @@ -166,8 +170,10 @@ void tst_QProgressBar::format() ProgressBar bar; bar.setRange(0, 10); bar.setValue(1); + bar.move(300, 300); bar.show(); QVERIFY(QTest::qWaitForWindowExposed(&bar)); + QVERIFY(QTest::qWaitForWindowExposed(&bar)); QTest::qWait(20); bar.repainted = false; @@ -202,6 +208,7 @@ void tst_QProgressBar::setValueRepaint() pbar.setMinimum(0); pbar.setMaximum(10); pbar.setFormat("%v"); + pbar.move(300, 300); pbar.show(); QVERIFY(QTest::qWaitForWindowExposed(&pbar)); @@ -224,7 +231,9 @@ void tst_QProgressBar::setMinMaxRepaint() pbar.setMinimum(0); pbar.setMaximum(10); pbar.setFormat("%v"); + pbar.move(300, 300); pbar.show(); + qApp->setActiveWindow(&pbar); QVERIFY(QTest::qWaitForWindowActive(&pbar)); // No repaint when setting minimum to the current minimum @@ -319,7 +328,9 @@ void tst_QProgressBar::task245201_testChangeStyleAndDelete() QStyle *style = QStyleFactory::create(style1_str); bar->setStyle(style); + bar->move(300, 300); bar->show(); + QVERIFY(QTest::qWaitForWindowExposed(bar)); QStyle *style2 = QStyleFactory::create(style2_str); bar->setStyle(style2); QTest::qWait(10); |