diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-26 09:45:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-26 09:45:55 +0200 |
commit | 08585f02dc0eb8dc5567f47c55915540c0a34e01 (patch) | |
tree | d509ccc2e90e13620ef423cb099262cd88919c0a /tests | |
parent | 55145c52677e961804b7b3a725652bd5ce1e0269 (diff) | |
parent | 4c231d5df3040dbf4545a9a77145ee0e1f9c380c (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'tests')
16 files changed, 136 insertions, 30 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index ad31956f62..77cf81989a 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -70,8 +70,8 @@ if (NOT NO_DBUS) expect_pass(test_dbus_module) endif() expect_pass(test_multiple_find_package) -if (NOT WIN32) - # Currently broken on windows. Reported upstream: +if (NOT WIN32 OR (WIN32 AND NOT CMAKE_VERSION VERSION_LESS 2.8.11)) + # Broken on windows on earlier CMake versions. # http://public.kitware.com/Bug/view.php?id=13392 expect_pass(test_add_resources_delayed_file) endif() diff --git a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp index 4a43ea8201..3653fdb9e0 100644 --- a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp @@ -149,20 +149,25 @@ void tst_QBuffer::readBlock() const int arraySize = 10; char a[arraySize]; QBuffer b; + QCOMPARE(b.bytesAvailable(), (qint64) 0); // no data QCOMPARE(b.read(a, arraySize), (qint64) -1); // not opened QVERIFY(b.atEnd()); QByteArray ba; ba.resize(arraySize); b.setBuffer(&ba); + QCOMPARE(b.bytesAvailable(), (qint64) arraySize); b.open(QIODevice::WriteOnly); + QCOMPARE(b.bytesAvailable(), (qint64) arraySize); QTest::ignoreMessage(QtWarningMsg, "QIODevice::read: WriteOnly device"); QCOMPARE(b.read(a, arraySize), (qint64) -1); // no read access b.close(); b.open(QIODevice::ReadOnly); + QCOMPARE(b.bytesAvailable(), (qint64) arraySize); QCOMPARE(b.read(a, arraySize), (qint64) arraySize); QVERIFY(b.atEnd()); + QCOMPARE(b.bytesAvailable(), (qint64) 0); // up to 3.0.x reading beyond the end was an error while ok // this has been made consistent with other QIODevice sub classes in 3.1 @@ -172,10 +177,13 @@ void tst_QBuffer::readBlock() // read in two chunks b.close(); b.open(QIODevice::ReadOnly); + QCOMPARE(b.bytesAvailable(), (qint64) arraySize); QCOMPARE(b.read(a, arraySize/2), (qint64) arraySize/2); + QCOMPARE(b.bytesAvailable(), (qint64) arraySize/2); QCOMPARE(b.read(a + arraySize/2, arraySize - arraySize/2), (qint64)(arraySize - arraySize/2)); QVERIFY(b.atEnd()); + QCOMPARE(b.bytesAvailable(), (qint64) 0); } void tst_QBuffer::readBlockPastEnd() @@ -319,9 +327,12 @@ void tst_QBuffer::seekTest() buf.open(QIODevice::ReadWrite); QCOMPARE(buf.pos(), qint64(0)); + QCOMPARE(buf.bytesAvailable(), qint64(0)); QByteArray data = str.toLatin1(); QCOMPARE(buf.write( data.constData(), data.size() ), qint64(data.size())); + QCOMPARE(buf.bytesAvailable(), qint64(0)); // we're at the end + QCOMPARE(buf.size(), qint64(data.size())); QTest::ignoreMessage(QtWarningMsg, "QBuffer::seek: Invalid pos: -1"); DO_INVALID_SEEK(-1); @@ -336,6 +347,7 @@ void tst_QBuffer::seekTest() { char c = 'a'; QVERIFY(buf.seek(qint64(str.size()))); + QCOMPARE(buf.bytesAvailable(), qint64(0)); QCOMPARE(buf.read(&c, qint64(1)), qint64(0)); QCOMPARE(c, 'a'); QCOMPARE(buf.write(&c, qint64(1)), qint64(1)); @@ -347,6 +359,7 @@ void tst_QBuffer::seekTest() const int offset = 1; // any positive integer will do const qint64 pos = buf.size() + offset; QVERIFY(buf.seek(pos)); + QCOMPARE(buf.bytesAvailable(), qint64(0)); QCOMPARE(buf.pos(), pos); QVERIFY(!buf.getChar(&c)); QVERIFY(buf.seek(pos - 1)); @@ -533,7 +546,11 @@ void tst_QBuffer::readLineBoundaries() lineByLine.append(buffer.readLine()); buffer.seek(0); - QCOMPARE(lineByLine, buffer.readAll()); + QCOMPARE(buffer.bytesAvailable(), lineByLine.size()); + + QByteArray all = buffer.readAll(); + QCOMPARE(all.size(), lineByLine.size()); + QCOMPARE(all, lineByLine); } // Test that any character in a buffer can be read and pushed back. @@ -548,7 +565,9 @@ void tst_QBuffer::getAndUngetChar() // Take a copy of the data held in the buffer buffer.seek(0); + QCOMPARE(buffer.bytesAvailable(), buffer.size()); QByteArray data = buffer.readAll(); + QCOMPARE(buffer.bytesAvailable(), qint64(0)); // Get and unget each character in order for (qint64 i = 0; i < buffer.size(); ++i) { @@ -570,7 +589,9 @@ void tst_QBuffer::getAndUngetChar() // Verify that the state of the buffer still matches the original data. buffer.seek(0); + QCOMPARE(buffer.bytesAvailable(), data.size()); QCOMPARE(buffer.readAll(), data); + QCOMPARE(buffer.bytesAvailable(), qint64(0)); } void tst_QBuffer::writeAfterQByteArrayResize() diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 929865d4d6..cca4655f58 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1057,7 +1057,7 @@ void tst_QFile::ungetChar() QCOMPARE(buf[2], '4'); } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) QString driveLetters() { wchar_t volumeName[MAX_PATH]; @@ -1094,7 +1094,9 @@ void tst_QFile::invalidFile_data() #if !defined(Q_OS_WIN) QTest::newRow( "x11" ) << QString( "qwe//" ); #else +#if !defined(Q_OS_WINCE) QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid"); +#endif QTest::newRow( "colon3" ) << QString( ":failinvalid" ); QTest::newRow( "forwardslash" ) << QString( "fail/invalid" ); QTest::newRow( "asterisk" ) << QString( "fail*invalid" ); diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro index 561b7ed9cc..5009fedc4f 100644 --- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro +++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro @@ -5,11 +5,11 @@ SOURCES = tst_qmetatype.cpp TESTDATA=./typeFlags.bin DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -win32-msvc* { +win32-msvc*|wince { # Prevents "fatal error C1128: number of sections exceeded object file format limit". QMAKE_CXXFLAGS += /bigobj # Reduce compile time - win32-msvc2012 { + win32-msvc2012|wince { QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CFLAGS_RELEASE -= -O2 } diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index b84039f557..6cfcf74069 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -478,7 +478,12 @@ void tst_QDateTime::setMSecsSinceEpoch_data() // positive value 1 too big for qint64max, causing an overflow. << std::numeric_limits<qint64>::min() + 1 << QDateTime(QDate(-292275056, 5, 16), QTime(16, 47, 4, 193), Qt::UTC) +#ifdef Q_OS_WIN + // Windows applies Daylight Time to dates before 1980, Olsen does not + << QDateTime(QDate(-292275056, 5, 16), QTime(18, 47, 4, 193), Qt::LocalTime); +#else << QDateTime(QDate(-292275056, 5, 16), QTime(17, 47, 4, 193), Qt::LocalTime); +#endif QTest::newRow("max") << std::numeric_limits<qint64>::max() << QDateTime(QDate(292278994, 8, 17), QTime(7, 12, 55, 807), Qt::UTC) @@ -844,10 +849,20 @@ void tst_QDateTime::toTimeSpec_data() QTest::newRow("-271821/4/20 00:00 UTC (JavaScript min date, start of day)") << QDateTime(QDate(-271821, 4, 20), QTime(0, 0, 0), Qt::UTC) +#ifdef Q_OS_WIN + // Windows applies Daylight Time to dates before 1980, Olsen does not + << QDateTime(QDate(-271821, 4, 20), QTime(2, 0, 0), Qt::LocalTime); +#else << QDateTime(QDate(-271821, 4, 20), QTime(1, 0, 0), Qt::LocalTime); +#endif QTest::newRow("-271821/4/20 23:00 UTC (JavaScript min date, end of day)") << QDateTime(QDate(-271821, 4, 20), QTime(23, 0, 0), Qt::UTC) +#ifdef Q_OS_WIN + // Windows applies Daylight Time to dates before 1980, Olsen does not + << QDateTime(QDate(-271821, 4, 21), QTime(1, 0, 0), Qt::LocalTime); +#else << QDateTime(QDate(-271821, 4, 21), QTime(0, 0, 0), Qt::LocalTime); +#endif QTest::newRow("QDate min") << QDateTime(QDate::fromJulianDay(minJd()), QTime(0, 0, 0), Qt::UTC) diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp index 2932387bdb..108ec466c9 100644 --- a/tests/auto/other/networkselftest/tst_networkselftest.cpp +++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp @@ -41,8 +41,7 @@ #include <QtTest/QtTest> #include <QtNetwork/QtNetwork> - -#include <time.h> +#include <QtCore/QDateTime> #ifndef QT_NO_BEARERMANAGEMENT #include <QtNetwork/qnetworkconfigmanager.h> @@ -531,13 +530,9 @@ void tst_NetworkSelfTest::imapServer() void tst_NetworkSelfTest::httpServer() { - QString uniqueExtension; - qsrand(time(0)); -#ifndef Q_OS_WINCE - uniqueExtension = QString("%1%2%3").arg((qulonglong)this).arg(qrand()).arg((qulonglong)time(0)); -#else - uniqueExtension = QString("%1%2").arg((qulonglong)this).arg(qrand()); -#endif + QByteArray uniqueExtension = QByteArray::number((qulonglong)this) + + QByteArray::number((qulonglong)qrand()) + + QByteArray::number((qulonglong)QDateTime::currentDateTime().toTime_t()); netChat(80, QList<Chat>() // HTTP/0.9 chat: @@ -603,7 +598,7 @@ void tst_NetworkSelfTest::httpServer() // HTTP/1.0 PUT << Chat::Reconnect - << Chat::send("PUT /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n" + << Chat::send("PUT /dav/networkselftest-" + uniqueExtension + ".txt HTTP/1.0\r\n" "Content-Length: 5\r\n" "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" "Connection: close\r\n" @@ -616,7 +611,7 @@ void tst_NetworkSelfTest::httpServer() // check that the file did get uploaded << Chat::Reconnect - << Chat::send("HEAD /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n" + << Chat::send("HEAD /dav/networkselftest-" + uniqueExtension + ".txt HTTP/1.0\r\n" "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" "Connection: close\r\n" "\r\n") @@ -628,7 +623,7 @@ void tst_NetworkSelfTest::httpServer() // HTTP/1.0 DELETE << Chat::Reconnect - << Chat::send("DELETE /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n" + << Chat::send("DELETE /dav/networkselftest-" + uniqueExtension + ".txt HTTP/1.0\r\n" "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" "Connection: close\r\n" "\r\n") diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro index 071b0bb66c..70f6633195 100644 --- a/tests/auto/other/qaccessibility/qaccessibility.pro +++ b/tests/auto/other/qaccessibility/qaccessibility.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_qaccessibility requires(contains(QT_CONFIG,accessibility)) -QT += testlib gui-private widgets-private +QT += testlib core-private gui-private widgets-private SOURCES += tst_qaccessibility.cpp unix:!mac:LIBS+=-lm diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 4e0b3298fc..af8e4472ed 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -63,6 +63,9 @@ #include <QtWidgets/private/qaccessiblewidget_p.h> #include <math.h> #include <qpa/qplatformnativeinterface.h> +#include <qpa/qplatformintegration.h> +#include <qpa/qplatformaccessibility.h> +#include <QtGui/private/qguiapplication_p.h> #if defined(Q_OS_WIN) && defined(interface) # undef interface @@ -311,6 +314,8 @@ void tst_QAccessibility::onClicked() void tst_QAccessibility::initTestCase() { QTestAccessibility::initialize(); + QPlatformIntegration *pfIntegration = QGuiApplicationPrivate::platformIntegration(); + pfIntegration->accessibility()->setActive(true); } void tst_QAccessibility::cleanupTestCase() diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp index 15b8089525..79fd29f2a1 100644 --- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp +++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp @@ -55,6 +55,7 @@ #include <QDBusReply> #include "atspi/atspi-constants.h" +#include "bus_interface.h" #include "dbusconnection_p.h" #include "struct_marshallers_p.h" @@ -154,16 +155,21 @@ QDBusInterface *tst_QAccessibilityLinux::getInterface(const QString &path, const return new QDBusInterface(address, path, interfaceName, dbus.connection(), this); } - void tst_QAccessibilityLinux::initTestCase() { // Oxygen style creates many extra items, it's simply unusable here qApp->setStyle("fusion"); qApp->setApplicationName("tst_QAccessibilityLinux app"); + // Pretend we are a screen reader + QDBusConnection c = QDBusConnection::sessionBus(); + OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(QStringLiteral("org.a11y.Bus"), QStringLiteral("/org/a11y/bus"), c, this); + a11yStatus->setScreenReaderEnabled(true); + QTRY_VERIFY(dbus.isEnabled()); QTRY_VERIFY(dbus.connection().isConnected()); address = dbus.connection().baseService().toLatin1().data(); + QVERIFY(!address.isEmpty()); m_window = new AccessibleTestWindow(); m_window->show(); diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index c8ea74e6b2..b117edddd4 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -119,6 +119,8 @@ private slots: void taskQTBUG4497_reusePrinterOnDifferentFiles(); void testPdfTitle(); + void testPageMetrics_data(); + void testPageMetrics(); #endif }; @@ -1108,6 +1110,42 @@ void tst_QPrinter::testPdfTitle() const char *expected = reinterpret_cast<const char*>(expectedBuf); QVERIFY(file.readAll().contains(QByteArray(expected, 26))); } + +void tst_QPrinter::testPageMetrics_data() +{ + QTest::addColumn<int>("pageSize"); + QTest::addColumn<int>("widthMM"); + QTest::addColumn<int>("heightMM"); + QTest::addColumn<float>("widthMMf"); + QTest::addColumn<float>("heightMMf"); + + QTest::newRow("A4") << int(QPrinter::A4) << 210 << 297 << 210.0f << 297.0f; + QTest::newRow("A5") << int(QPrinter::A5) << 148 << 210 << 148.0f << 210.0f; + QTest::newRow("Letter") << int(QPrinter::Letter) << 216 << 279 << 215.9f << 279.4f; +} + +void tst_QPrinter::testPageMetrics() +{ + QFETCH(int, pageSize); + QFETCH(int, widthMM); + QFETCH(int, heightMM); + QFETCH(float, widthMMf); + QFETCH(float, heightMMf); + + QPrinter printer(QPrinter::HighResolution); + printer.setFullPage(true); + printer.setPageSize(QPrinter::PageSize(pageSize)); + + if (printer.pageSize() != pageSize) { + QSKIP("Current page size is not supported on this printer"); + return; + } + + QCOMPARE(printer.widthMM(), int(widthMM)); + QCOMPARE(printer.heightMM(), int(heightMM)); + QCOMPARE(printer.pageSizeMM(), QSizeF(widthMMf, heightMMf)); +} + #endif // QT_NO_PRINTER QTEST_MAIN(tst_QPrinter) diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp index eebfdfac65..e215fd1086 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp @@ -661,7 +661,7 @@ void _scrollBarRanges_data() } const QScreen *screen = QGuiApplication::primaryScreen(); - if (screen && qFuzzyCompare(screen->logicalDotsPerInchX(), 96.0)) { + if (screen && qFuzzyCompare((double)screen->logicalDotsPerInchX(), 96.0)) { _scrollBarRanges_addTestData(QString("motif"), false); _scrollBarRanges_addTestData(QString("motif"), true); } diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index ef91d6d3d2..fc94f95f8e 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -548,7 +548,7 @@ void tst_QStyle::testMacStyle() void tst_QStyle::testWindowsCEStyle() { QStyle *cstyle = QStyleFactory::create("WindowsCE"); - QVERIFY(testAllFunctions(&cstyle)); + QVERIFY(testAllFunctions(cstyle)); delete cstyle; } #endif @@ -558,7 +558,7 @@ void tst_QStyle::testWindowsCEStyle() void tst_QStyle::testWindowsMobileStyle() { QStyle *cstyle = QStyleFactory::create("WindowsMobile"); - QVERIFY(testAllFunctions(&cstyle)); + QVERIFY(testAllFunctions(cstyle)); delete cstyle; } #endif diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index e48316fd19..3c32b8a476 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -101,6 +101,7 @@ private slots: void pushButtonPopulateOnAboutToShow(); void QTBUG7907_submenus_autoselect(); void QTBUG7411_submenus_activate(); + void QTBUG30595_rtl_submenu(); void QTBUG20403_nested_popup_on_shortcut_trigger(); void QTBUG_10735_crashWithDialog(); protected slots: @@ -896,6 +897,22 @@ void tst_QMenu::QTBUG7411_submenus_activate() QTRY_VERIFY(sub1.isVisible()); } +void tst_QMenu::QTBUG30595_rtl_submenu() +{ + QMenu menu("Test Menu"); + menu.setLayoutDirection(Qt::RightToLeft); + QMenu sub("&sub"); + sub.addAction("bar"); + sub.setTitle("&sub"); + menu.addMenu(&sub); + menu.move(200, 20); + menu.show(); + QVERIFY(QTest::qWaitForWindowExposed(&menu)); + QTest::mouseClick(&menu, Qt::LeftButton, Qt::NoModifier, QPoint(5,5) ); + QTRY_VERIFY(sub.isVisible()); + QVERIFY(sub.pos().x() < menu.pos().x()); +} + void tst_QMenu::QTBUG20403_nested_popup_on_shortcut_trigger() { QMenu menu("Test Menu"); diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp index 89b7bc6790..a64b34c56a 100644 --- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp @@ -138,7 +138,7 @@ private slots: void integerOverflow(); void taskQTBUG_5008_textFromValueAndValidate(); - + void lineEditReturnPressed(); public slots: void valueChangedHelper(const QString &); void valueChangedHelper(int); @@ -1044,5 +1044,14 @@ void tst_QSpinBox::integerOverflow() QCOMPARE(sb.value(), INT_MIN); } +void tst_QSpinBox::lineEditReturnPressed() +{ + SpinBox spinBox; + QSignalSpy spyCurrentChanged(spinBox.lineEdit(), SIGNAL(returnPressed())); + spinBox.show(); + QTest::keyClick(&spinBox, Qt::Key_Return); + QCOMPARE(spyCurrentChanged.count(), 1); +} + QTEST_MAIN(tst_QSpinBox) #include "tst_qspinbox.moc" diff --git a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp index 0b569cc49d..8d388751d5 100644 --- a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp +++ b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp @@ -46,7 +46,7 @@ class tst_QProcess : public QObject { Q_OBJECT -#ifndef QT_NO_PROCESS +#if !defined(QT_NO_PROCESS) && !defined(Q_OS_WINCE) private slots: void echoTest_performance(); @@ -54,8 +54,7 @@ private slots: #endif // QT_NO_PROCESS }; -#ifndef QT_NO_PROCESS -#ifndef Q_OS_WINCE +#if !defined(QT_NO_PROCESS) && !defined(Q_OS_WINCE) // Reading and writing to a process is not supported on Qt/CE void tst_QProcess::echoTest_performance() { @@ -101,9 +100,8 @@ void tst_QProcess::echoTest_performance() process.closeWriteChannel(); QVERIFY(process.waitForFinished()); } -#endif // Q_OS_WINCE -#endif // QT_NO_PROCESS +#endif // QT_NO_PROCESS && Q_OS_WINCE QTEST_MAIN(tst_QProcess) #include "tst_bench_qprocess.moc" diff --git a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro index bfea404980..abfebad2aa 100644 --- a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro +++ b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro @@ -3,5 +3,5 @@ TARGET = tst_bench_qsqlquery SOURCES += main.cpp QT = core sql testlib core-private sql-private -win32: LIBS += -lws2_32 +LIBS += $$QMAKE_LIBS_NETWORK DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 |