diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-14 12:33:33 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-14 14:44:25 (GMT) |
commit | eaeaad09383871d40002d9e1ded1d56390839e4b (patch) | |
tree | 57954ae472a87b539b86439fccd6f680206c768d /tests | |
parent | e21e9b5a400115291c883b9b85055a8355f3a30b (diff) | |
download | Qt-eaeaad09383871d40002d9e1ded1d56390839e4b.zip Qt-eaeaad09383871d40002d9e1ded1d56390839e4b.tar.gz Qt-eaeaad09383871d40002d9e1ded1d56390839e4b.tar.bz2 |
Polish the QScriptContext::backtrace()
- in QScriptContextInfo, get the filename of specials context
- in QScriptContextInfo, get the right information for the global
context (from the skipped fake frame)
- addapt the test to the current backtrace layout.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 7 | ||||
-rw-r--r-- | tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index 36c680d..dfa0b8b 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -557,9 +557,9 @@ void tst_QScriptContext::backtrace() QString fileName = "testfile"; QStringList expected; - expected << "<native>(123)@:-1" - << "foo(hello,[object Object])@testfile:2" - << "<global>()@testfile:4"; + expected << "<native> (123) at -1" + << "foo ([object Object], [object global]) at testfile:2" + << "<global> () at testfile:4"; QScriptValue ret = eng.evaluate( "function foo() {\n" @@ -569,7 +569,6 @@ void tst_QScriptContext::backtrace() QVERIFY(ret.isArray()); QStringList slist = qscriptvalue_cast<QStringList>(ret); - QEXPECT_FAIL("", "Backtrace is not correct", Continue); QCOMPARE(slist, expected); } diff --git a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp index 7ca6728..91cd2cb 100644 --- a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp +++ b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp @@ -149,10 +149,10 @@ void tst_QScriptContextInfo::nativeFunction() QScriptContextInfo info = lst.at(1); QVERIFY(!info.isNull()); QCOMPARE(info.functionType(), QScriptContextInfo::NativeFunction); - QEXPECT_FAIL("", "Script ID isn't valid for evaluate() call", Abort); QVERIFY(info.scriptId() != -1); QCOMPARE(info.fileName(), fileName); QCOMPARE(info.lineNumber(), lineNumber); + QEXPECT_FAIL("", "columnNumber doesn't work", Continue); QCOMPARE(info.columnNumber(), 1); QCOMPARE(info.functionName(), QString()); QCOMPARE(info.functionEndLineNumber(), -1); @@ -200,10 +200,10 @@ void tst_QScriptContextInfo::scriptFunction() // evaluate() QScriptContextInfo info = lst.at(2); QCOMPARE(info.functionType(), QScriptContextInfo::NativeFunction); - QEXPECT_FAIL("", "Script ID is invalid for evaluate() call", Abort); QVERIFY(info.scriptId() != -1); QCOMPARE(info.fileName(), fileName); QCOMPARE(info.lineNumber(), lineNumber + 3); + QEXPECT_FAIL("", "columnNumber doesn't work", Continue); QCOMPARE(info.columnNumber(), 1); QCOMPARE(info.functionName(), QString()); QCOMPARE(info.functionEndLineNumber(), -1); |