summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-08-28 13:51:22 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-08-28 13:51:22 (GMT)
commit31a0ef1d1dd55096652c1c4f0501fce2937a1b23 (patch)
treef728a2e5829e26ed75bfd465d07b336fc77e599f /tests/auto/qscriptcontext/tst_qscriptcontext.cpp
parent7c2620578ba0698a14c1d4ff5c7a4e260f06ad31 (diff)
parentbd3cd571ac061b0ed0e8c001c90c4edeafae67d7 (diff)
downloadQt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.zip
Qt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.tar.gz
Qt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'tests/auto/qscriptcontext/tst_qscriptcontext.cpp')
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index ef609e0..a09d314 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -50,6 +50,10 @@
Q_DECLARE_METATYPE(QScriptValueList)
+QT_BEGIN_NAMESPACE
+extern bool qt_script_isJITEnabled();
+QT_END_NAMESPACE
+
class tst_QScriptContext : public QObject
{
Q_OBJECT
@@ -598,8 +602,10 @@ void tst_QScriptContext::backtrace_data()
expected << "<native>('hey') at -1"
<< "<eval>() at 3"
- //### line number should be 2 but the line number information is not kept for eval call
- << "foo(arg1 = 'hello', arg2 = 456) at testfile:-1"
+ << QString::fromLatin1("foo(arg1 = 'hello', arg2 = 456) at testfile:%0")
+ // interpreter unfortunately doesn't provide line number for eval()
+ .arg(qt_script_isJITEnabled() ? 2 : -1);
+ expected
<< "<global>() at testfile:4";
QTest::newRow("eval") << source << expected;
@@ -658,8 +664,10 @@ void tst_QScriptContext::backtrace_data()
expected << "<native>('hey') at -1"
<< "<eval>() at 3"
- //### line number should be 3 but the line number information is not kept for eval call
- << "plop('hello', 456) at testfile:-1"
+ << QString::fromLatin1("plop('hello', 456) at testfile:%0")
+ // interpreter unfortunately doesn't provide line number for eval()
+ .arg(qt_script_isJITEnabled() ? 3 : -1);
+ expected
<< "<global>() at testfile:5";
QTest::newRow("eval in member") << source << expected;
@@ -1003,6 +1011,8 @@ void tst_QScriptContext::calledAsConstructor()
eng.evaluate("test();");
QVERIFY(!fun3.property("calledAsConstructor").toBool());
eng.evaluate("new test();");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "calledAsConstructor is not correctly set for JS functions when JIT is enabled", Continue);
QVERIFY(fun3.property("calledAsConstructor").toBool());
}