diff options
Diffstat (limited to 'tests/auto')
20 files changed, 102 insertions, 97 deletions
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/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index d452820..d24f52f 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -2531,6 +2531,12 @@ void tst_QAccessibility::menuTest() QCOMPARE(interface->actionText(QAccessible::DefaultAction, QAccessible::Name, 4), QString()); QCOMPARE(interface->actionText(QAccessible::DefaultAction, QAccessible::Name, 5), QString("Execute")); + // QTBUG-21578 - after setting accessible name on a menu it would no longer + // return the right names for it's children. + QCOMPARE(interface->text(QAccessible::Name, 1), QString("New...")); + file->setAccessibleName("File"); + QCOMPARE(interface->text(QAccessible::Name, 1), QString("New...")); + QAccessibleInterface *iface = 0; QAccessibleInterface *iface2 = 0; diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp index 7f6d43a..65e23bf 100644 --- a/tests/auto/qcolumnview/tst_qcolumnview.cpp +++ b/tests/auto/qcolumnview/tst_qcolumnview.cpp @@ -461,6 +461,7 @@ void tst_QColumnView::scrollTo() view.setCurrentIndex(index); QTest::qWait(ANIMATION_DELAY); view.scrollTo(index, QAbstractItemView::EnsureVisible); + QTest::qWait(ANIMATION_DELAY); index = index.parent(); if (start != level) { if (!reverse) diff --git a/tests/auto/qglthreads/tst_qglthreads.cpp b/tests/auto/qglthreads/tst_qglthreads.cpp index 859f47f..60fb10c 100644 --- a/tests/auto/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/qglthreads/tst_qglthreads.cpp @@ -49,6 +49,7 @@ #include <unistd.h> // for usleep #define RUNNING_TIME 2000 // save GPU mem by running shorter time. #else +#include "qplatformdefs.h" // for usleep #define RUNNING_TIME 5000 #endif diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index cd3f84f..b62dfbd 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -92,7 +92,7 @@ private: const static QIcon staticIcon; }; -// Creating an icon statically should not cause a crash. +// Creating an icon statically should not cause a crash. // But we do not officially support this. See QTBUG-8666 const QIcon tst_QIcon::staticIcon = QIcon::fromTheme("edit-find"); @@ -468,7 +468,19 @@ void tst_QIcon::addFile() icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png"), QSize(), QIcon::Selected); icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-128.png"), QSize(), QIcon::Selected); -#ifndef Q_OS_WINCE +#ifdef Q_OS_WINCE + // WinCE only includes the 16x16 images for size reasons + QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() == + QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); + QVERIFY(icon.pixmap(16, QIcon::Selected).toImage() == + QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-16.png")).toImage()); +#elif defined(Q_OS_SYMBIAN) + // Symbian only includes the 32x32 images for size reasons + QVERIFY(icon.pixmap(32, QIcon::Normal).toImage() == + QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png")).toImage()); + QVERIFY(icon.pixmap(32, QIcon::Selected).toImage() == + QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png")).toImage()); +#else QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() == QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); QVERIFY(icon.pixmap(32, QIcon::Normal).toImage() == @@ -481,12 +493,6 @@ void tst_QIcon::addFile() QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png")).toImage()); QVERIFY(icon.pixmap(128, QIcon::Selected).toImage() == QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-128.png")).toImage()); -#else - // WinCE only includes the 16x16 images for size reasons - QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() == - QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); - QVERIFY(icon.pixmap(16, QIcon::Selected).toImage() == - QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-16.png")).toImage()); #endif } @@ -537,18 +543,27 @@ void tst_QIcon::availableSizes() QVERIFY(availableSizes.isEmpty()); } +#ifndef Q_OS_SYMBIAN + const int defaultDimension = 16; + QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"); +#else + // In Symbian, only 32 times 32 icons are included. + const int defaultDimension = 32; + QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png"); +#endif + { // we try to load an icon from resources - QIcon icon(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")); + QIcon icon(standardIcon); QList<QSize> availableSizes = icon.availableSizes(); QCOMPARE(availableSizes.size(), 1); - QCOMPARE(availableSizes.at(0), QSize(16, 16)); + QCOMPARE(availableSizes.at(0), QSize(defaultDimension, defaultDimension)); } { // load an icon from binary data. QPixmap pix; - QFile file(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")); + QFile file(standardIcon); QVERIFY(file.open(QIODevice::ReadOnly)); uchar *data = file.map(0, file.size()); QVERIFY(data != 0); @@ -557,7 +572,7 @@ void tst_QIcon::availableSizes() QList<QSize> availableSizes = icon.availableSizes(); QCOMPARE(availableSizes.size(), 1); - QCOMPARE(availableSizes.at(0), QSize(16,16)); + QCOMPARE(availableSizes.at(0), QSize(defaultDimension, defaultDimension)); } { @@ -719,18 +734,29 @@ void tst_QIcon::fromTheme() void tst_QIcon::task223279_inconsistentAddFile() { +#ifndef Q_OS_SYMBIAN + const int defaultDimension = 16; + const int invalidIconDimension = 32; + QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"); +#else + // Only 32 times 32 icons are included in Symbian + const int defaultDimension = 32; + const int invalidIconDimension = 64; + QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png"); +#endif + QIcon icon1; - icon1.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")); - icon1.addFile(QLatin1String("IconThatDoesntExist"), QSize(32, 32)); - QPixmap pm1 = icon1.pixmap(32, 32); + icon1.addFile(standardIcon); + icon1.addFile(QLatin1String("IconThatDoesntExist"), QSize(invalidIconDimension, invalidIconDimension)); + QPixmap pm1 = icon1.pixmap(invalidIconDimension, invalidIconDimension); QIcon icon2; - icon2.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")); + icon2.addFile(standardIcon); icon2.addFile(QLatin1String("IconThatDoesntExist")); - QPixmap pm2 = icon1.pixmap(32, 32); + QPixmap pm2 = icon1.pixmap(invalidIconDimension, invalidIconDimension); QCOMPARE(pm1.isNull(), false); - QCOMPARE(pm1.size(), QSize(16,16)); + QCOMPARE(pm1.size(), QSize(defaultDimension, defaultDimension)); QCOMPARE(pm1.isNull(), pm2.isNull()); QCOMPARE(pm1.size(), pm2.size()); } diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp index c752362..f782bf8 100644 --- a/tests/auto/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp @@ -661,7 +661,7 @@ void tst_QMdiArea::changeWindowTitle() #else widget->setWindowState(Qt::WindowMaximized); #endif -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); #endif @@ -671,7 +671,7 @@ void tst_QMdiArea::changeWindowTitle() qApp->processEvents(); QTest::qWaitForWindowShown(mw); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); #endif @@ -689,7 +689,7 @@ void tst_QMdiArea::changeWindowTitle() widget->setWindowState(Qt::WindowMaximized); #endif qApp->processEvents(); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); widget->setWindowTitle( wc2 ); QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc2) ); @@ -707,7 +707,7 @@ void tst_QMdiArea::changeWindowTitle() #endif qApp->processEvents(); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc2).arg(wc2) ); #endif #ifdef USE_SHOW @@ -716,7 +716,7 @@ void tst_QMdiArea::changeWindowTitle() widget->setWindowState(Qt::WindowNoState); #endif qApp->processEvents(); -#if defined(Q_WS_MAC) || defined(Q_OS_WINCE) +#if defined(Q_WS_MAC) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) QCOMPARE(mw->windowTitle(), mwc); #else QCOMPARE( mw->windowTitle(), mwc2 ); @@ -728,7 +728,7 @@ void tst_QMdiArea::changeWindowTitle() widget->setWindowState(Qt::WindowMaximized); #endif qApp->processEvents(); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc2).arg(wc2) ); #endif @@ -777,7 +777,7 @@ void tst_QMdiArea::changeModified() QCOMPARE( mw->isWindowModified(), false); QCOMPARE( widget->isWindowModified(), true); widget->setWindowState(Qt::WindowMaximized); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QCOMPARE( mw->isWindowModified(), true); #endif QCOMPARE( widget->isWindowModified(), true); @@ -787,7 +787,7 @@ void tst_QMdiArea::changeModified() QCOMPARE( widget->isWindowModified(), true); widget->setWindowState(Qt::WindowMaximized); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QCOMPARE( mw->isWindowModified(), true); #endif QCOMPARE( widget->isWindowModified(), true); @@ -797,7 +797,7 @@ void tst_QMdiArea::changeModified() QCOMPARE( widget->isWindowModified(), false); widget->setWindowModified(true); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QCOMPARE( mw->isWindowModified(), true); #endif QCOMPARE( widget->isWindowModified(), true); @@ -2046,7 +2046,7 @@ void tst_QMdiArea::delayedPlacement() void tst_QMdiArea::iconGeometryInMenuBar() { -#if !defined (Q_WS_MAC) && !defined(Q_OS_WINCE) +#if !defined (Q_WS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QMainWindow mainWindow; QMenuBar *menuBar = mainWindow.menuBar(); QMdiArea *mdiArea = new QMdiArea; 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/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/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/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index b902370..facb982 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -2384,6 +2384,14 @@ void tst_QTreeView::extendedSelection() QTreeView view(&topLevel); view.resize(qMax(mousePressPos.x() * 2, 200), qMax(mousePressPos.y() * 2, 200)); view.setModel(&model); + + //ensure that mousePressPos is below the last row if we want to unselect + if (!selectedCount) { + int minimumHeight = model.rowCount() * view.visualRect(model.index(0,0)).size().height(); + if (mousePressPos.y() < minimumHeight) + mousePressPos.setY(minimumHeight + 10); + } + view.setSelectionMode(QAbstractItemView::ExtendedSelection); topLevel.show(); QTest::mousePress(view.viewport(), Qt::LeftButton, 0, mousePressPos); diff --git a/tests/auto/xmlpatternsschemats/TESTSUITE/updateSuite.sh b/tests/auto/xmlpatternsschemats/TESTSUITE/updateSuite.sh index a61f0a1..894fa5a 100755 --- a/tests/auto/xmlpatternsschemats/TESTSUITE/updateSuite.sh +++ b/tests/auto/xmlpatternsschemats/TESTSUITE/updateSuite.sh @@ -47,6 +47,8 @@ # # To run the script, Saxon package version 9 and above shall be installed # +# Installation instruction +# http://johnbokma.com/mexit/2011/07/04/installing-saxon-he-ubuntu.html DIRECTORY_NAME="xmlschema2006-11-06" ARCHIVE_NAME="xsts-2007-06-20.tar.gz" @@ -62,5 +64,6 @@ rm $ARCHIVE_NAME #CVSROOT=:pserver:anonymous@dev.w3.org:/sources/public cvs checkout -d xmlschema2006-11-06-new XML/xml-schema-test-suite/2004-01-14/xmlschema2006-11-06 #Saxon need to be installed before the following command works. -java -jar /usr/share/java/saxon.jar -xsl:unifyCatalog.xsl -s:$DIRECTORY_NAME/suite.xml > testSuites.xml +#java -jar /usr/share/java/saxonb.jar -xsl:unifyCatalog.xsl -s:$DIRECTORY_NAME/suite.xml > testSuites.xml +saxon9he-xslt -xsl:unifyCatalog.xsl -s:$DIRECTORY_NAME/suite.xml > testSuites.xml |