diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-11 05:08:52 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-11 05:08:52 (GMT) |
commit | 25eddc815fe87d04616edd9cc1d37253b1d43246 (patch) | |
tree | 91085e056c9e8a01eef10c46e7410a7aa304c0eb /tests/auto/declarative | |
parent | abfb755d7a8ff7f94d4dc59d37ac9934702254bd (diff) | |
parent | 7287f1f01e7000a21f52f463a459fa0285db4cca (diff) | |
download | Qt-25eddc815fe87d04616edd9cc1d37253b1d43246.zip Qt-25eddc815fe87d04616edd9cc1d37253b1d43246.tar.gz Qt-25eddc815fe87d04616edd9cc1d37253b1d43246.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative')
7 files changed, 27 insertions, 8 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml b/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml index 44722a9..acc3163 100644 --- a/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml +++ b/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml @@ -3,6 +3,6 @@ import Qt.test 1.0 MyQmlObject { Component.onCompleted: - { throw(123,"JS exception") } + { throw(new Error("JS exception")) } } diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 6f7832a..a153296 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -106,7 +106,8 @@ private slots: void signalTriggeredBindings(); void listProperties(); void exceptionClearsOnReeval(); - void exceptionProducesWarning(); + void exceptionSlotProducesWarning(); + void exceptionBindingProducesWarning(); void transientErrors(); void shutdownErrors(); void externalScript(); @@ -933,12 +934,24 @@ void tst_qmlecmascript::exceptionClearsOnReeval() QCOMPARE(object->property("test").toBool(), true); } -void tst_qmlecmascript::exceptionProducesWarning() +void tst_qmlecmascript::exceptionSlotProducesWarning() { QmlComponent component(&engine, TEST_FILE("exceptionProducesWarning.qml")); QString url = component.url().toString(); - QString warning = "Expected error - QTBUG-6507"; + QString warning = component.url().toString() + ":6: Error: JS exception"; + + QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); + MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create()); + QVERIFY(object != 0); +} + +void tst_qmlecmascript::exceptionBindingProducesWarning() +{ + QmlComponent component(&engine, TEST_FILE("exceptionProducesWarning2.qml")); + QString url = component.url().toString(); + + QString warning = component.url().toString() + ":5: Error: JS exception"; QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create()); diff --git a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp index 96df0a5..66ecff6 100644 --- a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp +++ b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp @@ -173,6 +173,7 @@ void tst_qmlgraphicstextedit::text() actual.replace(QRegExp(".*<body[^>]*>"),""); actual.replace(QRegExp("(<[^>]*>)+"),"<>"); expected.replace(QRegExp("(<[^>]*>)+"),"<>"); + expected = "<> <> <> " + expected; QCOMPARE(actual.simplified(),expected.simplified()); } } diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index 543ba3f..c244030 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -90,8 +90,8 @@ static QString strippedHtml(QString html) static QString fileContents(const QString& filename) { QFile file(filename); - Q_ASSERT(file.open(QIODevice::ReadOnly)); - return file.readAll(); + file.open(QIODevice::ReadOnly); + return QString::fromUtf8(file.readAll()); } diff --git a/tests/auto/declarative/shared/testhttpserver.cpp b/tests/auto/declarative/shared/testhttpserver.cpp index c7b7f25..215f3c3 100644 --- a/tests/auto/declarative/shared/testhttpserver.cpp +++ b/tests/auto/declarative/shared/testhttpserver.cpp @@ -206,7 +206,7 @@ void TestHTTPServer::readyRead() continue; else { QByteArray data = ba.mid(ii); - qWarning() << "TestHTTPServer: Unexpected data" << data; + qWarning() << "TestHTTPServer: Unexpected data" << data << "\nExpected: " << waitData; m_hasFailed = true; socket->disconnect(); return; diff --git a/tests/auto/declarative/sql/data/readonly-error.js b/tests/auto/declarative/sql/data/readonly-error.js index ab82712..69ec67f 100644 --- a/tests/auto/declarative/sql/data/readonly-error.js +++ b/tests/auto/declarative/sql/data/readonly-error.js @@ -6,7 +6,6 @@ function test() { function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)'); tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); - r = "passed"; } ); diff --git a/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp b/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp index e74d1c5..dc48195 100644 --- a/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp +++ b/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp @@ -57,6 +57,12 @@ public: tst_xmlhttprequest() {} private slots: + void initTestCase() { + if (QLocale::system().name().replace(QChar::fromAscii('_'),QChar::fromAscii('-')) != QLatin1String("en-US")) { + qWarning() << "Test will fail unless LANG is en_US"; + } + } + void domExceptionCodes(); void staticStateValues(); void instanceStateValues(); |