From 44a28b5530d3be2a12c91d084ea02f19aa6a9db3 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 21 Apr 2010 14:39:20 +0200 Subject: Fixed declarative/parserstress autotest. The test ecma_3/Unicode/regress-352044-02-n.js is expected to throw an uncaught syntax error when parsing the expression statement "i \u002b= 1;". Task-number: QTBUG-8108 --- .../declarative/parserstress/tst_parserstress.cpp | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index f1e9c6e..294f2f7 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -130,16 +130,24 @@ void tst_parserstress::ecmascript() QDeclarativeComponent component(&engine); component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml"))); - QSet failingTests; - failingTests << "regress-352044-02-n.js"; + QFileInfo info(file); - foreach (const QString &failing, failingTests) { - if (info.fileName().endsWith(failing)) { - QEXPECT_FAIL("", "QTBUG-8108", Continue); - break; - } + + if (info.fileName() == QLatin1String("regress-352044-02-n.js")) { + QVERIFY(component.isError()); + + QCOMPARE(component.errors().length(), 2); + + QCOMPARE(component.errors().at(0).description(), QString("Expected token `;'")); + QCOMPARE(component.errors().at(0).line(), 66); + + QCOMPARE(component.errors().at(1).description(), QString("Expected token `;'")); + QCOMPARE(component.errors().at(1).line(), 142); + + } else { + + QVERIFY(!component.isError()); } - QVERIFY(!component.isError()); } -- cgit v0.12