From 102493fd341a322a369d21414fdb10aedaf23ff5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 28 Jul 2009 10:23:49 +0200 Subject: Test tst_QScriptContext::lineNumber The test was wrong. The line number should be from within the eval. --- tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index 4699562..524fff2 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -530,12 +530,10 @@ void tst_QScriptContext::lineNumber() QScriptValue result = eng.evaluate("try { eval(\"foo = 123;\\n this[is{a{syntax|error@#$%@#% \"); } catch (e) { e.lineNumber; }", "foo.qs", 123); QVERIFY(!eng.hasUncaughtException()); QVERIFY(result.isNumber()); - QEXPECT_FAIL("", "error line number is wrong", Continue); - QCOMPARE(result.toInt32(), 124); + QCOMPARE(result.toInt32(), 2); result = eng.evaluate("foo = 123;\n bar = 42\n0 = 0"); QVERIFY(eng.hasUncaughtException()); - QEXPECT_FAIL("", "uncaught exception line number is wrong", Continue); QCOMPARE(eng.uncaughtExceptionLineNumber(), 3); QCOMPARE(result.property("lineNumber").toInt32(), 3); } -- cgit v0.12