diff options
Diffstat (limited to 'tests')
251 files changed, 1923 insertions, 277 deletions
diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro index 6810f76..cb1f2ef 100644 --- a/tests/auto/corelib.pro +++ b/tests/auto/corelib.pro @@ -105,6 +105,10 @@ SUBDIRS=\ qfilesystementry \ qabstractfileengine +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qfileinfo \ + qfilesystementry \ + symbian:SUBDIRS -= \ qtconcurrentfilter \ qtconcurrentiteratekernel \ diff --git a/tests/auto/dbus.pro b/tests/auto/dbus.pro index 31b46a3..7470bf8 100644 --- a/tests/auto/dbus.pro +++ b/tests/auto/dbus.pro @@ -17,3 +17,5 @@ SUBDIRS=\ qdbusthreading \ qdbusxmlparser \ +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qdbusmarshall \ diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 72c32cb..08d59d3 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -39,6 +39,7 @@ contains(QT_CONFIG, private_tests) { qdeclarativedebug \ qdeclarativedebugclient \ qdeclarativedebugservice \ + qdeclarativedebugjs \ qdeclarativedom \ qdeclarativeecmascript \ qdeclarativeflickable \ diff --git a/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro b/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro index 1214fcf..d488b53 100644 --- a/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro +++ b/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro @@ -6,5 +6,5 @@ HEADERS += ../shared/debugutil_p.h SOURCES += tst_qdeclarativedebug.cpp \ ../shared/debugutil.cpp -CONFIG += parallel_test +CONFIG += parallel_test declarative_debug diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 9c20bd6..be9b402 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -52,14 +52,12 @@ #include <QtDeclarative/qdeclarativeproperty.h> #include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativedebug_p.h> #include <private/qdeclarativeenginedebug_p.h> #include <private/qdeclarativedebugclient_p.h> #include <private/qdeclarativedebugservice_p.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativemetatype_p.h> #include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativedebughelper_p.h> #include "../../../shared/util.h" #include "../shared/debugutil_p.h" @@ -296,9 +294,6 @@ void tst_QDeclarativeDebug::initTestCase() qRegisterMetaType<QDeclarativeDebugWatch::State>(); qmlRegisterType<NonScriptProperty>("Test", 1, 0, "NonScriptPropertyElement"); - QTest::ignoreMessage(QtWarningMsg, "Qml debugging is enabled. Only use this in a safe environment!"); - QDeclarativeDebugHelper::enableDebugging(); - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 3768..."); m_engine = new QDeclarativeEngine(this); diff --git a/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro b/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro index a3afd99..8fa87d2 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro +++ b/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro @@ -5,3 +5,5 @@ macx:CONFIG -= app_bundle HEADERS += ../shared/debugutil_p.h SOURCES += tst_qdeclarativedebugclient.cpp \ ../shared/debugutil.cpp + +CONFIG += declarative_debug diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index d41cfa3..4846d67 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -47,11 +47,7 @@ #include <QtDeclarative/qdeclarativeengine.h> -#include <private/qdeclarativedebug_p.h> -#include <private/qdeclarativeenginedebug_p.h> #include <private/qdeclarativedebugclient_p.h> -#include <private/qdeclarativedebugservice_p.h> -#include <private/qdeclarativedebughelper_p.h> #include "../../../shared/util.h" #include "../shared/debugutil_p.h" @@ -73,9 +69,6 @@ private slots: void tst_QDeclarativeDebugClient::initTestCase() { - QTest::ignoreMessage(QtWarningMsg, "Qml debugging is enabled. Only use this in a safe environment!"); - QDeclarativeDebugHelper::enableDebugging(); - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 13770..."); new QDeclarativeEngine(this); diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/app.pro b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro index 800c033..d1c0cdd 100644 --- a/tests/auto/declarative/qdeclarativedebugjs/app/app.pro +++ b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro @@ -1,6 +1,7 @@ TEMPLATE = app QT += declarative +CONFIG += declarative_debug CONFIG += console CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp index f5b830e..fe58502 100644 --- a/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp +++ b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp @@ -44,13 +44,10 @@ #include <QDeclarativeComponent> #include <QDeclarativeEngine> #include <QStringList> -#include <QtDeclarative/private/qdeclarativedebughelper_p.h> #include <QtDeclarative/private/qdeclarativedebugservice_p.h> int main(int argc, char *argv[]) { - QDeclarativeDebugHelper::enableDebugging(); - QApplication app(argc, argv); const QUrl path = QUrl::fromLocalFile(app.arguments().last()); diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp index 1990c0d..bad7b8f 100644 --- a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp +++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp @@ -43,7 +43,6 @@ #include <QtDeclarative/QDeclarativeEngine> #include <QtDeclarative/private/qdeclarativedebugclient_p.h> #include <QtDeclarative/private/qdeclarativedebugservice_p.h> -#include <QtDeclarative/private/qdeclarativedebug_p.h> #include <QtDeclarative/private/qjsdebuggeragent_p.h> #include <QtCore/QFileInfo> #include <QtCore/QDir> @@ -1431,8 +1430,10 @@ void tst_QDeclarativeDebugJS::testCoverageRun() client.startCoverageRun(); client.startCoverageCompleted(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageScriptLoaded()))); - QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coveragePosChanged()))); + + // The app might get "COVERAGE false" before anything is actually executed + //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageScriptLoaded()))); + //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coveragePosChanged()))); //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageFuncEntered()))); //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageFuncExited()))); } diff --git a/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro b/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro index a62e148..ca5a398 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro +++ b/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro @@ -6,5 +6,5 @@ HEADERS += ../shared/debugutil_p.h SOURCES += tst_qdeclarativedebugservice.cpp \ ../shared/debugutil.cpp -CONFIG += parallel_test +CONFIG += parallel_test declarative_debug diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index 3fa8bba..85d459b 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -46,10 +46,7 @@ #include <QThread> #include <QtDeclarative/qdeclarativeengine.h> -#include <private/qdeclarativedebughelper_p.h> -#include <private/qdeclarativedebug_p.h> -#include <private/qdeclarativeenginedebug_p.h> #include <private/qdeclarativedebugclient_p.h> #include <private/qdeclarativedebugservice_p.h> @@ -76,9 +73,6 @@ private slots: void tst_QDeclarativeDebugService::initTestCase() { - QTest::ignoreMessage(QtWarningMsg, "Qml debugging is enabled. Only use this in a safe environment!"); - QDeclarativeDebugHelper::enableDebugging(); - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 13769..."); new QDeclarativeEngine(this); diff --git a/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml b/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml new file mode 100644 index 0000000..8588028 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml @@ -0,0 +1,44 @@ +import QtQuick 1.1 + +Item { + id: root + width: 800 + height: 800 + + GridView { + anchors.fill: parent + delegate: Image { + source: imagePath; + asynchronous: true + smooth: true + width: 200 + height: 200 + } + model: ListModel { + ListElement { + imagePath: "http://127.0.0.1:14451/big256.png" + } + ListElement { + imagePath: "http://127.0.0.1:14451/big256.png" + } + ListElement { + imagePath: "http://127.0.0.1:14451/big256.png" + } + ListElement { + imagePath: "http://127.0.0.1:14451/colors.png" + } + ListElement { + imagePath: "http://127.0.0.1:14451/colors1.png" + } + ListElement { + imagePath: "http://127.0.0.1:14451/big.jpeg" + } + ListElement { + imagePath: "http://127.0.0.1:14451/heart.png" + } + ListElement { + imagePath: "http://127.0.0.1:14451/green.png" + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index a35d69a..f67c5b5 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -94,6 +94,7 @@ private slots: void resetSourceSize(); void testQtQuick11Attributes(); void testQtQuick11Attributes_data(); + void readerCrash_QTBUG_22125(); private: template<typename T> @@ -762,6 +763,46 @@ void tst_qdeclarativeimage::testQtQuick11Attributes_data() << ":1 \"Image.cache\" is not available in QtQuick 1.0.\n"; } +void tst_qdeclarativeimage::readerCrash_QTBUG_22125() +{ + { + TestHTTPServer server(SERVER_PORT); + QVERIFY(server.isValid()); + server.serveDirectory(SRCDIR "/data/", TestHTTPServer::Delay); + + { + QDeclarativeView view(QUrl::fromLocalFile(SRCDIR "/data/qtbug_22125.qml")); + view.show(); + qApp->processEvents(); + qApp->processEvents(); + // shouldn't crash when the view drops out of scope due to + // QDeclarativePixmapData attempting to dereference a pointer to + // the destroyed reader. + } + + // shouldn't crash when deleting cancelled QDeclarativePixmapReplys. + QTest::qWait(1000); + qApp->processEvents(QEventLoop::DeferredDeletion); + } + + { + TestHTTPServer server(SERVER_PORT); + QVERIFY(server.isValid()); + server.serveDirectory(SRCDIR "/data/"); + + { + QDeclarativeView view(QUrl::fromLocalFile(SRCDIR "/data/qtbug_22125.qml")); + view.show(); + qApp->processEvents(); + QTest::qWait(1000); + qApp->processEvents(); + // shouldn't crash when the view drops out of scope due to + // the reader thread accessing self-deleted QDeclarativePixmapReplys. + } + qApp->processEvents(); + } +} + /* Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp index 2cc2971..96bea68 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp @@ -43,6 +43,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QDebug> +#include <QtCore/qlibraryinfo.h> #include "../shared/testhttpserver.h" #include "../../../shared/util.h" @@ -70,6 +71,7 @@ private slots: void remoteImportWithUnquotedUri(); void versionNotInstalled(); void versionNotInstalled_data(); + void importPath(); }; #ifdef Q_OS_SYMBIAN @@ -308,6 +310,29 @@ void tst_qdeclarativemoduleplugin::versionNotInstalled() VERIFY_ERRORS(errorFile.toLatin1().constData()); } +void tst_qdeclarativemoduleplugin::importPath() +{ +#ifndef Q_OS_SYMBIAN + QSKIP("Import path order testing for Symbian only", SkipAll); +#else + QDeclarativeEngine engine; + QStringList imports = engine.importPathList(); + QString installImportsPath = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::ImportsPath)); + QString driveOrder(QLatin1String("ZABCDEFGHIJKLMNOPQRSTUVWXY")); + int lastOrder = 30; + foreach(QString import, imports) + { + if (import.endsWith(installImportsPath)) + { + int order = driveOrder.indexOf(import[0]); + QVERIFY(order < lastOrder); + lastOrder = order; + } + } + QVERIFY(lastOrder != 30); +#endif +} + QTEST_MAIN(tst_qdeclarativemoduleplugin) #include "tst_qdeclarativemoduleplugin.moc" diff --git a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro index 2c13644..3bdb3fc 100644 --- a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro +++ b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro @@ -7,7 +7,7 @@ SOURCES += tst_qdeclarativepincharea.cpp symbian: { importFiles.sources = data importFiles.path = . - DEPLOYMENT = importFiles + DEPLOYMENT += importFiles } else { DEFINES += SRCDIR=\\\"$$PWD\\\" } diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml new file mode 100644 index 0000000..ed1f22f --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml @@ -0,0 +1,27 @@ +import QtQuick 1.0 + +Rectangle { + id: myRect + width: 400 + height: 400 + + onHeightChanged: console.log("base state") + + states: [ + State { + name: "state1" + PropertyChanges { + target: myRect + onHeightChanged: console.log("state1") + color: "green" + } + }, + State { + name: "state2"; + PropertyChanges { + target: myRect + onHeightChanged: console.log("state2") + color: "red" + } + }] +} diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index 9fafa7d..e90e6fb 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -113,6 +113,7 @@ private slots: void signalOverride(); void signalOverrideCrash(); void signalOverrideCrash2(); + void signalOverrideCrash3(); void parentChange(); void parentChangeErrors(); void anchorChanges(); @@ -520,6 +521,22 @@ void tst_qdeclarativestates::signalOverrideCrash2() delete rect; } +void tst_qdeclarativestates::signalOverrideCrash3() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash3.qml"); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QDeclarativeItemPrivate::get(rect)->setState("state1"); + QDeclarativeItemPrivate::get(rect)->setState(""); + QDeclarativeItemPrivate::get(rect)->setState("state2"); + QDeclarativeItemPrivate::get(rect)->setState(""); + + delete rect; +} + void tst_qdeclarativestates::parentChange() { QDeclarativeEngine engine; diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 33f74a9..4d8bd0b 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -156,6 +156,7 @@ private slots: void inputContextMouseHandler(); void inputMethodComposing(); void cursorRectangleSize(); + void deselect(); private: void simulateKey(QDeclarativeView *, int key, Qt::KeyboardModifiers modifiers = 0); @@ -2699,6 +2700,120 @@ void tst_qdeclarativetextedit::cursorRectangleSize() QCOMPARE(microFocusFromScene.size(), cursorRect.size()); QCOMPARE(microFocusFromApp.size(), cursorRect.size()); } + +void tst_qdeclarativetextedit::deselect() +{ + QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml"); + QVERIFY(canvas->rootObject() != 0); + canvas->show(); + canvas->setFocus(); + QApplication::setActiveWindow(canvas); + QTest::qWaitForWindowShown(canvas); + + QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject()); + QVERIFY(textEdit != 0); + + textEdit->setText("Select"); + + QSignalSpy selectionStartSpy(textEdit, SIGNAL(selectionStartChanged())); + QSignalSpy selectionEndSpy(textEdit, SIGNAL(selectionEndChanged())); + QSignalSpy selectionSpy(textEdit, SIGNAL(selectionChanged())); + + textEdit->select(5, 6); + + QCOMPARE(selectionStartSpy.count(), 1); + QCOMPARE(selectionEndSpy.count(), 1); + QCOMPARE(selectionSpy.count(), 1); + QCOMPARE(textEdit->selectionStart(), 5); + QCOMPARE(textEdit->selectionEnd(), 6); + QCOMPARE(textEdit->selectedText(), QLatin1String("t")); + QCOMPARE(textEdit->cursorPosition(), 6); + + textEdit->deselect(); + + QCOMPARE(selectionStartSpy.count(), 2); + QCOMPARE(selectionEndSpy.count(), 1); + QCOMPARE(selectionSpy.count(), 2); + QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectedText(), QLatin1String("")); + QCOMPARE(textEdit->cursorPosition(), 6); + + textEdit->select(5, 6); + + QCOMPARE(selectionStartSpy.count(), 3); + QCOMPARE(selectionEndSpy.count(), 1); + QCOMPARE(selectionSpy.count(), 3); + QCOMPARE(textEdit->selectionStart(), 5); + QCOMPARE(textEdit->selectionEnd(), 6); + QCOMPARE(textEdit->selectedText(), QLatin1String("t")); + QCOMPARE(textEdit->cursorPosition(), 6); + + QKeyEvent leftArrowPress(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier); + QKeyEvent leftArrowRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::NoModifier); + QApplication::sendEvent(canvas, &leftArrowPress); + QApplication::sendEvent(canvas, &leftArrowRelese); + + QCOMPARE(selectionStartSpy.count(), 3); + QCOMPARE(selectionEndSpy.count(), 2); + QCOMPARE(selectionSpy.count(), 4); + QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectedText(), QLatin1String("")); + QCOMPARE(textEdit->cursorPosition(), 5); + + textEdit->select(5, 6); + + QCOMPARE(selectionStartSpy.count(), 3); + QCOMPARE(selectionEndSpy.count(), 3); + QCOMPARE(selectionSpy.count(), 5); + QCOMPARE(textEdit->selectionStart(), 5); + QCOMPARE(textEdit->selectionEnd(), 6); + QCOMPARE(textEdit->selectedText(), QLatin1String("t")); + QCOMPARE(textEdit->cursorPosition(), 6); + + QList<QInputMethodEvent::Attribute> attributes; + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant()); + QInputMethodEvent event(QLatin1String(""), attributes); + QApplication::sendEvent(canvas, &event); + + QCOMPARE(selectionStartSpy.count(), 4); + QCOMPARE(selectionEndSpy.count(), 4); + QCOMPARE(selectionSpy.count(), 6); + QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectedText(), QLatin1String("")); + QCOMPARE(textEdit->cursorPosition(), 0); + + textEdit->setCursorPosition(1); + + QCOMPARE(selectionStartSpy.count(), 5); + QCOMPARE(selectionEndSpy.count(), 5); + QCOMPARE(selectionSpy.count(), 6); + + QKeyEvent leftArrowShiftPress(QEvent::KeyPress, Qt::Key_Left, Qt::ShiftModifier); + QKeyEvent leftArrowShiftRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::ShiftModifier); + QApplication::sendEvent(canvas, &leftArrowShiftPress); + QApplication::sendEvent(canvas, &leftArrowShiftRelese); + + QCOMPARE(selectionStartSpy.count(), 6); + QCOMPARE(selectionEndSpy.count(), 5); + QCOMPARE(selectionSpy.count(), 7); + QCOMPARE(textEdit->selectionStart(), 0); + QCOMPARE(textEdit->selectionEnd(), 1); + QCOMPARE(textEdit->selectedText(), QLatin1String("S")); + QCOMPARE(textEdit->cursorPosition(), 0); + + QApplication::sendEvent(canvas, &event); + + QCOMPARE(selectionStartSpy.count(), 6); + QCOMPARE(selectionEndSpy.count(), 6); + QCOMPARE(selectionSpy.count(), 8); + QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition()); + QCOMPARE(textEdit->selectedText(), QLatin1String("")); + QCOMPARE(textEdit->cursorPosition(), 0); +} QTEST_MAIN(tst_qdeclarativetextedit) #include "tst_qdeclarativetextedit.moc" diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index bb895bf..b077670 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -147,6 +147,7 @@ private slots: void inputContextMouseHandler(); void inputMethodComposing(); void cursorRectangleSize(); + void deselect(); private: void simulateKey(QDeclarativeView *, int key); @@ -2367,7 +2368,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); // input method should not be enabled - // if TextEdit is read only. + // if TextInput is read only. input.setReadOnly(true); ic.openInputPanelReceived = false; input.setFocus(true); @@ -2815,6 +2816,120 @@ void tst_qdeclarativetextinput::cursorRectangleSize() QCOMPARE(microFocusFromApp.size(), cursorRect.size()); } +void tst_qdeclarativetextinput::deselect() +{ + QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml"); + QVERIFY(canvas->rootObject() != 0); + canvas->show(); + canvas->setFocus(); + QApplication::setActiveWindow(canvas); + QTest::qWaitForWindowShown(canvas); + + QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject()); + QVERIFY(textInput != 0); + + textInput->setText("Select"); + + QSignalSpy selectionStartSpy(textInput, SIGNAL(selectionStartChanged())); + QSignalSpy selectionEndSpy(textInput, SIGNAL(selectionEndChanged())); + QSignalSpy selectedTextSpy(textInput, SIGNAL(selectedTextChanged())); + + textInput->select(5, 6); + + QCOMPARE(selectionStartSpy.count(), 1); + QCOMPARE(selectionEndSpy.count(), 0); + QCOMPARE(selectedTextSpy.count(), 1); + QCOMPARE(textInput->selectionStart(), 5); + QCOMPARE(textInput->selectionEnd(), 6); + QCOMPARE(textInput->selectedText(), QLatin1String("t")); + QCOMPARE(textInput->cursorPosition(), 6); + + textInput->deselect(); + + QCOMPARE(selectionStartSpy.count(), 2); + QCOMPARE(selectionEndSpy.count(), 1); + QCOMPARE(selectedTextSpy.count(), 2); + QCOMPARE(textInput->selectionStart(), textInput->cursorPosition()); + QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition()); + QCOMPARE(textInput->selectedText(), QLatin1String("")); + QCOMPARE(textInput->cursorPosition(), 6); + + textInput->select(5, 6); + + QCOMPARE(selectionStartSpy.count(), 3); + QCOMPARE(selectionEndSpy.count(), 1); + QCOMPARE(selectedTextSpy.count(), 3); + QCOMPARE(textInput->selectionStart(), 5); + QCOMPARE(textInput->selectionEnd(), 6); + QCOMPARE(textInput->selectedText(), QLatin1String("t")); + QCOMPARE(textInput->cursorPosition(), 6); + + QKeyEvent leftArrowPress(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier); + QKeyEvent leftArrowRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::NoModifier); + QApplication::sendEvent(canvas, &leftArrowPress); + QApplication::sendEvent(canvas, &leftArrowRelese); + + QCOMPARE(selectionStartSpy.count(), 4); + QCOMPARE(selectionEndSpy.count(), 2); + QCOMPARE(selectedTextSpy.count(), 4); + QCOMPARE(textInput->selectionStart(), textInput->cursorPosition()); + QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition()); + QCOMPARE(textInput->selectedText(), QLatin1String("")); + QCOMPARE(textInput->cursorPosition(), 5); + + textInput->select(5, 6); + + QCOMPARE(selectionStartSpy.count(), 4); + QCOMPARE(selectionEndSpy.count(), 3); + QCOMPARE(selectedTextSpy.count(), 5); + QCOMPARE(textInput->selectionStart(), 5); + QCOMPARE(textInput->selectionEnd(), 6); + QCOMPARE(textInput->selectedText(), QLatin1String("t")); + QCOMPARE(textInput->cursorPosition(), 6); + + QList<QInputMethodEvent::Attribute> attributes; + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant()); + QInputMethodEvent event(QLatin1String(""), attributes); + QApplication::sendEvent(canvas, &event); + + QCOMPARE(selectionStartSpy.count(), 5); + QCOMPARE(selectionEndSpy.count(), 4); + QCOMPARE(selectedTextSpy.count(), 6); + QCOMPARE(textInput->selectionStart(), textInput->cursorPosition()); + QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition()); + QCOMPARE(textInput->selectedText(), QLatin1String("")); + QCOMPARE(textInput->cursorPosition(), 0); + + textInput->setCursorPosition(1); + + QCOMPARE(selectionStartSpy.count(), 6); + QCOMPARE(selectionEndSpy.count(), 5); + QCOMPARE(selectedTextSpy.count(), 6); + + QKeyEvent leftArrowShiftPress(QEvent::KeyPress, Qt::Key_Left, Qt::ShiftModifier); + QKeyEvent leftArrowShiftRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::ShiftModifier); + QApplication::sendEvent(canvas, &leftArrowShiftPress); + QApplication::sendEvent(canvas, &leftArrowShiftRelese); + + QCOMPARE(selectionStartSpy.count(), 7); + QCOMPARE(selectionEndSpy.count(), 5); + QCOMPARE(selectedTextSpy.count(), 7); + QCOMPARE(textInput->selectionStart(), 0); + QCOMPARE(textInput->selectionEnd(), 1); + QCOMPARE(textInput->selectedText(), QLatin1String("S")); + QCOMPARE(textInput->cursorPosition(), 0); + + QApplication::sendEvent(canvas, &event); + + QCOMPARE(selectionStartSpy.count(), 8); + QCOMPARE(selectionEndSpy.count(), 6); + QCOMPARE(selectedTextSpy.count(), 8); + QCOMPARE(textInput->selectionStart(), textInput->cursorPosition()); + QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition()); + QCOMPARE(textInput->selectedText(), QLatin1String("")); + QCOMPARE(textInput->cursorPosition(), 0); +} + QTEST_MAIN(tst_qdeclarativetextinput) #include "tst_qdeclarativetextinput.moc" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png Binary files differindex 7fbd802..7fbd802 100755..100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png Binary files differindex 462edac..462edac 100755..100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png Binary files differindex f8061a1..f8061a1 100755..100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png Binary files differindex 1297ec7..1297ec7 100755..100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.png Binary files differindex 4aa9fb5..4aa9fb5 100755..100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.png diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index 17f56f2..cde39c2 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -209,11 +209,26 @@ SUBDIRS=\ win32:SUBDIRS -= qtextpiecetable !contains(QT_CONFIG, private_tests): SUBDIRS -= \ - qgraphicssceneindex \ - qnetworkreply \ - qpathclipper \ - qstylesheetstyle \ - qtextpiecetable \ + qcolumnview \ + qgraphicsanchorlayout \ + qgraphicsanchorlayout1 \ + qgraphicsitem \ + qgraphicsscene \ + qgraphicssceneindex \ + qlistwidget \ + qmainwindow \ + qnetworkreply \ + qpathclipper \ + qpixmapcache \ + qsidebar \ + qstatictext \ + qstylesheetstyle \ + qtcpsocket \ + qtextlayout \ + qtextpiecetable \ + qtipc \ + qtoolbar \ + qtreeview \ symbian:SUBDIRS -= \ qsystemtrayicon \ diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro index 23ec56b..23ec56b 100755..100644 --- a/tests/auto/mediaobject/mediaobject.pro +++ b/tests/auto/mediaobject/mediaobject.pro diff --git a/tests/auto/network.pro b/tests/auto/network.pro index e4cecce..9eb358f 100644 --- a/tests/auto/network.pro +++ b/tests/auto/network.pro @@ -46,9 +46,15 @@ SUBDIRS=\ !contains(QT_CONFIG, private_tests): SUBDIRS -= \ qauthenticator \ + qhostinfo \ qhttpnetworkconnection \ qhttpnetworkreply \ + qhttpsocketengine \ + qnetworkreply \ platformsocketengine \ qsocketnotifier \ qsocks5socketengine \ + qsslsocket \ + qsslsocket_onDemandCertificates_member \ + qsslsocket_onDemandCertificates_static \ diff --git a/tests/auto/other.pro b/tests/auto/other.pro index 655d666..b50e169 100644 --- a/tests/auto/other.pro +++ b/tests/auto/other.pro @@ -60,5 +60,7 @@ symbian { # Following tests depends on private API !contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qcombobox \ qcssparser \ + qtextedit \ diff --git a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro index b8f509d..90a99c0 100644 --- a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro +++ b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro @@ -6,7 +6,7 @@ HEADERS += TestNodeModel.h LoadingModel.h include (../xmlpatterns.pri) -wince*: { +wince*|symbian: { addFiles.files = tree.xml addFiles.path = . diff --git a/tests/auto/qbytearray/qbytearray.pro b/tests/auto/qbytearray/qbytearray.pro index f195dc8..b954ca0 100644 --- a/tests/auto/qbytearray/qbytearray.pro +++ b/tests/auto/qbytearray/qbytearray.pro @@ -14,6 +14,8 @@ wince* { DEFINES += SRCDIR=\\\"./\\\" } else:symbian { TARGET.EPOCHEAPSIZE="0x100 0x800000" +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro index 1681220..cbbde7c 100644 --- a/tests/auto/qchar/qchar.pro +++ b/tests/auto/qchar/qchar.pro @@ -10,6 +10,8 @@ DEPLOYMENT += deploy symbian: { DEFINES += SRCDIR="" +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro index 12c6b6c..2e8f6db 100644 --- a/tests/auto/qclipboard/test/test.pro +++ b/tests/auto/qclipboard/test/test.pro @@ -15,7 +15,7 @@ wince*|symbian: { copier.path = copier paster.files = ../paster/paster.exe paster.path = paster - + symbian: { LIBS += -lbafl -lestor -letext @@ -27,6 +27,6 @@ wince*|symbian: { reg_resource.files += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc reg_resource.path = $$REG_RESOURCE_IMPORT_DIR } - + DEPLOYMENT += copier paster rsc reg_resource -}
\ No newline at end of file +} diff --git a/tests/auto/qclipboard/tst_qclipboard.cpp b/tests/auto/qclipboard/tst_qclipboard.cpp index 94981cf..ea470e7 100644 --- a/tests/auto/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/qclipboard/tst_qclipboard.cpp @@ -73,6 +73,7 @@ private slots: #ifdef Q_OS_SYMBIAN void pasteCopySymbian(); void copyPasteSymbian(); + void copyCopyPasteSymbian(); #endif private: @@ -347,17 +348,17 @@ void tst_QClipboard::clearBeforeSetText() QCOMPARE(QApplication::clipboard()->text(), text); } +#ifdef Q_OS_SYMBIAN /* Test that text copied from qt application can be pasted with symbian clipboard */ -#ifdef Q_OS_SYMBIAN // ### This test case only makes sense in symbian void tst_QClipboard::pasteCopySymbian() { if (!nativeClipboardWorking()) QSKIP("Native clipboard not working in this setup", SkipAll); - const QString string("Test string symbian."); + const QString string("Test string qt->symbian."); QApplication::clipboard()->setText(string); const TInt KPlainTextBegin = 0; @@ -381,19 +382,9 @@ void tst_QClipboard::pasteCopySymbian() QCOMPARE(string, storeString); } -#endif -/* - Test that text copied to symbian clipboard - can be pasted to qt clipboard -*/ -#ifdef Q_OS_SYMBIAN -// ### This test case only makes sense in symbian -void tst_QClipboard::copyPasteSymbian() +static void nativeCopyHelper(const QString &string) { - if (!nativeClipboardWorking()) - QSKIP("Native clipboard not working in this setup", SkipAll); - const QString string("Test string symbian."); const TInt KPlainTextBegin = 0; RFs fs = qt_s60GetRFs(); @@ -412,8 +403,55 @@ void tst_QClipboard::copyPasteSymbian() (cb->StreamDictionary()).AssignL(KClipboardUidTypePlainText, symbianStId); cb->CommitL(); CleanupStack::PopAndDestroy(2, cb); +} + +/* + Test that text copied to symbian clipboard + can be pasted to qt clipboard +*/ +// ### This test case only makes sense in symbian +void tst_QClipboard::copyPasteSymbian() +{ + if (!nativeClipboardWorking()) + QSKIP("Native clipboard not working in this setup", SkipAll); + const QString string("Test string symbian->qt."); + + nativeCopyHelper(string); + + QCOMPARE(QApplication::clipboard()->text(), string); +} + +/* + Test that text copied to symbian clipboard + can be pasted to qt clipboard, even if Qt + clipboard already had copied formatted text +*/ +// ### This test case only makes sense in symbian +void tst_QClipboard::copyCopyPasteSymbian() +{ + if (!nativeClipboardWorking()) + QSKIP("Native clipboard not working in this setup", SkipAll); + + //first copy some mime data with text/html and text/plain representations + QMimeData *mimeData = new QMimeData; + const QString preCopy(QLatin1String("qt_symbian")); + mimeData->setText(preCopy); + mimeData->setHtml(preCopy); + QApplication::clipboard()->setMimeData(mimeData); + + //check both representations are pastable + QCOMPARE(QApplication::clipboard()->mimeData()->html(), preCopy); + QCOMPARE(QApplication::clipboard()->mimeData()->text(), preCopy); + + //native copy some plain text + const QString string("symbian_qt"); + nativeCopyHelper(string); + //check text/plain is pastable QCOMPARE(QApplication::clipboard()->text(), string); + QCOMPARE(QApplication::clipboard()->mimeData()->text(), string); + //check text/html is cleared + QVERIFY(QApplication::clipboard()->mimeData()->html().isEmpty()); } #endif diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp index cca212e..9754a84 100644 --- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp @@ -93,6 +93,9 @@ private slots: void receiveUnknownType_data(); void receiveUnknownType(); + void demarshallPrimitives_data(); + void demarshallPrimitives(); + private: int fileDescriptorForTest(); @@ -1168,5 +1171,84 @@ void tst_QDBusMarshall::receiveUnknownType() #endif } +void tst_QDBusMarshall::demarshallPrimitives_data() +{ + sendBasic_data(); +} + +template<class T> +QVariant demarshallPrimitiveAs(const QDBusArgument& dbusArg) +{ + T val; + dbusArg >> val; + return qVariantFromValue(val); +} + +QVariant demarshallPrimitiveAs(int typeIndex, const QDBusArgument& dbusArg) +{ + switch (typeIndex) { + case 0: + return demarshallPrimitiveAs<uchar>(dbusArg); + case 1: + return demarshallPrimitiveAs<bool>(dbusArg); + case 2: + return demarshallPrimitiveAs<short>(dbusArg); + case 3: + return demarshallPrimitiveAs<ushort>(dbusArg); + case 4: + return demarshallPrimitiveAs<int>(dbusArg); + case 5: + return demarshallPrimitiveAs<uint>(dbusArg); + case 6: + return demarshallPrimitiveAs<qlonglong>(dbusArg); + case 7: + return demarshallPrimitiveAs<qulonglong>(dbusArg); + case 8: + return demarshallPrimitiveAs<double>(dbusArg); + default: + return QVariant(); + } +} + +void tst_QDBusMarshall::demarshallPrimitives() +{ + QFETCH(QVariant, value); + QFETCH(QString, sig); + + QDBusConnection con = QDBusConnection::sessionBus(); + + QVERIFY(con.isConnected()); + + // Demarshall each test data value to all primitive types to test + // demarshalling to the wrong type does not cause a crash + for (int typeIndex = 0; true; ++typeIndex) { + QDBusMessage msg = QDBusMessage::createMethodCall(serviceName, objectPath, + interfaceName, "ping"); + QDBusArgument sendArg; + sendArg.beginStructure(); + sendArg.appendVariant(value); + sendArg.endStructure(); + msg.setArguments(QVariantList() << qVariantFromValue(sendArg)); + QDBusMessage reply = con.call(msg); + + const QDBusArgument receiveArg = qvariant_cast<QDBusArgument>(reply.arguments().at(0)); + receiveArg.beginStructure(); + QCOMPARE(receiveArg.currentSignature(), sig); + + const QVariant receiveValue = demarshallPrimitiveAs(typeIndex, receiveArg); + if (receiveValue.type() == value.type()) { + // Value type is the same, compare the values + QCOMPARE(receiveValue, value); + QVERIFY(receiveArg.atEnd()); + } + + receiveArg.endStructure(); + QVERIFY(receiveArg.atEnd()); + + if (!receiveValue.isValid()) + break; + } +} + QTEST_MAIN(tst_QDBusMarshall) #include "tst_qdbusmarshall.moc" diff --git a/tests/auto/qelapsedtimer/qelapsedtimer.pro b/tests/auto/qelapsedtimer/qelapsedtimer.pro index 8768876..1d74fc5 100644 --- a/tests/auto/qelapsedtimer/qelapsedtimer.pro +++ b/tests/auto/qelapsedtimer/qelapsedtimer.pro @@ -7,6 +7,8 @@ wince* { } else:symbian { # do not define SRCDIR at all TARGET.EPOCHEAPSIZE = 0x100000 0x3000000 +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro index b35b1e0..d0e284b 100644 --- a/tests/auto/qfileinfo/qfileinfo.pro +++ b/tests/auto/qfileinfo/qfileinfo.pro @@ -19,13 +19,15 @@ symbian { TARGET.CAPABILITY=AllFiles LIBS *= -lefsrv INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs - } +} # support for running test from shadow build directory wince* { DEFINES += SRCDIR=\\\"\\\" } else:symbian { # do not define SRCDIR at all +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp index 735c7e4..7bbd32d 100644 --- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp @@ -80,6 +80,10 @@ private slots: void addAppFont_data(); void addAppFont(); + +#ifdef Q_WS_MAC + void localizedFonts(); +#endif }; tst_QFontDatabase::tst_QFontDatabase() @@ -275,5 +279,15 @@ void tst_QFontDatabase::addAppFont() QVERIFY(db.families() == oldFamilies); } +#ifdef Q_WS_MAC +void tst_QFontDatabase::localizedFonts() +{ + QFontDatabase db; + + QVERIFY(db.hasFamily(QString::fromUtf8("ヒラギノ明朝 Pro"))); + QVERIFY(!db.hasFamily(QString::fromUtf8("NotValidFont"))); +} +#endif + QTEST_MAIN(tst_QFontDatabase) #include "tst_qfontdatabase.moc" diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 9b834d5..b6a402e 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -306,6 +306,7 @@ private slots: void inputMethodHints(); void toolTip(); void visible(); + void isVisibleTo(); void explicitlyVisible(); void enabled(); void explicitlyEnabled(); @@ -1138,6 +1139,113 @@ void tst_QGraphicsItem::visible() QVERIFY(!item->hasFocus()); } +void tst_QGraphicsItem::isVisibleTo() +{ + QGraphicsScene scene; + QGraphicsItem *parent = scene.addRect(QRectF(0, 0, 100, 100)); + QGraphicsItem *child = scene.addRect(QRectF(25, 25, 50, 50)); + QGraphicsItem *grandChild = scene.addRect(QRectF(50, 50, 50, 50)); + QGraphicsItem *stranger = scene.addRect(100, 100, 100, 100); + + child->setParentItem(parent); + grandChild->setParentItem(child); + + QVERIFY(grandChild->isVisible()); + QVERIFY(grandChild->isVisibleTo(grandChild)); + QVERIFY(grandChild->isVisibleTo(child)); + QVERIFY(grandChild->isVisibleTo(parent)); + QVERIFY(grandChild->isVisibleTo(0)); + QVERIFY(child->isVisible()); + QVERIFY(child->isVisibleTo(child)); + QVERIFY(child->isVisibleTo(parent)); + QVERIFY(child->isVisibleTo(0)); + QVERIFY(parent->isVisible()); + QVERIFY(parent->isVisibleTo(parent)); + QVERIFY(parent->isVisibleTo(0)); + QVERIFY(!parent->isVisibleTo(child)); + QVERIFY(!child->isVisibleTo(grandChild)); + QVERIFY(!grandChild->isVisibleTo(stranger)); + QVERIFY(!child->isVisibleTo(stranger)); + QVERIFY(!parent->isVisibleTo(stranger)); + QVERIFY(!stranger->isVisibleTo(grandChild)); + QVERIFY(!stranger->isVisibleTo(child)); + QVERIFY(!stranger->isVisibleTo(parent)); + + // Case 1: only parent is explicitly hidden + parent->hide(); + + QVERIFY(!grandChild->isVisible()); + QVERIFY(grandChild->isVisibleTo(grandChild)); + QVERIFY(grandChild->isVisibleTo(child)); + QVERIFY(grandChild->isVisibleTo(parent)); + QVERIFY(!grandChild->isVisibleTo(0)); + QVERIFY(!child->isVisible()); + QVERIFY(child->isVisibleTo(child)); + QVERIFY(child->isVisibleTo(parent)); + QVERIFY(!child->isVisibleTo(0)); + QVERIFY(!parent->isVisible()); + QVERIFY(!parent->isVisibleTo(parent)); + QVERIFY(!parent->isVisibleTo(0)); + QVERIFY(!parent->isVisibleTo(child)); + QVERIFY(!child->isVisibleTo(grandChild)); + QVERIFY(!grandChild->isVisibleTo(stranger)); + QVERIFY(!child->isVisibleTo(stranger)); + QVERIFY(!parent->isVisibleTo(stranger)); + QVERIFY(!stranger->isVisibleTo(grandChild)); + QVERIFY(!stranger->isVisibleTo(child)); + QVERIFY(!stranger->isVisibleTo(parent)); + + // Case 2: only child is hidden + parent->show(); + child->hide(); + + QVERIFY(!grandChild->isVisible()); + QVERIFY(grandChild->isVisibleTo(grandChild)); + QVERIFY(grandChild->isVisibleTo(child)); + QVERIFY(!grandChild->isVisibleTo(parent)); + QVERIFY(!grandChild->isVisibleTo(0)); + QVERIFY(!child->isVisible()); + QVERIFY(!child->isVisibleTo(child)); + QVERIFY(!child->isVisibleTo(parent)); + QVERIFY(!child->isVisibleTo(0)); + QVERIFY(parent->isVisible()); + QVERIFY(parent->isVisibleTo(parent)); + QVERIFY(parent->isVisibleTo(0)); + QVERIFY(!parent->isVisibleTo(child)); + QVERIFY(!child->isVisibleTo(grandChild)); + QVERIFY(!grandChild->isVisibleTo(stranger)); + QVERIFY(!child->isVisibleTo(stranger)); + QVERIFY(!parent->isVisibleTo(stranger)); + QVERIFY(!stranger->isVisibleTo(grandChild)); + QVERIFY(!stranger->isVisibleTo(child)); + QVERIFY(!stranger->isVisibleTo(parent)); + + // Case 3: only grand child is hidden + child->show(); + grandChild->hide(); + + QVERIFY(!grandChild->isVisible()); + QVERIFY(!grandChild->isVisibleTo(grandChild)); + QVERIFY(!grandChild->isVisibleTo(child)); + QVERIFY(!grandChild->isVisibleTo(parent)); + QVERIFY(!grandChild->isVisibleTo(0)); + QVERIFY(child->isVisible()); + QVERIFY(child->isVisibleTo(child)); + QVERIFY(child->isVisibleTo(parent)); + QVERIFY(child->isVisibleTo(0)); + QVERIFY(parent->isVisible()); + QVERIFY(parent->isVisibleTo(parent)); + QVERIFY(parent->isVisibleTo(0)); + QVERIFY(!parent->isVisibleTo(child)); + QVERIFY(!child->isVisibleTo(grandChild)); + QVERIFY(!grandChild->isVisibleTo(stranger)); + QVERIFY(!child->isVisibleTo(stranger)); + QVERIFY(!parent->isVisibleTo(stranger)); + QVERIFY(!stranger->isVisibleTo(grandChild)); + QVERIFY(!stranger->isVisibleTo(child)); + QVERIFY(!stranger->isVisibleTo(parent)); +} + void tst_QGraphicsItem::explicitlyVisible() { QGraphicsScene scene; diff --git a/tests/auto/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp b/tests/auto/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp index a8b6c08..34ca5d4 100644 --- a/tests/auto/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp +++ b/tests/auto/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp @@ -44,6 +44,7 @@ #include <qgraphicslayoutitem.h> #include <float.h> #include <limits.h> +#include <QtGui/qgraphicswidget.h> class tst_QGraphicsLayoutItem : public QObject { Q_OBJECT @@ -60,6 +61,8 @@ private slots: void contentsRect(); void effectiveSizeHint_data(); void effectiveSizeHint(); + void effectiveSizeHint2_data(); + void effectiveSizeHint2(); void getContentsMargins(); void isLayout_data(); void isLayout(); @@ -104,6 +107,40 @@ public: }; +class RectWidget : public QGraphicsWidget +{ +public: + RectWidget(QGraphicsItem *parent = 0) : QGraphicsWidget(parent), m_fnConstraint(fn2000_div_w) {} + + + QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const + { + if (constraint.width() < 0 && constraint.height() < 0 && m_sizeHints[which].isValid()) { + return m_sizeHints[which]; + } + if (m_fnConstraint) { + return m_fnConstraint(which, constraint); + } + return QGraphicsWidget::sizeHint(which, constraint); + } + + void setSizeHint(Qt::SizeHint which, const QSizeF &size) { + m_sizeHints[which] = size; + updateGeometry(); + } + + void setConstraintFunction(QSizeF (*fnConstraint)(Qt::SizeHint, const QSizeF &)) { + m_fnConstraint = fnConstraint; + } + + QSizeF m_sizeHints[Qt::NSizeHints]; + QSizeF (*m_fnConstraint)(Qt::SizeHint, const QSizeF &); + + static QSizeF fn2000_div_w(Qt::SizeHint /*which*/, const QSizeF &constraint = QSizeF()) { + return QSizeF(constraint.width(), 2000.0/constraint.width()); + } +}; + // This will be called before the first test function is executed. // It is only called once. void tst_QGraphicsLayoutItem::initTestCase() @@ -183,6 +220,77 @@ void tst_QGraphicsLayoutItem::effectiveSizeHint() QCOMPARE(r.height(), constraint.height()); } + +void tst_QGraphicsLayoutItem::effectiveSizeHint2_data() +{ + QTest::addColumn<QSizeF>("minimumSize"); + QTest::addColumn<QSizeF>("preferredSize"); + QTest::addColumn<QSizeF>("maximumSize"); + QTest::addColumn<QSizeF>("minimumSizeHint"); + QTest::addColumn<QSizeF>("preferredSizeHint"); + QTest::addColumn<QSizeF>("maximumSizeHint"); + + QTest::addColumn<QSizeF>("inputConstraint"); + QTest::addColumn<QSizeF>("expectedMinimumESH"); + QTest::addColumn<QSizeF>("expectedPreferredESH"); + QTest::addColumn<QSizeF>("expectedMaximumESH"); + + QTest::newRow("P1-a") + << QSizeF( 6, 4) << QSizeF( 60, 40) << QSizeF( 600, 400) + << QSizeF( -1, -1) << QSizeF( -1, -1) << QSizeF( -1, -1) + << QSizeF(-1, -1) + << QSizeF(6, 4) << QSizeF( 60, 40) << QSizeF(600, 400); + + QTest::newRow("P1-hfw-1") + << QSizeF( -1, -1) << QSizeF( -1, -1) << QSizeF( -1, -1) + << QSizeF( 6, 4) << QSizeF( 60, 40) << QSizeF(600, 400) + << QSizeF(200, -1) + << QSizeF(200, 10) << QSizeF(200, 10) << QSizeF(200, 10); + + QTest::newRow("P1-hfw-2") + << QSizeF( 6, -1) << QSizeF( 60, -1) << QSizeF(600, -1) + << QSizeF( -1, -1) << QSizeF( -1, -1) << QSizeF( -1, -1) + << QSizeF(200, -1) + << QSizeF(200, 10) << QSizeF(200, 10) << QSizeF(200, 10); + + // constraint is bigger than max width + QTest::newRow("P1-hfw-3") + << QSizeF( 5, -1) << QSizeF( 50, -1) << QSizeF(500, -1) + << QSizeF( -1, -1) << QSizeF( -1, -1) << QSizeF( -1, -1) + << QSizeF(600, -1) + << QSizeF(500, 4) << QSizeF(500, 4) << QSizeF(500, 4); + +} + +void tst_QGraphicsLayoutItem::effectiveSizeHint2() +{ + QFETCH(QSizeF, minimumSize); + QFETCH(QSizeF, preferredSize); + QFETCH(QSizeF, maximumSize); + QFETCH(QSizeF, minimumSizeHint); + QFETCH(QSizeF, preferredSizeHint); + QFETCH(QSizeF, maximumSizeHint); + + QFETCH(QSizeF, inputConstraint); + QFETCH(QSizeF, expectedMinimumESH); + QFETCH(QSizeF, expectedPreferredESH); + QFETCH(QSizeF, expectedMaximumESH); + + RectWidget *item = new RectWidget; + item->setMinimumSize(minimumSize); + item->setPreferredSize(preferredSize); + item->setMaximumSize(maximumSize); + item->setSizeHint(Qt::MinimumSize, minimumSizeHint); + item->setSizeHint(Qt::PreferredSize, preferredSizeHint); + item->setSizeHint(Qt::MaximumSize, maximumSizeHint); + + QCOMPARE(item->effectiveSizeHint(Qt::MinimumSize, inputConstraint), expectedMinimumESH); + QCOMPARE(item->effectiveSizeHint(Qt::PreferredSize, inputConstraint), expectedPreferredESH); + QCOMPARE(item->effectiveSizeHint(Qt::MaximumSize, inputConstraint), expectedMaximumESH); + +} + + // void getContentsMargins(qreal* left, qreal* top, qreal* right, qreal* bottom) const public void tst_QGraphicsLayoutItem::getContentsMargins() { diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp index f1388bc..f3d26ef 100644 --- a/tests/auto/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp @@ -83,6 +83,7 @@ private slots: void toggledVsClicked(); void childrenAreDisabled(); void propagateFocus(); + void task_QTBUG_19170_ignoreMouseReleseEvent(); private: bool checked; @@ -473,5 +474,27 @@ void tst_QGroupBox::propagateFocus() QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit)); } +void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleseEvent() +{ + QGroupBox box; + box.setCheckable(true); + box.setChecked(false); + box.setTitle("This is a test for QTBUG-19170"); + box.show(); + + QStyleOptionGroupBox option; + option.initFrom(&box); + option.subControls = QStyle::SubControls(QStyle::SC_All); + QRect rect = box.style()->subControlRect(QStyle::CC_GroupBox, &option, + QStyle::SC_GroupBoxCheckBox, &box); + + QTest::mouseClick(&box, Qt::LeftButton, 0, rect.center()); + QCOMPARE(box.isChecked(), true); + + box.setChecked(false); + QTest::mouseRelease(&box, Qt::LeftButton, 0, rect.center()); + QCOMPARE(box.isChecked(), false); +} + QTEST_MAIN(tst_QGroupBox) #include "tst_qgroupbox.moc" diff --git a/tests/auto/qimagereader/images/test-flag-rle.tga b/tests/auto/qimagereader/images/test-flag-rle.tga Binary files differnew file mode 100644 index 0000000..c14c712 --- /dev/null +++ b/tests/auto/qimagereader/images/test-flag-rle.tga diff --git a/tests/auto/qimagereader/images/test-flag.tga b/tests/auto/qimagereader/images/test-flag.tga Binary files differnew file mode 100644 index 0000000..c6d0c89 --- /dev/null +++ b/tests/auto/qimagereader/images/test-flag.tga diff --git a/tests/auto/qimagereader/images/txts.png b/tests/auto/qimagereader/images/txts.png Binary files differindex 99be1eb..99be1eb 100755..100644 --- a/tests/auto/qimagereader/images/txts.png +++ b/tests/auto/qimagereader/images/txts.png diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index 827819d..a9bfa1d 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -10,6 +10,7 @@ RESOURCES += qimagereader.qrc !contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG !contains(QT_CONFIG, no-tiff):DEFINES += QTEST_HAVE_TIFF !contains(QT_CONFIG, no-svg):DEFINES += QTEST_HAVE_SVG +!contains(QT_CONFIG, no-tga):DEFINES += QTEST_HAVE_TGA win32-msvc:QMAKE_CXXFLAGS -= -Zm200 win32-msvc:QMAKE_CXXFLAGS += -Zm800 diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc index 2c70652..03c03d6 100644 --- a/tests/auto/qimagereader/qimagereader.qrc +++ b/tests/auto/qimagereader/qimagereader.qrc @@ -67,5 +67,7 @@ <file>images/corrupt.svgz</file> <file>images/qtbug13653-no_eoi.jpg</file> <file>images/txts.png</file> + <file>images/test-flag.tga</file> + <file>images/test-flag-rle.tga</file> </qresource> </RCC> diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index 5d958d7..2b867c3 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -168,6 +168,10 @@ private slots: void tiffGrayscale(); #endif +#if defined QTEST_HAVE_TGA + void tgaTestImages(); +#endif + void autoDetectImageFormat(); void fileNameProbing(); @@ -569,6 +573,10 @@ void tst_QImageReader::imageFormat_data() QTest::newRow("mng-2") << QString("fire.mng") << QByteArray("mng") << QImage::Format_Invalid; QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg") << QImage::Format_ARGB32_Premultiplied; QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz") << QImage::Format_ARGB32_Premultiplied; +#if defined QTEST_HAVE_TGA + QTest::newRow("tga") << QString("test-flag.tga") << QByteArray("tga") << QImage::Format_ARGB32; + QTest::newRow("tga-rle") << QString("test-flag-rle.tga") << QByteArray("tga") << QImage::Format_ARGB32; +#endif } void tst_QImageReader::imageFormat() @@ -578,22 +586,31 @@ void tst_QImageReader::imageFormat() QFETCH(QImage::Format, imageFormat); if (QImageReader::imageFormat(prefix + fileName).isEmpty()) { - if (QByteArray("jpeg") == format) + if (QByteArray("jpeg") == format) { #ifndef QTEST_HAVE_JPEG return; #endif // !QTEST_HAVE_JPEG - if (QByteArray("gif") == format) + } + if (QByteArray("gif") == format) { #ifndef QTEST_HAVE_GIF return; #endif // !QTEST_HAVE_GIF - if (QByteArray("mng") == format) + } + if (QByteArray("mng") == format) { #ifndef QTEST_HAVE_MNG return; #endif // !QTEST_HAVE_MNG - if (QByteArray("svg") == format || QByteArray("svgz") == format) + } + if (QByteArray("svg") == format || QByteArray("svgz") == format) { #ifndef QTEST_HAVE_SVG return; #endif // !QTEST_HAVE_SVG + } + if (QByteArray("tga") == format) { +#ifndef QTEST_HAVE_TGA + return; +#endif // !QTEST_HAVE_TGA + } QSKIP(("Qt does not support the " + format + " format.").constData(), SkipSingle); } else { QCOMPARE(QImageReader::imageFormat(prefix + fileName), format); @@ -734,6 +751,11 @@ void tst_QImageReader::sizeBeforeRead() { QFETCH(QString, fileName); QFETCH(QByteArray, format); + + if (fileName == QLatin1String("test-flag-rle.tga")) { + QSKIP("Qt does not support reading RLE compressed TGA files", SkipSingle); + } + QImageReader reader(prefix + fileName); QVERIFY(reader.canRead()); if (format == "mng") { @@ -1711,6 +1733,27 @@ void tst_QImageReader::tiffGrayscale() } #endif +#if defined QTEST_HAVE_TGA +void tst_QImageReader::tgaTestImages() +{ + QImage tgaTest(prefix + "test-flag.tga"); + + // Test image is 400x400 of a "flag" with a blue circle in the middle + // and a green square top left, and red rectangle on the bottom so + // so we test for pixels in those areas to ensure the image is not + // inverted or the palette is not messed up. + QVERIFY(!tgaTest.isNull()); + QCOMPARE(tgaTest.size().width(), 400); + QCOMPARE(tgaTest.size().height(), 400); + QRgb pixel = tgaTest.pixel(200,200); + QCOMPARE(qRgb(0, 0, 255), pixel); + pixel = tgaTest.pixel(0, 0); + QCOMPARE(qRgb(0, 255, 0), pixel); + pixel = tgaTest.pixel(0, 399); + QCOMPARE(qRgb(255, 0, 0), pixel); +} +#endif + void tst_QImageReader::dotsPerMeter_data() { QTest::addColumn<QString>("fileName"); diff --git a/tests/auto/qintvalidator/tst_qintvalidator.cpp b/tests/auto/qintvalidator/tst_qintvalidator.cpp index d537635..7e36093 100644 --- a/tests/auto/qintvalidator/tst_qintvalidator.cpp +++ b/tests/auto/qintvalidator/tst_qintvalidator.cpp @@ -168,6 +168,15 @@ void tst_QIntValidator::validate_data() QTest::newRow("8.9") << -1 << 100 << QString("5") << ACC; QTest::newRow("8.10") << -1 << 100 << QString("+") << INT; QTest::newRow("8.11") << -1 << 100 << QString("+50") << ACC; + + QTest::newRow("9.0") << -10 << 10 << QString("000") << ACC; + QTest::newRow("9.1") << -10 << 10 << QString("008") << ACC; + QTest::newRow("9.2") << -10 << 10 << QString("-008") << ACC; + QTest::newRow("9.3") << -10 << 10 << QString("00010") << ACC; + QTest::newRow("9.4") << -10 << 10 << QString("-00010") << ACC; + QTest::newRow("9.5") << -10 << 10 << QString("00020") << INV; + QTest::newRow("9.6") << -10 << 10 << QString("-00020") << INV; + } void tst_QIntValidator::validateArabic() diff --git a/tests/auto/qlibrary/qlibrary.pro b/tests/auto/qlibrary/qlibrary.pro index 5dc129f..b351753 100644 --- a/tests/auto/qlibrary/qlibrary.pro +++ b/tests/auto/qlibrary/qlibrary.pro @@ -6,6 +6,8 @@ symbian: { # Can't build two versions of lib with same name in symbian, so just build one SUBDIRS = lib2 \ tst +} else:integrity { +# no shared support, empty test } else { SUBDIRS = lib \ lib2 \ diff --git a/tests/auto/qlocalsocket/lackey/scripts/client.js b/tests/auto/qlocalsocket/lackey/scripts/client.js index 76cc0b9..76cc0b9 100755..100644 --- a/tests/auto/qlocalsocket/lackey/scripts/client.js +++ b/tests/auto/qlocalsocket/lackey/scripts/client.js diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index b2755b5..7d85cba 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -44,7 +44,7 @@ wince*|symbian { scriptFiles.path = lackey/scripts DEPLOYMENT += additionalFiles scriptFiles QT += script # for easy deployment of QtScript - + requires(contains(QT_CONFIG,script)) } diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp index ed085ce..06e242c 100644 --- a/tests/auto/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp @@ -720,7 +720,8 @@ void tst_QMessageBox::detailsButtonText() QAbstractButton* btn = NULL; foreach(btn, list) { if (btn && (btn->inherits("QPushButton"))) { - if (btn->text() != QMessageBox::tr("OK") && btn->text() != QMessageBox::tr("Show Details...")) { + if (btn->text().remove("&") != QMessageBox::tr("OK") + && btn->text() != QMessageBox::tr("Show Details...")) { QFAIL(qPrintable(QString("Unexpected messagebox button text: %1").arg(btn->text()))); } } diff --git a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp index a83f6dd..e4c88cd 100644 --- a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp +++ b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp @@ -181,6 +181,14 @@ void tst_QNetworkCookie::parseSingleCookie_data() QTest::newRow("with-value-with-special4") << "a = \"\\\"\" " << cookie; cookie.setValue("\"\\\"a, b; c\\\"\""); QTest::newRow("with-value-with-special5") << "a = \"\\\"a, b; c\\\"\"" << cookie; + // RFC6265 states that cookie values shouldn't contain commas, but we still allow them + // since they are only reserved for future compatibility and other browsers do the same. + cookie.setValue(","); + QTest::newRow("with-value-with-special6") << "a = ," << cookie; + cookie.setValue(",b"); + QTest::newRow("with-value-with-special7") << "a = ,b" << cookie; + cookie.setValue("b,"); + QTest::newRow("with-value-with-special8") << "a = b," << cookie; cookie.setValue("b c"); QTest::newRow("with-value-with-whitespace") << "a = b c" << cookie; @@ -599,7 +607,6 @@ void tst_QNetworkCookie::parseSingleCookie() //QEXPECT_FAIL("network2", "QDateTime parsing problem: the date is beyond year 8000", Abort); QCOMPARE(result.count(), 1); - QEXPECT_FAIL("network3", "Cookie value contains commas, violating the HTTP spec", Abort); QCOMPARE(result.at(0), expectedCookie); result = QNetworkCookie::parseCookies(result.at(0).toRawForm()); @@ -634,48 +641,17 @@ void tst_QNetworkCookie::parseMultipleCookies_data() // reason: malformed NAME=VALUE pair QTest::newRow("invalid-05") << "foo" << list; QTest::newRow("invalid-06") << "=b" << list; - QTest::newRow("invalid-09") << "foo,a=b" << list; - QTest::newRow("invalid-11") << ";path=/" << list; + QTest::newRow("invalid-07") << ";path=/" << list; // reason: malformed expiration date string - QTest::newRow("invalid-12") << "a=b;expires=" << list; - QTest::newRow("invalid-13") << "a=b;expires=foobar" << list; - QTest::newRow("invalid-14") << "a=b;expires=foobar, abc" << list; - QTest::newRow("invalid-15") << "a=b;expires=foobar, dd-mmm-yyyy hh:mm:ss GMT; path=/" << list; - QTest::newRow("invalid-16") << "a=b;expires=foobar, 32-Caz-1999 24:01:60 GMT; path=/" << list; - - QNetworkCookie cookie; - cookie.setName("a"); - list += cookie; - cookie.setName("c"); - cookie.setValue("d"); - list += cookie; - QTest::newRow("two-1") << "a=,c=d" << list; - QTest::newRow("two-2") << "a=, c=d" << list; - QTest::newRow("two-3") << "a= ,c=d" << list; - QTest::newRow("two-4") << "a= , c=d" << list; - - list.clear(); - list += cookie; - cookie.setName("a"); - cookie.setValue(QByteArray()); - list += cookie; - QTest::newRow("two-5") << "c=d,a=" << list; - QTest::newRow("two-6") << "c=d, a=" << list; - QTest::newRow("two-7") << "c=d , a=" << list; - - cookie.setName("foo"); - cookie.setValue("bar"); - cookie.setPath("/"); - list += cookie; - QTest::newRow("complex-1") << "c=d, a=, foo=bar; path=/" << list; - - cookie.setName("baz"); - cookie.setDomain(".qt.nokia.com"); - list.prepend(cookie); - QTest::newRow("complex-2") << "baz=bar; path=/; domain=.qt.nokia.com, c=d,a=,foo=bar; path=/" << list; + QTest::newRow("invalid-08") << "a=b;expires=" << list; + QTest::newRow("invalid-09") << "a=b;expires=foobar" << list; + QTest::newRow("invalid-10") << "a=b;expires=foobar, abc" << list; + QTest::newRow("invalid-11") << "a=b;expires=foobar, dd-mmm-yyyy hh:mm:ss GMT; path=/" << list; + QTest::newRow("invalid-12") << "a=b;expires=foobar, 32-Caz-1999 24:01:60 GMT; path=/" << list; // cookies obtained from the network: + QNetworkCookie cookie; cookie = QNetworkCookie("id", "51706646077999719"); cookie.setDomain(".bluestreak.com"); cookie.setPath("/"); diff --git a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index d1c376a..0125fc0 100644 --- a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -417,6 +417,12 @@ void tst_QNetworkCookieJar::effectiveTLDs_data() QTest::newRow("yes7") << "org.ws" << true; QTest::newRow("yes8") << "co.uk" << true; QTest::newRow("yes9") << "wallonie.museum" << true; + QTest::newRow("yes10") << "dyndns-at-home.com" << true; + QTest::newRow("yes11") << "forgot.her.name" << true; + QTest::newRow("yes12") << "is-a-llama.com" << true; + QTest::newRow("yes13") << "gov.uk" << true; + QTest::newRow("yes14") << "manchester.museum" << true; + QTest::newRow("yes15") << "gov.ir" << true; QTest::newRow("no1") << "anything.com" << false; QTest::newRow("no2") << "anything.de" << false; diff --git a/tests/auto/qnetworkreply/.gitattributes b/tests/auto/qnetworkreply/.gitattributes index 80252cf..7fa30e3 100644 --- a/tests/auto/qnetworkreply/.gitattributes +++ b/tests/auto/qnetworkreply/.gitattributes @@ -1,3 +1,4 @@ rfc3252.txt -crlf bigfile -crlf resource -crlf +index.html -crlf diff --git a/tests/auto/qnetworkreply/index.html b/tests/auto/qnetworkreply/index.html new file mode 100644 index 0000000..135db79 --- /dev/null +++ b/tests/auto/qnetworkreply/index.html @@ -0,0 +1,3 @@ +<h1>Welcome to qt-test-server</h1> +<img src="gif/fluke.gif" alt="fluke"> +<p>This is a network test server. It serves as a cacheing ftp and http proxy, transparent http/socks5 proxy, imap, ftp and http server, plus more.</p> diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 70287a9..371ac57 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -168,6 +168,7 @@ public Q_SLOTS: void gotError(); void authenticationRequired(QNetworkReply*,QAuthenticator*); void proxyAuthenticationRequired(const QNetworkProxy &,QAuthenticator*); + void pipeliningHelperSlot(); #ifndef QT_NO_OPENSSL void sslErrors(QNetworkReply*,const QList<QSslError> &); @@ -197,6 +198,8 @@ private Q_SLOTS: void getFromHttp(); void getErrors_data(); void getErrors(); + void headFromHttp_data(); + void headFromHttp(); void putToFile_data(); void putToFile(); void putToFtp_data(); @@ -366,6 +369,7 @@ private Q_SLOTS: void qtbug15311doubleContentLength(); void qtbug18232gzipContentLengthZero(); + void nb279420gzipNoContentLengthEmptyContentDisconnect(); void synchronousRequest_data(); void synchronousRequest(); @@ -376,6 +380,8 @@ private Q_SLOTS: void httpAbort(); void dontInsertPartialContentIntoTheCache(); + void synchronousAuthenticationCache(); + void pipelining(); // NOTE: This test must be last! void parentingRepliesToTheApp(); @@ -497,6 +503,14 @@ protected: client->setParent(this); ++totalConnections; } + + virtual void reply() { + // we need to emulate the bytesWrittenSlot call if the data is empty. + if (dataToTransmit.size() == 0) + QMetaObject::invokeMethod(this, "bytesWrittenSlot", Qt::QueuedConnection); + else + client->write(dataToTransmit); + } private: void connectSocketSignals() { @@ -530,11 +544,7 @@ public slots: if (multiple) receivedData.remove(0, doubleEndlPos+4); - // we need to emulate the bytesWrittenSlot call if the data is empty. - if (dataToTransmit.size() == 0) - QMetaObject::invokeMethod(this, "bytesWrittenSlot", Qt::QueuedConnection); - else - client->write(dataToTransmit); + reply(); } } @@ -1610,6 +1620,65 @@ void tst_QNetworkReply::getFromHttp() QCOMPARE(reply->readAll(), reference.readAll()); } +void tst_QNetworkReply::headFromHttp_data() +{ + QTest::addColumn<qint64>("referenceSize"); + QTest::addColumn<QUrl>("url"); + QTest::addColumn<QString>("contentType"); + QTest::addColumn<QNetworkProxy>("proxy"); + + qint64 rfcsize = QFileInfo(SRCDIR "/rfc3252.txt").size(); + qint64 bigfilesize = QFileInfo(SRCDIR "/bigfile").size(); + qint64 indexsize = QFileInfo(SRCDIR "/index.html").size(); + + //testing proxies, mainly for the 407 response from http proxy + for (int i = 0; i < proxies.count(); ++i) { + QTest::newRow("rfc" + proxies.at(i).tag) << rfcsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << "text/plain" << proxies.at(i).proxy; + QTest::newRow("bigfile" + proxies.at(i).tag) << bigfilesize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile") << "text/plain" << proxies.at(i).proxy; + QTest::newRow("index" + proxies.at(i).tag) << indexsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/") << "text/html" << proxies.at(i).proxy; + QTest::newRow("with-authentication" + proxies.at(i).tag) << rfcsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << "text/plain" << proxies.at(i).proxy; + QTest::newRow("cgi" + proxies.at(i).tag) << (qint64)-1 << QUrl("http://qt-test-server/qtest/cgi-bin/httpcachetest_expires500.cgi") << "text/html" << proxies.at(i).proxy; + } +} + +void tst_QNetworkReply::headFromHttp() +{ + QFETCH(qint64, referenceSize); + QFETCH(QUrl, url); + QFETCH(QString, contentType); + QFETCH(QNetworkProxy, proxy); + + QNetworkRequest request(url); + QNetworkReplyPtr reply; + + QElapsedTimer time; + time.start(); + + manager.setProxy(proxy); + connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), + SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); + connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), + SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); + + RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::HeadOperation, request, reply)); + + manager.disconnect(SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), + this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); + manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), + this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); + + QVERIFY(time.elapsed() < 8000); //check authentication didn't wait for the server to timeout the http connection (15s on qt test server) + + QCOMPARE(reply->url(), request.url()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); + // only compare when the header is set. + if (reply->header(QNetworkRequest::ContentLengthHeader).isValid() && referenceSize >= 0) + QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), referenceSize); + if (reply->header(QNetworkRequest::ContentTypeHeader).isValid()) + QCOMPARE(reply->header(QNetworkRequest::ContentTypeHeader).toString(), contentType); +} + void tst_QNetworkReply::getErrors_data() { QTest::addColumn<QString>("url"); @@ -6073,6 +6142,28 @@ void tst_QNetworkReply::qtbug18232gzipContentLengthZero() QCOMPARE(reply->readAll(), QByteArray()); } +// Reproduced a crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd +// where zlib inflateEnd was called for uninitialized zlib stream +void tst_QNetworkReply::nb279420gzipNoContentLengthEmptyContentDisconnect() +{ + // Response with no Content-Length in header and empty content + QByteArray response("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\n\r\n"); + MiniHttpServer server(response); + server.doClose = true; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(reply->isFinished()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->size(), qint64(0)); + QVERIFY(!reply->header(QNetworkRequest::ContentLengthHeader).isValid()); + QCOMPARE(reply->readAll(), QByteArray()); +} + void tst_QNetworkReply::synchronousRequest_data() { QTest::addColumn<QUrl>("url"); @@ -6283,6 +6374,117 @@ void tst_QNetworkReply::dontInsertPartialContentIntoTheCache() QCOMPARE(memoryCache->m_insertedUrls.count(), 0); } +void tst_QNetworkReply::synchronousAuthenticationCache() +{ + class MiniAuthServer : public MiniHttpServer { + public: + MiniAuthServer(QThread *thread) : MiniHttpServer(QByteArray(), false, thread) {}; + virtual void reply() { + + dataToTransmit = + "HTTP/1.0 401 Unauthorized\r\n" + "WWW-Authenticate: Basic realm=\"QNetworkAccessManager Test Realm\"\r\n" + "Content-Length: 4\r\n" + "Connection: close\r\n" + "Content-Type: text/plain\r\n" + "\r\n" + "auth"; + QRegExp rx("Authorization: Basic ([^\r\n]*)\r\n"); + if (rx.indexIn(receivedData) > 0) { + if (QByteArray::fromBase64(rx.cap(1).toLatin1()) == "login:password") { + dataToTransmit = + "HTTP/1.0 200 OK\r\n" + "Content-Type: text/plain\r\n" + "Content-Length: 2\r\n" + "\r\n" + "OK"; + } + } + receivedData.clear(); + MiniHttpServer::reply(); + } + }; + + // when using synchronous commands, we need a different event loop for + // the server thread, because the client is never returning to the + // event loop + QScopedPointer<QThread, QThreadCleanup> serverThread(new QThread); + QScopedPointer<MiniHttpServer, QDeleteLaterCleanup> server(new MiniAuthServer(serverThread.data())); + server->doClose = true; + + //1) URL without credentials, we are not authenticated + { + QUrl url = "http://localhost:" + QString::number(server->serverPort()) + "/path"; + QNetworkRequest request(url); + request.setAttribute(QNetworkRequest::SynchronousRequestAttribute, true); + + QNetworkReplyPtr reply = manager.get(request); + QVERIFY(reply->isFinished()); + QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError); + } + + //2) URL with credentials, we are authenticated + { + QUrl url = "http://login:password@localhost:" + QString::number(server->serverPort()) + "/path2"; + QNetworkRequest request(url); + request.setAttribute(QNetworkRequest::SynchronousRequestAttribute, true); + + QNetworkReplyPtr reply = manager.get(request); + QVERIFY(reply->isFinished()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->readAll().constData(), "OK"); + } + + //3) URL without credentials, we are authenticated because they are cached + { + QUrl url = "http://localhost:" + QString::number(server->serverPort()) + "/path3"; + QNetworkRequest request(url); + request.setAttribute(QNetworkRequest::SynchronousRequestAttribute, true); + + QNetworkReplyPtr reply = manager.get(request); + QVERIFY(reply->isFinished()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->readAll().constData(), "OK"); + } +} + +void tst_QNetworkReply::pipelining() +{ + QString urlString("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/echo.cgi?"); + QList<QNetworkReplyPtr> replies; + for (int a = 0; a < 20; a++) { + QNetworkRequest request(urlString + QString::number(a)); + request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, QVariant(true)); + replies.append(manager.get(request)); + connect(replies.at(a), SIGNAL(finished()), this, SLOT(pipeliningHelperSlot())); + } + QTestEventLoop::instance().enterLoop(20); + QVERIFY(!QTestEventLoop::instance().timeout()); +} + +void tst_QNetworkReply::pipeliningHelperSlot() { + static int a = 0; + + // check that pipelining was used in at least one of the replies + static bool pipeliningWasUsed = false; + QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender()); + bool pipeliningWasUsedInReply = reply->attribute(QNetworkRequest::HttpPipeliningWasUsedAttribute).toBool(); + if (pipeliningWasUsedInReply) + pipeliningWasUsed = true; + + // check that the contents match (the response to echo.cgi?3 should return 3 etc.) + QString urlQueryString = reply->url().queryItems().at(0).first; + QString content = reply->readAll(); + QVERIFY2(urlQueryString == content, "data corruption with pipelining detected"); + + a++; + + if (a == 20) { // all replies have finished + QTestEventLoop::instance().exitLoop(); + QVERIFY2(pipeliningWasUsed, "pipelining was not used in any of the replies when trying to test pipelining"); + } +} + // NOTE: This test must be last testcase in tst_qnetworkreply! void tst_QNetworkReply::parentingRepliesToTheApp() { diff --git a/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp b/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp index 9052716..02d1e5a 100644 --- a/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp +++ b/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp @@ -414,7 +414,7 @@ void tst_QNetworkRequest::rawHeaderParsing_data() QTest::newRow("SetCookie-3") << QNetworkRequest::SetCookieHeader << qVariantFromValue(QList<QNetworkCookie>() << cookie << cookie2) << true << "Set-Cookie" - << "a=b; path=/, c=d"; + << "a=b; path=/\nc=d"; } void tst_QNetworkRequest::rawHeaderParsing() diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index 1f52aec..f9ec6ce 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -139,11 +139,6 @@ private slots: void tst_QObjectRace::moveToThreadRace() { -#if defined(Q_OS_SYMBIAN) - // ### FIXME: task 257411 - remove xfail once this is fixed - QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race, see task: 257411", Abort); - QVERIFY(false); -#endif RaceObject *object = new RaceObject; enum { ThreadCount = 6 }; @@ -229,13 +224,6 @@ public: void tst_QObjectRace::destroyRace() { -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // ### FIXME: task 257411 - remove xfail once this is fixed. - // Oddly enough, this seems to work properly in HW, if given enough time and memory. - QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race on emulator, see task: 257411", Abort); - QVERIFY(false); -#endif - enum { ThreadCount = 10, ObjectCountPerThread = 733, ObjectCount = ThreadCount * ObjectCountPerThread }; diff --git a/tests/auto/qplugin/qplugin.pro b/tests/auto/qplugin/qplugin.pro index 37a12da..1dcf0a7 100644 --- a/tests/auto/qplugin/qplugin.pro +++ b/tests/auto/qplugin/qplugin.pro @@ -22,7 +22,7 @@ mac { SUBDIRS = debugplugin releaseplugin tst_qplugin_pro.depends += debugplugin releaseplugin } -SUBDIRS += tst_qplugin.pro +!integrity:SUBDIRS += tst_qplugin.pro CONFIG += parallel_test diff --git a/tests/auto/qpluginloader/qpluginloader.pro b/tests/auto/qpluginloader/qpluginloader.pro index 6e41b4c..cb25b0f 100644 --- a/tests/auto/qpluginloader/qpluginloader.pro +++ b/tests/auto/qpluginloader/qpluginloader.pro @@ -1,10 +1,10 @@ QT = core TEMPLATE = subdirs CONFIG += ordered -SUBDIRS = lib \ +!integrity:SUBDIRS = lib \ theplugin \ tst -!win32: !macx-*: !symbian: SUBDIRS += almostplugin +!win32: !macx-*: !symbian: !integrity: SUBDIRS += almostplugin TARGET = tst_qpluginloader # no special install rule for subdir diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp index d2d92a5..152d1f4 100644 --- a/tests/auto/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp @@ -272,10 +272,10 @@ void tst_QPluginLoader::loadHints() void tst_QPluginLoader::deleteinstanceOnUnload() { - for (int pass = 0; pass < 2; ++pass) { + for (int pass = 0; pass < 4; ++pass) { QPluginLoader loader1; loader1.setFileName( sys_qualifiedLibraryName("theplugin")); //a plugin - if (pass == 0) + if (pass < 2) loader1.load(); // not recommended, instance() should do the job. PluginInterface *instance1 = qobject_cast<PluginInterface*>(loader1.instance()); QVERIFY(instance1); @@ -283,21 +283,32 @@ void tst_QPluginLoader::deleteinstanceOnUnload() QPluginLoader loader2; loader2.setFileName( sys_qualifiedLibraryName("theplugin")); //a plugin - if (pass == 0) + if (pass < 2) loader2.load(); // not recommended, instance() should do the job. PluginInterface *instance2 = qobject_cast<PluginInterface*>(loader2.instance()); QCOMPARE(instance2->pluginName(), QLatin1String("Plugin ok")); QSignalSpy spy1(loader1.instance(), SIGNAL(destroyed())); QSignalSpy spy2(loader2.instance(), SIGNAL(destroyed())); - if (pass == 0) { - QCOMPARE(loader2.unload(), false); // refcount not reached 0, not really unloaded - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); - } + + // refcount not reached 0, not really unloaded + if (pass % 2) + QCOMPARE(loader1.unload(), false); + else + QCOMPARE(loader2.unload(), false); + + QCOMPARE(spy1.count(), 0); + QCOMPARE(spy2.count(), 0); + QCOMPARE(instance1->pluginName(), QLatin1String("Plugin ok")); QCOMPARE(instance2->pluginName(), QLatin1String("Plugin ok")); - QVERIFY(loader1.unload()); // refcount reached 0, did really unload + + // refcount reached 0, did really unload + if (pass % 2) + QVERIFY(loader2.unload()); + else + QVERIFY(loader1.unload()); + QCOMPARE(spy1.count(), 1); QCOMPARE(spy2.count(), 1); } diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp index 04b7ce7..878cce8 100644 --- a/tests/auto/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp @@ -63,6 +63,7 @@ private slots: void text(); void format(); void setValueRepaint(); + void setMinMaxRepaint(); void sizeHint(); void formatedText_data(); void formatedText(); @@ -216,6 +217,44 @@ void tst_QProgressBar::setValueRepaint() } } +void tst_QProgressBar::setMinMaxRepaint() +{ + ProgressBar pbar; + pbar.setMinimum(0); + pbar.setMaximum(10); + pbar.setFormat("%v"); + pbar.show(); + QTest::qWaitForWindowShown(&pbar); + + QApplication::processEvents(); + + // No repaint when setting minimum to the current minimum + pbar.repainted = false; + pbar.setMinimum(0); + QTest::qWait(50); + QTRY_VERIFY(!pbar.repainted); + + // No repaint when setting maximum to the current maximum + pbar.repainted = false; + pbar.setMaximum(10); + QTest::qWait(50); + QTRY_VERIFY(!pbar.repainted); + + // Repaint when setting minimum + for (int i = 9; i >= 0; i--) { + pbar.repainted = false; + pbar.setMinimum(i); + QTRY_VERIFY(pbar.repainted); + } + + // Repaint when setting maximum + for (int i = 0; i < 10; ++i) { + pbar.repainted = false; + pbar.setMaximum(i); + QTRY_VERIFY(pbar.repainted); + } +} + void tst_QProgressBar::sizeHint() { ProgressBar bar; diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index 9ca6994..6359549 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -40,6 +40,8 @@ wince*|symbian:{ testsub2.path = testqrc/test/test DEPLOYMENT += deploy test alias other search1 search2 sub testsub testsub2 !symbian:DEFINES += SRCDIR=\\\"\\\" +} else:integrity { + DEFINES += SRCDIR=\"/\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qscriptjstestsuite/tests/ecma/Date/15.9.1.13-1.js b/tests/auto/qscriptjstestsuite/tests/ecma/Date/15.9.1.13-1.js index 720b39d..720b39d 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma/Date/15.9.1.13-1.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma/Date/15.9.1.13-1.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma/ExecutionContexts/10.1.3-2.js b/tests/auto/qscriptjstestsuite/tests/ecma/ExecutionContexts/10.1.3-2.js index 3762842..3762842 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma/ExecutionContexts/10.1.3-2.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma/ExecutionContexts/10.1.3-2.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma/README b/tests/auto/qscriptjstestsuite/tests/ecma/README index 91f174a..91f174a 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma/README +++ b/tests/auto/qscriptjstestsuite/tests/ecma/README diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/README b/tests/auto/qscriptjstestsuite/tests/ecma_2/README index 6da6cdd..6da6cdd 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/README +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/README diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/constructor-001.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/constructor-001.js index cc7907d..cc7907d 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/constructor-001.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/constructor-001.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/function-001.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/function-001.js index 5153d25..5153d25 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/function-001.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/function-001.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-001.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-001.js index 8ea446a..8ea446a 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-001.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-001.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-002.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-002.js index 9cc837d..9cc837d 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-002.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-002.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-003-n.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-003-n.js index 7a763a8..7a763a8 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-003-n.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-003-n.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-004-n.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-004-n.js index 1662ae5..1662ae5 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-004-n.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-004-n.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-005-n.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-005-n.js index 1a9b1b3..1a9b1b3 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-005-n.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-005-n.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-006.js b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-006.js index 03c0f16..03c0f16 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-006.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_2/extensions/instanceof-006.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.4.11-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.4.11-01.js index 0436b8c..0436b8c 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.4.11-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.4.11-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.5.1-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.5.1-01.js index b55430b..b55430b 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.5.1-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/15.4.5.1-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-01.js index 4e277e6..4e277e6 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-02.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-02.js index ee426a0..ee426a0 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-02.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-02.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-03.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-03.js index 95ee7f7..95ee7f7 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-03.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-03.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-04.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-04.js index fe9f8fc..fe9f8fc 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-04.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-322135-04.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-387501.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-387501.js index 36cf147..36cf147 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-387501.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-387501.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-421325.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-421325.js index c869d7b..c869d7b 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-421325.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-421325.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-430717.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-430717.js index f750ffb..f750ffb 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-430717.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Array/regress-430717.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.1.2-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.1.2-01.js index 61b1de6..61b1de6 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.1.2-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.1.2-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.3.2-1.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.3.2-1.js index d79b60b..d79b60b 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.3.2-1.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.3.2-1.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.4.3.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.4.3.js index b197dcb..b197dcb 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.4.3.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.4.3.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.5.5-02.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.5.5-02.js index e3b073e..e3b073e 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.5.5-02.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Date/15.9.5.5-02.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/10.6.1-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/10.6.1-01.js index 6fbe85e..6fbe85e 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/10.6.1-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/10.6.1-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/regress-448595-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/regress-448595-01.js index f303199..f303199 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/regress-448595-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/ExecutionContexts/regress-448595-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-01.js index fd47d5d..fd47d5d 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-02.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-02.js index 8f387c1..8f387c1 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-02.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-02.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-03.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-03.js index 99af0f8..99af0f8 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-03.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.10-03.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.1-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.1-01.js index 05f9622..05f9622 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.1-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.1-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.2-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.2-01.js index 64e4268..64e4268 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.2-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.2-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.3-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.3-01.js index d5af3b8..d5af3b8 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.3-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Expressions/11.7.3-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/arguments-002.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/arguments-002.js index 7800556..7800556 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/arguments-002.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/arguments-002.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/regress-313570.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/regress-313570.js index e159c4c..e159c4c 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/regress-313570.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Function/regress-313570.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/LexicalConventions/7.9.1.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/LexicalConventions/7.9.1.js index 10ee26f..10ee26f 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/LexicalConventions/7.9.1.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/LexicalConventions/7.9.1.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Number/regress-442242-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Number/regress-442242-01.js index e3fa070..e3fa070 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Number/regress-442242-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Number/regress-442242-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/8.6.1-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/8.6.1-01.js index 2897ece..2897ece 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/8.6.1-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/8.6.1-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-361274.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-361274.js index d396200..d396200 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-361274.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-361274.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-385393-07.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-385393-07.js index 0473fe4..0473fe4 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-385393-07.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Object/regress-385393-07.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.13.1-002.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.13.1-002.js index 5d3307e..5d3307e 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.13.1-002.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.13.1-002.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.4.1-002.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.4.1-002.js index c48565b..c48565b 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.4.1-002.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/11.4.1-002.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/order-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/order-01.js index 671face..671face 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/order-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Operators/order-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/README b/tests/auto/qscriptjstestsuite/tests/ecma_3/README index eebd421..eebd421 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/README +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/README diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/15.10.2.12.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/15.10.2.12.js index d68b86c..d68b86c 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/15.10.2.12.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/15.10.2.12.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-285219.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-285219.js index 9d46235..9d46235 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-285219.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-285219.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-289669.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-289669.js index 2e3d044..2e3d044 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-289669.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-289669.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-307456.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-307456.js index dd2f540..dd2f540 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-307456.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-307456.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-309840.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-309840.js index 8680b7b..8680b7b 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-309840.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-309840.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-311414.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-311414.js index a24a07b..a24a07b 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-311414.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-311414.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-312351.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-312351.js index a9b00d3..a9b00d3 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-312351.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-312351.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-330684.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-330684.js index b097fbc..b097fbc 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-330684.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-330684.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-334158.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-334158.js index 41ebf0a..41ebf0a 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-334158.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-334158.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-346090.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-346090.js index dfd53a9..dfd53a9 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-346090.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-346090.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-367888.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-367888.js index 923c1e5..923c1e5 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-367888.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-367888.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375642.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375642.js index 236eb00..236eb00 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375642.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375642.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375711.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375711.js index 6e7339f..6e7339f 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375711.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375711.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-01-n.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-01-n.js index 437dcbd..437dcbd 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-01-n.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-01-n.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-02.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-02.js index 3cd858e..3cd858e 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-02.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-02.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-03.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-03.js index ffc5c5a..ffc5c5a 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-03.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-03.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-04.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-04.js index 0c78a37..0c78a37 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-04.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/RegExp/regress-375715-04.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-385393-04.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-385393-04.js index 6e735fd..6e735fd 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-385393-04.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-385393-04.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-419152.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-419152.js index f57f3a4..f57f3a4 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-419152.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-419152.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420087.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420087.js index 1f21d19..1f21d19 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420087.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420087.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420610.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420610.js index ecd5a2d..ecd5a2d 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420610.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-420610.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-441477-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-441477-01.js index 1be1997..1be1997 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-441477-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Regress/regress-441477-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/12.6.3.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/12.6.3.js index 97c3ca3..97c3ca3 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/12.6.3.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/12.6.3.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-302439.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-302439.js index e1ebdb6..e1ebdb6 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-302439.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-302439.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-324650.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-324650.js index 003cd0f..003cd0f 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-324650.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Statements/regress-324650.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-304376.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-304376.js index 733cd71..733cd71 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-304376.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-304376.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-313567.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-313567.js index 9610238..9610238 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-313567.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-313567.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-392378.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-392378.js index 368fde1..368fde1 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-392378.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/String/regress-392378.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-01.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-01.js index bb10ac6..bb10ac6 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-01.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-01.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-02-n.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-02-n.js index 0e3c4b0..0e3c4b0 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-02-n.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/Unicode/regress-352044-02-n.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/browser.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/browser.js index 2339522..2339522 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/browser.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/browser.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/10.1.3-2.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/10.1.3-2.js index f941cb7..f941cb7 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/10.1.3-2.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/10.1.3-2.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/7.9.1.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/7.9.1.js index b69e9d0..b69e9d0 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/7.9.1.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/7.9.1.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-274152.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-274152.js index d7074d9..d7074d9 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-274152.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-274152.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-320854.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-320854.js index 85e6848..85e6848 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-320854.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-320854.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-327170.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-327170.js index 5d15ce3..5d15ce3 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-327170.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-327170.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-368516.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-368516.js index a5f5fb7..a5f5fb7 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-368516.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-368516.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-385393-03.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-385393-03.js index 40c7e8d..40c7e8d 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-385393-03.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-385393-03.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-429248.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-429248.js index 9966269..9966269 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-429248.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-429248.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-430740.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-430740.js index 446adb9..446adb9 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-430740.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/extensions/regress-430740.js diff --git a/tests/auto/qscriptjstestsuite/tests/ecma_3/template.js b/tests/auto/qscriptjstestsuite/tests/ecma_3/template.js index 4dedd5a..4dedd5a 100755..100644 --- a/tests/auto/qscriptjstestsuite/tests/ecma_3/template.js +++ b/tests/auto/qscriptjstestsuite/tests/ecma_3/template.js diff --git a/tests/auto/qsharedpointer/qsharedpointer.pro b/tests/auto/qsharedpointer/qsharedpointer.pro index 014006e..37ab4ce 100644 --- a/tests/auto/qsharedpointer/qsharedpointer.pro +++ b/tests/auto/qsharedpointer/qsharedpointer.pro @@ -9,7 +9,12 @@ HEADERS += forwarddeclared.h \ wrapper.h QT = core -!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" + +integrity { + DEFINES += SRCDIR=\"/\" +} else:!symbian { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} include(externaltests.pri) CONFIG += parallel_test diff --git a/tests/auto/qsqldatabase/testdata/qtest.mdb b/tests/auto/qsqldatabase/testdata/qtest.mdb Binary files differindex f388f19..f388f19 100755..100644 --- a/tests/auto/qsqldatabase/testdata/qtest.mdb +++ b/tests/auto/qsqldatabase/testdata/qtest.mdb diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h index 497f5a4..95ead61 100644 --- a/tests/auto/qsqldatabase/tst_databases.h +++ b/tests/auto/qsqldatabase/tst_databases.h @@ -246,7 +246,8 @@ public: // addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3308, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 4.1.1 // addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux // addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // MySQL 5.1.36 Windows -// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql4-nokia.trolltech.com.au" ); // MySQL 4.1.22-2.el4 linux + +// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql41.apac.nokia.com" ); // MySQL 4.1.22-2.el4 linux // addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql50.apac.nokia.com" ); // MySQL 5.0.45-7.el5 linux // addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql51.apac.nokia.com" ); // MySQL 5.1.36-6.7.2.i586 linux @@ -256,13 +257,15 @@ public: // addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5436 ); // V7.4 // addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5437 ); // V8.0.3 // addDb( "QPSQL7", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // V8.2.1, UTF-8 -// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "postgres74-nokia.trolltech.com.au" ); // Version 7.4.19-1.el4_6.1 + +// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-postgres74.apac.nokia.com" ); // Version 7.4.19-1.el4_6.1 // addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql81.apac.nokia.com" ); // Version 8.1.11-1.el5_1.1 // addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql84.apac.nokia.com" ); // Version 8.4.1-2.1.i586 // addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql90.apac.nokia.com" ); // Version 9.0.0 // addDb( "QDB2", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // DB2 v9.1 on silence +// addDb( "QDB2", "testdb", "testuser", "Ee4Gabf6_", "bq-db2-972.apac.nokia.com" ); // DB2 // yes - interbase really wants the physical path on the host machine. // addDb( "QIBASE", "/opt/interbase/qttest.gdb", "SYSDBA", "masterkey", "horsehead.nokia.troll.no" ); @@ -271,6 +274,9 @@ public: // addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "firebird1-nokia.trolltech.com.au" ); // Firebird 1.5.5 // addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "firebird2-nokia.trolltech.com.au" ); // Firebird 2.1.1 +// addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "bq-firebird1.apac.nokia.com" ); // Firebird 1.5.5 +// addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "bq-firebird2.apac.nokia.com" ); // Firebird 2.1.1 + // use in-memory database to prevent local files // addDb("QSQLITE", ":memory:"); addDb( "QSQLITE", QDir::toNativeSeparators(QDir::tempPath()+"/foo.db") ); diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 592b49a..3cbdb63 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -213,6 +213,8 @@ private slots: void QTBUG_5765(); void QTBUG_14132_data() { generic_data("QOCI"); } void QTBUG_14132(); + void QTBUG_21884_data() { generic_data("QSQLITE"); } + void QTBUG_21884(); void sqlite_constraint_data() { generic_data("QSQLITE"); } void sqlite_constraint(); @@ -328,6 +330,7 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) << qTableName("bug6421", __FILE__).toUpper() << qTableName("bug5765", __FILE__) << qTableName("bug6852", __FILE__) + << qTableName("bug21884", __FILE__) << qTableName( "qtest_lockedtable", __FILE__ ) << qTableName( "Planet", __FILE__ ) << qTableName( "task_250026", __FILE__ ) @@ -3104,6 +3107,50 @@ void tst_QSqlQuery::QTBUG_5765() QCOMPARE(q.value(0).toInt(), 123); } +/** +* This test case tests multiple statements in one execution. +* Sqlite driver doesn't support multiple statement at one time. +* If more than one statement is given, the exec or prepare function +* return failure to the client. +*/ +void tst_QSqlQuery::QTBUG_21884() +{ + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QSqlQuery q(db); + + QStringList stList; + QString tableName(qTableName("bug21884", __FILE__ )); + stList << "create table " + tableName + "(id integer primary key, note string)"; + stList << "select * from " + tableName + ";"; + stList << "select * from " + tableName + "; \t\n\r"; + stList << "drop table " + tableName; + + + foreach (const QString& st, stList) { + QVERIFY_SQL(q, exec(st)); + } + + foreach (const QString& st, stList) { + QVERIFY_SQL(q, prepare(st)); + QVERIFY_SQL(q, exec()); + } + + stList.clear(); + stList << "create table " + tableName + "(id integer primary key); select * from " + tableName; + stList << "create table " + tableName + "(id integer primary key); syntax error!;"; + stList << "create table " + tableName + "(id integer primary key);;"; + stList << "create table " + tableName + "(id integer primary key);\'\"\a\b\b\v"; + + foreach (const QString&st , stList) { + QVERIFY2(!q.prepare(st), qPrintable(QString("the statement is expected to fail! ") + st)); + QVERIFY2(!q.exec(st), qPrintable(QString("the statement is expected to fail! ") + st)); + } +} + + void tst_QSqlQuery::oraOCINumber() { QFETCH( QString, dbName ); diff --git a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index 5f1a621..5ecf514 100644 --- a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -93,6 +93,7 @@ private slots: void whiteSpaceInIdentifiers(); void psqlSchemaTest(); void selectAfterUpdate(); + void relationOnFirstColumn(); private: void dropTestTables( QSqlDatabase db ); @@ -1490,5 +1491,59 @@ void tst_QSqlRelationalTableModel::selectAfterUpdate() QCOMPARE(model.data(model.index(0,2)), QVariant("mrs")); } +/** + This test case verifies bug fix for QTBUG-20038. + */ +void tst_QSqlRelationalTableModel::relationOnFirstColumn() +{ + QFETCH_GLOBAL(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QString testTable1 = qTableName("QTBUG_20038_test1", __FILE__); + QString testTable2 = qTableName("QTBUG_20038_test2", __FILE__); + tst_Databases::safeDropTables(db, QStringList() << testTable1 << testTable2); + + //prepare test1 table + QSqlQuery q(db); + QVERIFY_SQL(q, exec("CREATE TABLE " + testTable1 + " (val1 INTEGER, id1 INTEGER PRIMARY KEY);")); + QVERIFY_SQL(q, exec("DELETE FROM " + testTable1 + ";")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(1, 10);")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(2, 20);")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(3, 30);")); + + //prepare test2 table + QVERIFY_SQL(q, exec("CREATE TABLE " + testTable2 + " (id INTEGER PRIMARY KEY, name TEXT);")); + QVERIFY_SQL(q, exec("DELETE FROM " + testTable2 + ";")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (10, 'Hervanta');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (20, 'Keskusta');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (30, 'Annala');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (40, 'Tammela');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (50, 'Amuri');")); + + //set test model + QSqlRelationalTableModel model(NULL, db); + model.setTable(testTable1); + model.setRelation(0, QSqlRelation(testTable2, "id", "name")); + QVERIFY_SQL(model, select()); + + //verify the data + QCOMPARE(model.data(model.index(0, 0)), QVariant("Hervanta")); + QCOMPARE(model.data(model.index(1, 0)), QVariant("Keskusta")); + QCOMPARE(model.data(model.index(2, 0)), QVariant("Annala")); + + //modify the model data + QVERIFY_SQL(model, setData(model.index(0, 0), 40)); + QVERIFY_SQL(model, setData(model.index(1, 0), 50)); + QVERIFY_SQL(model, setData(model.index(2, 0), 30)); + + //verify the data after modificaiton + QCOMPARE(model.data(model.index(0, 0)), QVariant("Tammela")); + QCOMPARE(model.data(model.index(1, 0)), QVariant("Amuri")); + QCOMPARE(model.data(model.index(2, 0)), QVariant("Annala")); + + tst_Databases::safeDropTables(db, QStringList() << testTable1 << testTable2); +} + QTEST_MAIN(tst_QSqlRelationalTableModel) #include "tst_qsqlrelationaltablemodel.moc" diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp index 79c3ba8..a6c7a86 100644 --- a/tests/auto/qstyle/tst_qstyle.cpp +++ b/tests/auto/qstyle/tst_qstyle.cpp @@ -213,10 +213,10 @@ void tst_QStyle::testStyleFactory() #endif #ifdef Q_WS_WIN if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && - QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) + (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) QVERIFY(keys.contains("WindowsXP")); if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && - QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) + (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) QVERIFY(keys.contains("WindowsVista")); #endif diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index 64a043b..4cbc76d 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -7,6 +7,8 @@ symbian { testData.files = tst_qtemporaryfile.cpp testData.path = . DEPLOYMENT += testData +} else:integrity { + DEFINES += SRCDIR=\"/\" }else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro index 5f3cb11..c52ca52 100644 --- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro +++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro @@ -2,7 +2,11 @@ load(qttest_p4) QT = core HEADERS += SOURCES += tst_qtextboundaryfinder.cpp -!symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\" +integrity { + DEFINES += SRCDIR=\"/\" +} else:!symbian { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} wince*|symbian:{ addFiles.files = data diff --git a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp index f36b335..4489daa 100644 --- a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp +++ b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp @@ -146,7 +146,7 @@ void tst_QTextBrowser::cleanup() void tst_QTextBrowser::noReloadOnAnchorJump() { - QUrl url("anchor.html"); + QUrl url("file:anchor.html"); browser->htmlLoadAttempts = 0; browser->setSource(url); @@ -162,7 +162,7 @@ void tst_QTextBrowser::noReloadOnAnchorJump() void tst_QTextBrowser::bgColorOnSourceChange() { - browser->setSource(QUrl("pagewithbg.html")); + browser->setSource(QUrl("file:pagewithbg.html")); QVERIFY(browser->document()->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush)); QVERIFY(browser->document()->rootFrame()->frameFormat().background().color() == Qt::blue); @@ -179,7 +179,7 @@ void tst_QTextBrowser::forwardButton() QVERIFY(browser->historyTitle(0).isEmpty()); QVERIFY(browser->historyTitle(1).isEmpty()); - browser->setSource(QUrl("pagewithbg.html")); + browser->setSource(QUrl("file:pagewithbg.html")); QVERIFY(!forwardEmissions.isEmpty()); QVariant val = forwardEmissions.takeLast()[0]; @@ -192,7 +192,7 @@ void tst_QTextBrowser::forwardButton() QVERIFY(val.toBool() == false); QVERIFY(browser->historyTitle(-1).isEmpty()); - QCOMPARE(browser->historyUrl(0), QUrl("pagewithbg.html")); + QCOMPARE(browser->historyUrl(0), QUrl("file:pagewithbg.html")); QCOMPARE(browser->documentTitle(), QString("Page With BG")); QCOMPARE(browser->historyTitle(0), QString("Page With BG")); QVERIFY(browser->historyTitle(1).isEmpty()); @@ -244,7 +244,7 @@ void tst_QTextBrowser::forwardButton() void tst_QTextBrowser::viewportPositionInHistory() { - browser->setSource(QUrl("bigpage.html")); + browser->setSource(QUrl("file:bigpage.html")); browser->scrollToAnchor("bottom"); QVERIFY(browser->verticalScrollBar()->value() > 0); @@ -283,7 +283,7 @@ void tst_QTextBrowser::relativeLinks() void tst_QTextBrowser::anchors() { - browser->setSource(QUrl("bigpage.html")); + browser->setSource(QUrl("file:bigpage.html")); browser->setSource(QUrl("#bottom")); QVERIFY(browser->verticalScrollBar()->value() > 0); @@ -306,7 +306,7 @@ void tst_QTextBrowser::forwardBackwardAvailable() QVERIFY(!browser->isBackwardAvailable()); QVERIFY(!browser->isForwardAvailable()); - browser->setSource(QUrl("anchor.html")); + browser->setSource(QUrl("file:anchor.html")); QVERIFY(!browser->isBackwardAvailable()); QVERIFY(!browser->isForwardAvailable()); QCOMPARE(backwardSpy.count(), 1); @@ -406,7 +406,7 @@ void tst_QTextBrowser::clearHistory() backwardSpy.clear(); forwardSpy.clear(); - browser->setSource(QUrl("anchor.html")); + browser->setSource(QUrl("file:anchor.html")); QVERIFY(!browser->isBackwardAvailable()); QVERIFY(!browser->isForwardAvailable()); QCOMPARE(backwardSpy.count(), 1); @@ -447,7 +447,7 @@ void tst_QTextBrowser::clearHistory() void tst_QTextBrowser::sourceInsideLoadResource() { - QUrl url("pagewithimage.html"); + QUrl url("file:pagewithimage.html"); browser->setSource(url); QCOMPARE(browser->lastResource.toString(), QUrl::fromLocalFile(QDir::current().filePath("foobar.png")).toString()); QEXPECT_FAIL("", "This is currently not supported", Continue); @@ -532,7 +532,7 @@ void tst_QTextBrowser::adjacentAnchors() void tst_QTextBrowser::loadResourceOnRelativeLocalFiles() { - browser->setSource(QUrl("subdir/index.html")); + browser->setSource(QUrl("file:subdir/index.html")); QVERIFY(!browser->toPlainText().isEmpty()); QVariant v = browser->loadResource(QTextDocument::HtmlResource, QUrl("../anchor.html")); QVERIFY(v.isValid()); @@ -543,7 +543,7 @@ void tst_QTextBrowser::loadResourceOnRelativeLocalFiles() void tst_QTextBrowser::focusIndicator() { HackBrowser *browser = new HackBrowser; - browser->setSource(QUrl("firstpage.html")); + browser->setSource(QUrl("file:firstpage.html")); QVERIFY(!browser->textCursor().hasSelection()); browser->focusTheNextChild(); @@ -595,7 +595,7 @@ void tst_QTextBrowser::focusIndicator() void tst_QTextBrowser::focusHistory() { HackBrowser *browser = new HackBrowser; - browser->setSource(QUrl("firstpage.html")); + browser->setSource(QUrl("file:firstpage.html")); QVERIFY(!browser->textCursor().hasSelection()); browser->focusTheNextChild(); diff --git a/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro index 9fef8e4..3193caa 100644 --- a/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro +++ b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro @@ -1,4 +1,6 @@ TEMPLATE = subdirs SUBDIRS = test qsystemlock - +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + test \ + qsystemlock \ diff --git a/tests/auto/qtipc/qtipc.pro b/tests/auto/qtipc/qtipc.pro index 60037d2..fb32e51 100644 --- a/tests/auto/qtipc/qtipc.pro +++ b/tests/auto/qtipc/qtipc.pro @@ -4,3 +4,7 @@ SUBDIRS=\ qsharedmemory \ qsystemsemaphore \ +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + lackey \ + qsharedmemory \ + qsystemsemaphore \ diff --git a/tests/auto/qtranslator/i18n/hellotr_en.qm b/tests/auto/qtranslator/i18n/hellotr_en.qm Binary files differnew file mode 100644 index 0000000..cc42afe --- /dev/null +++ b/tests/auto/qtranslator/i18n/hellotr_en.qm diff --git a/tests/auto/qtranslator/tst_qtranslator.cpp b/tests/auto/qtranslator/tst_qtranslator.cpp index 8e2ed15..6f65e6a 100644 --- a/tests/auto/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/qtranslator/tst_qtranslator.cpp @@ -66,6 +66,10 @@ protected: private slots: void load(); void load2(); + void loadSubdir(); + void loadSubdir2(); + void loadSubdir3(); + void loadSubdir4(); void threadLoad(); void testLanguageChange(); void plural(); @@ -124,6 +128,38 @@ void tst_QTranslator::load2() QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); } +void tst_QTranslator::loadSubdir() +{ + QTranslator tor( 0 ); + tor.load("hellotr_en_GB", "i18n"); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + +void tst_QTranslator::loadSubdir2() +{ + QTranslator tor( 0 ); + tor.load("i18n/hellotr_en_GB"); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + +void tst_QTranslator::loadSubdir3() +{ + QTranslator tor( 0 ); + tor.load(QString(QLatin1String("i18n%1hellotr_en_GB")).arg(QDir::separator())); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + +void tst_QTranslator::loadSubdir4() +{ + QTranslator tor( 0 ); + tor.load("./hellotr_en_GB", "i18n"); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + class TranslatorThread : public QThread { void run() { @@ -249,10 +285,10 @@ void tst_QTranslator::loadFromResource() void tst_QTranslator::loadDirectory() { - QVERIFY(QFileInfo("../qtranslator").isDir()); + QVERIFY(QFileInfo("i18n").isDir()); QTranslator tor; - tor.load("qtranslator", ".."); + tor.load("qtranslator", "i18n"); QVERIFY(tor.isEmpty()); } diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index facb982..be991dc 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -45,6 +45,7 @@ #include <QtTest/QtTest> #include <QtGui/QtGui> +#include <private/qabstractitemview_p.h> #include "../../shared/util.h" //TESTED_CLASS= @@ -112,6 +113,7 @@ struct PublicView : public QTreeView inline QStyleOptionViewItem viewOptions() const { return QTreeView::viewOptions(); } inline int sizeHintForColumn(int column) const { return QTreeView::sizeHintForColumn(column); } + QAbstractItemViewPrivate* aiv_priv() { return static_cast<QAbstractItemViewPrivate*>(d_ptr.data()); } }; class tst_QTreeView : public QObject @@ -2903,6 +2905,10 @@ void tst_QTreeView::styleOptionViewItem() { class MyDelegate : public QStyledItemDelegate { + static QString posToString(QStyleOptionViewItemV4::ViewItemPosition pos) { + static const char* s_pos[] = { "Invalid", "Beginning", "Middle", "End", "OnlyOne" }; + return s_pos[pos]; + } public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const { @@ -2919,16 +2925,16 @@ void tst_QTreeView::styleOptionViewItem() QCOMPARE(!(opt.features & QStyleOptionViewItemV2::HasCheckIndicator), !opt.text.contains("Checkable")); if (opt.text.contains("Beginning")) - QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::Beginning); + QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Beginning)); if (opt.text.contains("Middle")) - QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::Middle); + QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Middle)); if (opt.text.contains("End")) - QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::End); + QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::End)); if (opt.text.contains("OnlyOne")) - QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::OnlyOne); + QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::OnlyOne)); if (opt.text.contains("Checked")) QCOMPARE(opt.checkState, Qt::Checked); @@ -2947,47 +2953,51 @@ void tst_QTreeView::styleOptionViewItem() bool allCollapsed; }; - QTreeView view; + PublicView view; QStandardItemModel model; view.setModel(&model); MyDelegate delegate; view.setItemDelegate(&delegate); model.appendRow(QList<QStandardItem*>() - << new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") ); + << new QStandardItem("Beginning") << new QStandardItem("Hidden") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") ); QStandardItem *par1 = new QStandardItem("Beginning HasChildren"); model.appendRow(QList<QStandardItem*>() - << par1 << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") ); + << par1 << new QStandardItem("Hidden") << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") ); model.appendRow(QList<QStandardItem*>() - << new QStandardItem("OnlyOne") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") ); + << new QStandardItem("OnlyOne") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") ); QStandardItem *checkable = new QStandardItem("Checkable"); checkable->setCheckable(true); QStandardItem *checked = new QStandardItem("Checkable Checked"); - checkable->setCheckable(true); + checked->setCheckable(true); checked->setCheckState(Qt::Checked); model.appendRow(QList<QStandardItem*>() - << new QStandardItem("Beginning") << checkable << checked << new QStandardItem("End") ); + << new QStandardItem("Beginning") << new QStandardItem("Hidden") << checkable << checked << new QStandardItem("End") ); model.appendRow(QList<QStandardItem*>() - << new QStandardItem("Beginning Last") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") ); + << new QStandardItem("Beginning Last") << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") ); par1->appendRow(QList<QStandardItem*>() - << new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") ); + << new QStandardItem("Beginning") << new QStandardItem("Hidden") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") ); QStandardItem *par2 = new QStandardItem("Beginning HasChildren"); par1->appendRow(QList<QStandardItem*>() - << par2 << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") ); + << par2 << new QStandardItem("Hidden") << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") ); par2->appendRow(QList<QStandardItem*>() - << new QStandardItem("Beginning Last") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") ); + << new QStandardItem("Beginning Last") << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") ); QStandardItem *par3 = new QStandardItem("Beginning Last"); par1->appendRow(QList<QStandardItem*>() - << par3 << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") ); + << par3 << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") ); par3->appendRow(QList<QStandardItem*>() - << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") ); + << new QStandardItem("Assert") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") ); view.setRowHidden(0, par3->index(), true); par1->appendRow(QList<QStandardItem*>() - << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") ); + << new QStandardItem("Assert") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") ); view.setRowHidden(3, par1->index(), true); + view.setColumnHidden(1, true); + const int visibleColumns = 4; + const int modelColumns = 5; + view.header()->swapSections(2, 3); view.setFirstColumnSpanned(2, QModelIndex(), true); view.setAlternatingRowColors(true); @@ -3006,6 +3016,12 @@ void tst_QTreeView::styleOptionViewItem() QApplication::processEvents(); QTRY_VERIFY(delegate.count >= 4); + // test that the rendering of drag pixmap sets the correct options too (QTBUG-15834) + delegate.count = 0; + QItemSelection sel(model.index(0,0), model.index(0,modelColumns-1)); + QRect rect; + view.aiv_priv()->renderToPixmap(sel.indexes(), &rect); + QTRY_VERIFY(delegate.count == visibleColumns); //test dynamic models { diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index ee06b53..a881583 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -397,6 +397,9 @@ private slots: void minimizedWindowModeTransitions(); void normalWindowModeTransitions(); void focusSwitchClosesPopupMenu(); +#if !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE) + void opacityChangeCausesBackingStoreRecreation(); +#endif #endif void focusProxyAndInputMethods(); @@ -10334,7 +10337,47 @@ void tst_QWidget::focusSwitchClosesPopupMenu() mainWindow.activateWindow(); QVERIFY(!CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed()); } -#endif + +#if !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE) +class OpacityChangeWidget : public QWidget +{ +public: + OpacityChangeWidget() : m_paintEngineType(QPaintEngine::MaxUser) { } + void paintEvent(QPaintEvent *) + { + QPainter painter(this); + m_paintEngineType = painter.paintEngine()->type(); + } + QPaintEngine::Type paintEngineType() const { return m_paintEngineType; } +private: + QPaintEngine::Type m_paintEngineType; +}; + +void tst_QWidget::opacityChangeCausesBackingStoreRecreation() +{ + OpacityChangeWidget w; + w.show(); + QTest::qWaitForWindowShown(&w); + const QPaintEngine::Type type = w.paintEngineType(); + if (QPaintEngine::OpenGL != type && QPaintEngine::OpenVG != type) { + QSKIP("Test case is only valid when using opengl or openvg graphics system", SkipAll); + } else { + if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces) { + QSKIP("Test case is only valid when EGL surface transparency is not supported", SkipAll); + } else { + // Making window transparent should force switch to raster graphics system + w.setAttribute(Qt::WA_TranslucentBackground, true); + w.repaint(); + QCOMPARE(w.paintEngineType(), QPaintEngine::Raster); + // Making window opaque should cause switch back to previous graphics system + w.setAttribute(Qt::WA_TranslucentBackground, false); + w.repaint(); + QCOMPARE(w.paintEngineType(), type); + } + } +} +#endif // !Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE +#endif // Q_OS_SYMBIAN class InputContextTester : public QInputContext { diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index e443720..51bb88e 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -167,6 +167,7 @@ private Q_SLOTS: void setFocusQString() const; void setFocusQStringFailure() const; void setFocusQStringSignature() const; + void setFocusQStringFailureAfterSucces() const; void recompilationWithEvaluateToResultFailing() const; void secondEvaluationWithEvaluateToResultFailing() const; void recompilationWithEvaluateToReceiver() const; @@ -1976,6 +1977,25 @@ void tst_QXmlQuery::setFocusQStringSignature() const static_cast<bool>(query.setFocus(QString())); } +void tst_QXmlQuery::setFocusQStringFailureAfterSucces() const +{ + /* Test for QTBUG-18050. First call setFocus with a valid string, + * and then with an invalid string. evaluateTo should not crash. */ + QXmlQuery query; + MessageSilencer silencer; + query.setMessageHandler(&silencer); + + QVERIFY(query.setFocus(QLatin1String("<test>valid-input</test>"))); + QVERIFY(!query.setFocus(QLatin1String("invalid-input"))); + + query.setQuery("/query"); + + QString output; + /* Last setFocus was with an invalid string, so evaluateTo should return + * false */ + QVERIFY(!query.evaluateTo(&output)); +} + void tst_QXmlQuery::setFocusQIODeviceTriggerWarnings() const { /* A null pointer. */ diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent index 1cff3fd..1cff3fd 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent index 45f6d8e..45f6d8e 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent index 3436f20..3436f20 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent index c6e97f8..c6e97f8 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent index 4df2f0c..4df2f0c 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent Binary files differindex ab1d696..ab1d696 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent Binary files differindex c6ca61f..c6ca61f 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent index 67c3297..67c3297 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent index b19be3a..b19be3a 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent index 8eb1fb9..8eb1fb9 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent index 7f25c50..7f25c50 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent Binary files differindex 470fd6f..470fd6f 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/015.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/015.ent Binary files differindex 86a8679..86a8679 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/015.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/ext-sa/015.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/002.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/002.ent index 67c3297..67c3297 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/002.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/002.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent index 931f3ad..931f3ad 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent index 40f7ff5..40f7ff5 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent index 61def75c..61def75c 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent index ade9599..ade9599 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent index bef50b1..bef50b1 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/006.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/006.ent index 8f305a8..8f305a8 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/006.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/006.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/007.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/007.ent index fbf4ca4..fbf4ca4 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/007.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/007.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/008.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/008.ent index fbf4ca4..fbf4ca4 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/008.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/008.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/009.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/009.ent index fbf4ca4..fbf4ca4 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/009.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/009.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/010.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/010.ent index 52a28f5..52a28f5 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/010.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/010.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/011.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/011.ent index fbf4ca4..fbf4ca4 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/011.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/011.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/012.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/012.ent index 7e372e6..7e372e6 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/012.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/012.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/013.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/013.ent index a3691d9..a3691d9 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/013.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/013.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/014.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/014.ent index 6eaf779..6eaf779 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/014.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/014.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/015.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/015.ent index 00d2f30..00d2f30 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/015.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/015.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/016.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/016.ent index bf77ef8..bf77ef8 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/016.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/016.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/017.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/017.ent index ffd9add..ffd9add 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/017.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/017.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/018.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/018.ent index 2d46f76..2d46f76 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/018.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/018.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/019.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/019.ent index d18201a..d18201a 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/019.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/019.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/020.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/020.ent index 815291c..815291c 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/020.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/020.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/021.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/021.ent index 9f8f2af..9f8f2af 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/021.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/021.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/022.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/022.ent index 26f2d8b..26f2d8b 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/022.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/022.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/023.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/023.ent index e326881..e326881 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/023.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/023.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/024.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/024.ent index aa6d0ec..aa6d0ec 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/024.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/024.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/025.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/025.ent index 389d259..389d259 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/025.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/025.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/026.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/026.ent index bdc93af..bdc93af 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/026.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/026.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/027.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/027.ent index 712cce3..712cce3 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/027.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/027.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/028.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/028.ent index ac249d7..ac249d7 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/028.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/028.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/029.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/029.ent index df94df5..df94df5 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/029.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/029.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/030.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/030.ent index e386446..e386446 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/030.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/030.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent index f7f94ab..f7f94ab 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent diff --git a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent index bef50b1..bef50b1 100755..100644 --- a/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent +++ b/tests/auto/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent diff --git a/tests/auto/script.pro b/tests/auto/script.pro index c4d0544..80d259d 100644 --- a/tests/auto/script.pro +++ b/tests/auto/script.pro @@ -16,3 +16,5 @@ SUBDIRS=\ qscriptvaluegenerated \ qscriptvalueiterator \ +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qscriptcontext \ diff --git a/tests/auto/selftests/selftests.pro b/tests/auto/selftests/selftests.pro index 74cd075..1494e38 100644 --- a/tests/auto/selftests/selftests.pro +++ b/tests/auto/selftests/selftests.pro @@ -12,5 +12,6 @@ INSTALLS = QT = core +integrity: SUBDIRS -= test CONFIG += parallel_test diff --git a/tests/auto/xmlpatterns.pro b/tests/auto/xmlpatterns.pro index b9244d6..4940cc4 100644 --- a/tests/auto/xmlpatterns.pro +++ b/tests/auto/xmlpatterns.pro @@ -46,4 +46,5 @@ xmlpatternsxqts.depends = xmlpatternssdk xmlpatternssdk \ xmlpatternsxqts \ xmlpatternsxslts \ + xmlpatternsschemats \ diff --git a/tests/auto/xmlpatternsvalidator/files/schema-with-restrictions.xsd b/tests/auto/xmlpatternsvalidator/files/schema-with-restrictions.xsd new file mode 100644 index 0000000..532efcb --- /dev/null +++ b/tests/auto/xmlpatternsvalidator/files/schema-with-restrictions.xsd @@ -0,0 +1,37 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:annotation> + <xsd:documentation xml:lang="en"> + Test for QTBUG-21375: xmlpatternsvalidator does not allow for non-numeric literals in xsd:double attributes + </xsd:documentation> + </xsd:annotation> + + <xsd:element name="test1" type="TestType1" /> + <xsd:element name="test2" type="TestType2" /> + <xsd:element name="test3" type="TestType3" /> + + <xsd:complexType name="TestType1"> + <xsd:attribute name="attribute1" type="DoubleWithRestrictions" default="INF" /> + </xsd:complexType> + + <xsd:complexType name="TestType2"> + <xsd:attribute name="attribute2" type="DoubleWithRestrictions" default="-INF" /> + </xsd:complexType> + + <xsd:complexType name="TestType3"> + <xsd:attribute name="attribute3" type="DoubleWithRestrictions" default="NaN" /> + </xsd:complexType> + + <xsd:simpleType name="DoubleWithRestrictions"> + <xsd:union> + <xsd:simpleType> + <xsd:restriction base="xsd:double"> + <xsd:enumeration value="-INF" /> + <xsd:enumeration value="INF" /> + <xsd:enumeration value="NaN" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + +</xsd:schema> diff --git a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp index 817ea1a..60c1fe8 100644 --- a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp +++ b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp @@ -222,6 +222,11 @@ void tst_XmlPatternsValidator::xsdSupport_data() const << (QStringList() << QLatin1String("files/dateTime-with-microseconds.xml") << QLatin1String("files/dateTime-with-microseconds.xsd")) << QString(); + + QTest::newRow("QTBUG-21375 A schema with a xs:double based simple type with non-numeric restrictions") + << 0 + << (QStringList() << QLatin1String("files/schema-with-restrictions.xsd")) + << QString(); } QTEST_MAIN(tst_XmlPatternsValidator) diff --git a/tests/benchmarks/corelib/io/io.pro b/tests/benchmarks/corelib/io/io.pro index 97445d7..15ae0d2 100644 --- a/tests/benchmarks/corelib/io/io.pro +++ b/tests/benchmarks/corelib/io/io.pro @@ -3,7 +3,7 @@ SUBDIRS = \ qdir \ qdiriterator \ qfile \ - qfileinfo \ + #qfileinfo \ # FIXME: broken qiodevice \ qtemporaryfile diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp index 0d0251f..8b1dbe2 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp @@ -44,7 +44,6 @@ #ifdef Q_OS_WIN # include <windows.h> -# include <atlbase.h> #else # include <sys/stat.h> # include <sys/types.h> @@ -176,7 +175,9 @@ void tst_qdiriterator::posix() QString path(dirpath); QBENCHMARK { #ifdef Q_OS_WIN - count = posix_helper(path.utf16()); + wchar_t wPath[MAX_PATH]; + path.toWCharArray(wPath); + count = posix_helper(wPath); #else count = posix_helper(dirpath.constData()); #endif diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro index 17d164d..a501b1b 100755..100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro @@ -7,8 +7,6 @@ INCLUDEPATH += . QT -= gui CONFIG += release -CONFIG += debug - SOURCES += main.cpp diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp index 935bccd..ede398d 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp @@ -229,7 +229,7 @@ void QFileSystemIteratorPrivate::pushSubDirectory(const QByteArray &path) #ifdef Q_OS_WIN wchar_t szSearchPath[MAX_PATH]; - wcscpy(szSearchPath, QString(path).utf16()); + QString::fromAscii(path).toWCharArray(szSearchPath); wcscat(szSearchPath, L"\\*"); HANDLE dir = FindFirstFile(szSearchPath, &m_fileSearchResult); m_bFirstSearchResult = true; diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp index 6211751..e22637a 100644 --- a/tests/benchmarks/corelib/io/qfile/main.cpp +++ b/tests/benchmarks/corelib/io/qfile/main.cpp @@ -51,7 +51,6 @@ #ifdef Q_OS_WIN # include <windows.h> -# include <atlbase.h> #endif #define BUFSIZE 1024*512 diff --git a/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro b/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro index 2e0f6a1..2e0f6a1 100755..100644 --- a/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro +++ b/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro index 5ecb94c..3f1272d 100644 --- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro +++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro @@ -5,8 +5,6 @@ DEPENDPATH += . INCLUDEPATH += . CONFIG += release -#CONFIG += debug - SOURCES += tst_qtimer_vs_qmetaobject.cpp QT -= gui diff --git a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro index f3dd66a..59e0070 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro +++ b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro @@ -5,7 +5,5 @@ DEPENDPATH += . INCLUDEPATH += . CONFIG += release -#CONFIG += debug - SOURCES += tst_qvariant.cpp diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp index 05a1575..eca38b6 100644 --- a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp @@ -128,7 +128,9 @@ private slots: void noThread_data(); void noThread(); + void constructionNative(); void uncontendedNative(); + void constructionQMutex(); void uncontendedQMutex(); void uncontendedQMutexLocker(); @@ -205,6 +207,15 @@ void tst_QMutex::noThread() QCOMPARE(int(count), N); } +void tst_QMutex::constructionNative() +{ + QBENCHMARK { + NativeMutexType mutex; + NativeMutexInitialize(&mutex); + NativeMutexDestroy(&mutex); + } +} + void tst_QMutex::uncontendedNative() { NativeMutexType mutex; @@ -216,6 +227,14 @@ void tst_QMutex::uncontendedNative() NativeMutexDestroy(&mutex); } +void tst_QMutex::constructionQMutex() +{ + QBENCHMARK { + QMutex mutex; + Q_UNUSED(mutex); + } +} + void tst_QMutex::uncontendedQMutex() { QMutex mutex; diff --git a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro b/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro index 3474dd0..3474dd0 100755..100644 --- a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro +++ b/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro diff --git a/tests/benchmarks/corelib/tools/qline/main.cpp b/tests/benchmarks/corelib/tools/qline/main.cpp new file mode 100644 index 0000000..d7f93ba --- /dev/null +++ b/tests/benchmarks/corelib/tools/qline/main.cpp @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +// This file contains benchmarks for QLineF functions. + +#include <QDebug> +#include <qtest.h> +#include <QLine> + +class tst_qline : public QObject +{ + Q_OBJECT +private slots: + void fromPolar(); + void intersect_data(); + void intersect(); + void length(); + void setLength(); + void angle(); + void setAngle(); + void angleTo(); + void unitVector(); + void normalVector(); + void angle2(); +}; + +void tst_qline::fromPolar() +{ + QBENCHMARK { + QLineF::fromPolar(10, 2); + } +} + +void tst_qline::intersect_data() +{ + QTest::addColumn<QLineF>("l1"); + QTest::addColumn<QLineF>("l2"); + QTest::newRow("cross") << QLineF(-1,-1,1,1) << QLineF(-1,1,1,-1); + QTest::newRow("miss") << QLineF(1,1,2,2) << QLineF(1,11,2,12); +} + +void tst_qline::intersect() +{ + QFETCH(QLineF, l1); + QFETCH(QLineF, l2); + QPointF intersection; + QBENCHMARK { + l1.intersect(l2, &intersection); + } +} + +void tst_qline::length() +{ + QLineF line(1,2,3,4); + QBENCHMARK { + line.length(); + } +} + +void tst_qline::setLength() +{ + QLineF line(1,2,3,4); + QBENCHMARK { + line.setLength(5); + } +} + +void tst_qline::angle() +{ + QLineF line(1,2,3,4); + QBENCHMARK { + line.angle(); + } +} + +void tst_qline::setAngle() +{ + QLineF line(1,2,3,4); + QBENCHMARK { + line.setAngle(1); + } +} + +void tst_qline::angleTo() +{ + QLineF line1(1,2,3,4); + QLineF line2(8,7,6,5); + QBENCHMARK { + line1.angleTo(line2); + } +} + +void tst_qline::unitVector() +{ + QLineF line(1,2,3,4); + QBENCHMARK { + line.unitVector(); + } +} + +void tst_qline::normalVector() +{ + QLineF line(1,2,3,4); + QBENCHMARK { + line.normalVector(); + } +} + +void tst_qline::angle2() +{ + QLineF line1(1,2,3,4); + QLineF line2(8,7,6,5); + QBENCHMARK { + line1.angle(line2); + } +} + +QTEST_MAIN(tst_qline) + +#include "main.moc" diff --git a/tests/benchmarks/corelib/tools/qline/qline.pro b/tests/benchmarks/corelib/tools/qline/qline.pro new file mode 100644 index 0000000..ae6bf5e --- /dev/null +++ b/tests/benchmarks/corelib/tools/qline/qline.pro @@ -0,0 +1,12 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_bench_qline +DEPENDPATH += . +INCLUDEPATH += . + +QT -= gui + +CONFIG += release + +# Input +SOURCES += main.cpp diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro index ffdad12..eea5d87 100644 --- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro +++ b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro @@ -12,7 +12,7 @@ CONFIG += release # Input SOURCES += main.cpp -include( $${QT_SOURCE_TREE}/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri ) +include( $${QT_SOURCE_TREE}/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pri ) exists( /usr/include/boost/regex.hpp ){ DEFINES+=HAVE_BOOST diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index 5b5f0f7..943302c 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -58,6 +58,11 @@ #include <unistd.h> #endif +// MAP_ANON is deprecated on Linux, and MAP_ANONYMOUS is not present on Mac +#ifndef MAP_ANONYMOUS +# define MAP_ANONYMOUS MAP_ANON +#endif + #include <private/qsimd_p.h> #include "data.h" @@ -784,12 +789,12 @@ void tst_QString::equals2_data() const static void __attribute__((noinline)) equals2_selftest() { -#ifdef Q_OS_UNIX +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) const long pagesize = sysconf(_SC_PAGESIZE); void *page1, *page3; ushort *page2; page1 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0); + page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); page3 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); Q_ASSERT(quintptr(page2) == quintptr(page1) + pagesize || quintptr(page2) == quintptr(page1) - pagesize); @@ -938,7 +943,7 @@ static inline int ucstrncmp_short_tail(const ushort *p1, const ushort *p2, int l return 0; } -static inline int bsf_nonzero(register long val) +static inline int bsf_nonzero(register int val) { int result; # ifdef Q_CC_GNU @@ -1341,12 +1346,12 @@ void tst_QString::ucstrncmp() const }; static const int functionCount = sizeof func / sizeof func[0]; -#ifdef Q_OS_UNIX +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) const long pagesize = sysconf(_SC_PAGESIZE); void *page1, *page3; ushort *page2; page1 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0); + page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); page3 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); Q_ASSERT(quintptr(page2) == quintptr(page1) + pagesize || quintptr(page2) == quintptr(page1) - pagesize); diff --git a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro b/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro index 06a5836..b4a4622 100644 --- a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro +++ b/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro @@ -1,6 +1,5 @@ load(qttest_p4) TARGET = tst_bench_qstringlist -CONFIG -= debug CONFIG += release QT -= gui SOURCES += main.cpp diff --git a/tests/benchmarks/corelib/tools/tools.pro b/tests/benchmarks/corelib/tools/tools.pro index 44e8973..9ad3950 100644 --- a/tests/benchmarks/corelib/tools/tools.pro +++ b/tests/benchmarks/corelib/tools/tools.pro @@ -3,10 +3,13 @@ SUBDIRS = \ containers-associative \ containers-sequential \ qbytearray \ + qline \ qlist \ qrect \ - qregexp \ + #qregexp \ # FIXME: broken qstring \ qstringbuilder \ qstringlist \ qvector + +!*g++*: SUBDIRS -= qstring diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro index 73e40b2..4534d81 100644 --- a/tests/benchmarks/declarative/declarative.pro +++ b/tests/benchmarks/declarative/declarative.pro @@ -12,4 +12,10 @@ SUBDIRS += \ contains(QT_CONFIG, opengl): SUBDIRS += painting qmlshadersplugin +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + creation \ + pointers \ + qdeclarativeimage \ + script \ + include(../trusted-benchmarks.pri) diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml index f9f92a4..f9f92a4 100755..100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml index b8a15ae..b8a15ae 100755..100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml diff --git a/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png b/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png Binary files differindex 4a9b283..4a9b283 100755..100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png +++ b/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png diff --git a/tests/benchmarks/gui/animation/qanimation/qanimation.pro b/tests/benchmarks/gui/animation/qanimation/qanimation.pro index 53a139a..e42a830 100644 --- a/tests/benchmarks/gui/animation/qanimation/qanimation.pro +++ b/tests/benchmarks/gui/animation/qanimation/qanimation.pro @@ -5,8 +5,6 @@ DEPENDPATH += . INCLUDEPATH += . CONFIG += release -#CONFIG += debug - SOURCES += main.cpp \ dummyobject.cpp \ diff --git a/tests/benchmarks/gui/graphicsview/graphicsview.pro b/tests/benchmarks/gui/graphicsview/graphicsview.pro index 1509466..cd7d88e 100644 --- a/tests/benchmarks/gui/graphicsview/graphicsview.pro +++ b/tests/benchmarks/gui/graphicsview/graphicsview.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - functional \ + #functional \ # FIXME: broken qgraphicsanchorlayout \ qgraphicsitem \ qgraphicslayout \ diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 3b690da..9497227 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -40,11 +40,8 @@ ****************************************************************************/ #include <qtest.h> +#include <QtGui> #include <QDebug> -#include <QGraphicsItem> -#include <QGraphicsScene> -#include <QGraphicsView> -#include <QImage> #include "chiptester/chiptester.h" //#define CALLGRIND_DEBUG diff --git a/tests/benchmarks/gui/kernel/qapplication/main.cpp b/tests/benchmarks/gui/kernel/qapplication/main.cpp index 6399168..6231980 100644 --- a/tests/benchmarks/gui/kernel/qapplication/main.cpp +++ b/tests/benchmarks/gui/kernel/qapplication/main.cpp @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include <QApplication> +#include <QtGui> #include <qtest.h> diff --git a/tests/benchmarks/network/kernel/kernel.pro b/tests/benchmarks/network/kernel/kernel.pro index 1ec3071..13345a5 100644 --- a/tests/benchmarks/network/kernel/kernel.pro +++ b/tests/benchmarks/network/kernel/kernel.pro @@ -1,3 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ qhostinfo + +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qhostinfo diff --git a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro index b242d60..b242d60 100755..100644 --- a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro +++ b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg index 3005133..3005133 100755..100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png Binary files differindex f3024f7..f3024f7 100755..100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png Binary files differindex 144c02d..144c02d 100755..100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png Binary files differindex c73d389..c73d389 100755..100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png Binary files differindex b226773..b226773 100755..100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg Binary files differindex 5bc7b58..5bc7b58 100755..100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri index 79e6a9f..524d7c3 100644 --- a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri +++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri @@ -1,6 +1,9 @@ -# checksum 0xc123 version 0x10008 -# This file should not be edited. -# Future versions of Qt Creator might offer updated versions of this file. +# checksum 0x5b42 version 0x70012 +# This file was generated by the Qt Quick Application wizard of Qt Creator. +# The code below adds the QmlApplicationViewer to the project and handles the +# activation of QML debugging. +# It is recommended not to modify this file, since newer versions of Qt Creator +# may offer an updated version of it. QT += declarative @@ -8,58 +11,21 @@ SOURCES += $$PWD/qmlapplicationviewer.cpp HEADERS += $$PWD/qmlapplicationviewer.h INCLUDEPATH += $$PWD -contains(DEFINES, QMLOBSERVER) { - DEFINES *= QMLJSDEBUGGER +# Include JS debugger library if QMLJSDEBUGGER_PATH is set +!isEmpty(QMLJSDEBUGGER_PATH) { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) +} else { + DEFINES -= QMLJSDEBUGGER } -defineTest(minQtVersion) { - maj = $$1 - min = $$2 - patch = $$3 - isEqual(QT_MAJOR_VERSION, $$maj) { - isEqual(QT_MINOR_VERSION, $$min) { - isEqual(QT_PATCH_VERSION, $$patch) { - return(true) - } - greaterThan(QT_PATCH_VERSION, $$patch) { - return(true) - } - } - greaterThan(QT_MINOR_VERSION, $$min) { - return(true) - } - } - return(false) -} - -contains(DEFINES, QMLJSDEBUGGER) { - CONFIG(debug, debug|release) { - !minQtVersion(4, 7, 1) { - warning() - warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") - warning("This library requires Qt 4.7.1 or newer.") - warning() - - error("Qt version $$QT_VERSION too old for QmlJS Debugging. Aborting.") - } - isEmpty(QMLJSDEBUGGER_PATH) { - warning() - warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") - warning("Please specify its location on the qmake command line, eg") - warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") - warning() - - error("QMLJSDEBUGGER defined, but no QMLJSDEBUGGER_PATH set on command line. Aborting.") - DEFINES -= QMLJSDEBUGGER - } else { - include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) - } - } else { - DEFINES -= QMLJSDEBUGGER - } +contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) { + DEFINES += HARMATTAN_BOOSTER } -# This file should not be edited. -# Future versions of Qt Creator might offer updated versions of this file. +# This file was generated by an application wizard of Qt Creator. +# The code below handles deployment to Symbian and Maemo, aswell as copying +# of the application data to shadow build directories on desktop. +# It is recommended not to modify this file, since newer versions of Qt Creator +# may offer an updated version of it. defineTest(qtcAddDeployment) { for(deploymentfolder, DEPLOYMENTFOLDERS) { @@ -76,19 +42,31 @@ for(deploymentfolder, DEPLOYMENTFOLDERS) { MAINPROFILEPWD = $$PWD symbian { - ICON = $${TARGET}.svg - TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 - contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone - contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices + isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg + isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } else:win32 { - !isEqual(PWD,$$OUT_PWD) { - copyCommand = @echo Copying application data... - for(deploymentfolder, DEPLOYMENTFOLDERS) { - source = $$eval($${deploymentfolder}.source) - pathSegments = $$split(source, /) - sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) - copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, /, \\) + sourcePathSegments = $$split(source, \\) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments) + target = $$replace(target, /, \\) + target ~= s,\\\\\\.?\\\\,\\, + !isEqual(source,$$target) { + !isEmpty(copyCommand):copyCommand += && + isEqual(QMAKE_DIR_SEP, \\) { + copyCommand += $(COPY_DIR) \"$$source\" \"$$target\" + } else { + source = $$replace(source, \\\\, /) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + target = $$replace(target, \\\\, /) + copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\" + } } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand copydeploymentfolders.commands = $$copyCommand first.depends = $(first) copydeploymentfolders export(first.depends) @@ -97,22 +75,37 @@ symbian { } } else:unix { maemo5 { - installPrefix = /opt/usr + desktopfile.files = $${TARGET}.desktop desktopfile.path = /usr/share/applications/hildon - } else { - installPrefix = /usr/local + icon.files = $${TARGET}64.png + icon.path = /usr/share/icons/hicolor/64x64/apps + } else:!isEmpty(MEEGO_VERSION_MAJOR) { + desktopfile.files = $${TARGET}_harmattan.desktop desktopfile.path = /usr/share/applications - !isEqual(PWD,$$OUT_PWD) { - copyCommand = @echo Copying application data... - for(deploymentfolder, DEPLOYMENTFOLDERS) { - macx { - target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) - } else { - target = $$OUT_PWD/$$eval($${deploymentfolder}.target) - } - copyCommand += && $(MKDIR) $$target - copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + icon.files = $${TARGET}80.png + icon.path = /usr/share/icons/hicolor/80x80/apps + } else { # Assumed to be a Desktop Unix + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, \\\\, /) + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) } + target = $$replace(target, \\\\, /) + sourcePathSegments = $$split(source, /) + targetFullPath = $$target/$$last(sourcePathSegments) + targetFullPath ~= s,/\\.?/,/, + !isEqual(source,$$targetFullPath) { + !isEmpty(copyCommand):copyCommand += && + copyCommand += $(MKDIR) \"$$target\" + copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\" + } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand copydeploymentfolders.commands = $$copyCommand first.depends = $(first) copydeploymentfolders export(first.depends) @@ -120,26 +113,29 @@ symbian { QMAKE_EXTRA_TARGETS += first copydeploymentfolders } } + installPrefix = /opt/$${TARGET} for(deploymentfolder, DEPLOYMENTFOLDERS) { item = item$${deploymentfolder} itemfiles = $${item}.files $$itemfiles = $$eval($${deploymentfolder}.source) itempath = $${item}.path - $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target) export($$itemfiles) export($$itempath) INSTALLS += $$item } - icon.files = $${TARGET}.png - icon.path = /usr/share/icons/hicolor/64x64/apps - desktopfile.files = $${TARGET}.desktop + + !isEmpty(desktopfile.path) { + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + INSTALLS += icon desktopfile + } + target.path = $${installPrefix}/bin - export(icon.files) - export(icon.path) - export(desktopfile.files) - export(desktopfile.path) export(target.path) - INSTALLS += desktopfile icon target + INSTALLS += target } export (ICON) diff --git a/tests/manual/qssloptions/main.cpp b/tests/manual/qssloptions/main.cpp new file mode 100644 index 0000000..727ad23 --- /dev/null +++ b/tests/manual/qssloptions/main.cpp @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtNetwork/qsslconfiguration.h> +#include <QtCore/QCoreApplication> +#include <QtCore/QTextStream> +#include <stdio.h> + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + + if (argc < 3) { + QTextStream out(stdout); + out << "Usage: " << argv[0] << " host port [options]" << endl; + out << "The options can be one or more of the following:" << endl; + out << "enable_empty_fragments" << endl; + out << "disable_session_tickets" << endl; + out << "disable_compression" << endl; + out << "disable_sni" << endl; + out << "enable_unsafe_reneg" << endl; + return 1; + } + + QString host = QString::fromLocal8Bit(argv[1]); + int port = QString::fromLocal8Bit(argv[2]).toInt(); + + QSslConfiguration config = QSslConfiguration::defaultConfiguration(); + + for (int i=3; i < argc; i++) { + QString option = QString::fromLocal8Bit(argv[i]); + + if (option == QLatin1String("enable_empty_fragments")) + config.setSslOption(QSsl::SslOptionDisableEmptyFragments, false); + else if (option == QLatin1String("disable_session_tickets")) + config.setSslOption(QSsl::SslOptionDisableSessionTickets, true); + else if (option == QLatin1String("disable_compression")) + config.setSslOption(QSsl::SslOptionDisableCompression, true); + else if (option == QLatin1String("disable_sni")) + config.setSslOption(QSsl::SslOptionDisableServerNameIndication, true); + else if (option == QStringLiteral("enable_unsafe_reneg")) + config.setSslOption(QSsl::SslOptionDisableLegacyRenegotiation, false); + } + + QSslConfiguration::setDefaultConfiguration(config); + + QSslSocket socket; + //socket.setSslConfiguration(config); + socket.connectToHostEncrypted(host, port); + + if ( !socket.waitForEncrypted() ) { + qDebug() << socket.errorString(); + return 1; + } + + return 0; +} diff --git a/tests/manual/qssloptions/qssloptions.pro b/tests/manual/qssloptions/qssloptions.pro new file mode 100644 index 0000000..c1c8446 --- /dev/null +++ b/tests/manual/qssloptions/qssloptions.pro @@ -0,0 +1,12 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qssloptions +DEPENDPATH += . +INCLUDEPATH += . + +QT -= gui +QT += network + +#CONFIG += release + +SOURCES += main.cpp |