diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-28 12:48:42 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-28 12:55:26 (GMT) |
commit | 90a8b91b518f7fb1e9bed2700826ad172e362c31 (patch) | |
tree | c48a03a27c15ed1852822a5863275a9251f8717f /tests/auto/qscriptengine | |
parent | 8b2af7274e5dae4ae24752489815e4fd51e2f0ec (diff) | |
download | Qt-90a8b91b518f7fb1e9bed2700826ad172e362c31.zip Qt-90a8b91b518f7fb1e9bed2700826ad172e362c31.tar.gz Qt-90a8b91b518f7fb1e9bed2700826ad172e362c31.tar.bz2 |
document test
JavaScriptCore doesn't assign lineNumber when errors are not thrown
Diffstat (limited to 'tests/auto/qscriptengine')
-rw-r--r-- | tests/auto/qscriptengine/tst_qscriptengine.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 4886d7a..9959990 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -2704,18 +2704,22 @@ void tst_QScriptEngine::errorConstructors() QScriptEngine eng; QStringList prefixes; prefixes << "" << "Eval" << "Range" << "Reference" << "Syntax" << "Type" << "URI"; - for (int x = 0; x < 2; ++x) { + for (int x = 0; x < 3; ++x) { for (int i = 0; i < prefixes.size(); ++i) { QString name = prefixes.at(i) + QLatin1String("Error"); QString code = QString(i+1, QLatin1Char('\n')); if (x == 0) + code += QLatin1String("throw "); + else if (x == 1) code += QLatin1String("new "); code += name + QLatin1String("()"); QScriptValue ret = eng.evaluate(code); QVERIFY(ret.isError()); - QVERIFY(!eng.hasUncaughtException()); + QCOMPARE(eng.hasUncaughtException(), x == 0); + eng.clearExceptions(); QVERIFY(ret.toString().startsWith(name)); - QEXPECT_FAIL("", "in JSC, line number property is called 'line'", Continue); + if (x != 0) + QEXPECT_FAIL("", "JSC doesn't assign lineNumber when errors are not thrown", Continue); QCOMPARE(ret.property("lineNumber").toInt32(), i+2); } } |