summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptcontext
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-08-14 14:43:09 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-08-14 14:44:26 (GMT)
commitd7b24639a40706f75071640eefa11adf5902e0ed (patch)
treedf212377dc2dd9614355eb9b1abbdea2b70d083b /tests/auto/qscriptcontext
parentb1574e4845d657673e178b892ba57e398984e0b3 (diff)
downloadQt-d7b24639a40706f75071640eefa11adf5902e0ed.zip
Qt-d7b24639a40706f75071640eefa11adf5902e0ed.tar.gz
Qt-d7b24639a40706f75071640eefa11adf5902e0ed.tar.bz2
More polishing on the backtrace
change the coding style of function from foo (arg=text) to foo(arg = 'text')
Diffstat (limited to 'tests/auto/qscriptcontext')
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index 43938b6..c72594c 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -563,9 +563,9 @@ void tst_QScriptContext::backtrace_data()
{
QStringList expected;
- expected << "<native> (123) at -1"
- << "foo ([object Object], [object global]) at testfile:2" //### object instead of 'hello'
- << "<global> () at testfile:4";
+ expected << "<native>(123) at -1"
+ << "foo([object Object], [object global]) at testfile:2" //### object instead of 'hello'
+ << "<global>() at testfile:4";
QString source(
"function foo() {\n"
@@ -585,10 +585,10 @@ void tst_QScriptContext::backtrace_data()
"foo('hello', 456)"
).arg("\\n \\n bt('hey'); \\n");
- expected << "<native> (hey) at -1"
- << "<native> () at 3" //### <native> should be <eval>
- << "foo (arg1=hello, arg2=456) at testfile:-1" //### line number should be 2
- << "<global> () at testfile:4";
+ expected << "<native>('hey') at -1"
+ << "<native>() at 3" //### <native> should be <eval>
+ << "foo(arg1 = 'hello', arg2 = 456) at testfile:-1" //### line number should be 2
+ << "<global>() at testfile:4";
QTest::newRow("eval") << source << expected;
}
@@ -607,12 +607,12 @@ void tst_QScriptContext::backtrace_data()
).arg(eval_code);
QStringList expected;
- expected << "<native> (m) at -1"
- << "bar (a=b) at eval.js:2"
- << "<native> () at eval.js:4" //### should be <eval>
- << QString("<native> (%1, eval.js) at -1").arg(eval_code.replace("\\n", "\n"))
- << "foo () at testfile:2"
- << "<global> () at testfile:4";
+ expected << "<native>('m') at -1"
+ << "bar(a = 'b') at eval.js:2"
+ << "<native>() at eval.js:4" //### should be <eval>
+ << QString("<native>('%1', 'eval.js') at -1").arg(eval_code.replace("\\n", "\n"))
+ << "foo() at testfile:2"
+ << "<global>() at testfile:4";
QTest::newRow("custom_eval") << source << expected;
}
@@ -626,10 +626,10 @@ void tst_QScriptContext::backtrace_data()
).arg(f);
QStringList expected;
- expected << "<native> (b) at -1"
- << "<anonymous> (a=b) at testfile:5"
- << QString("foo (f=%1) at testfile:2").arg(f)
- << "<global> () at testfile:6";
+ expected << "<native>('b') at -1"
+ << "<anonymous>(a = 'b') at testfile:5"
+ << QString("foo(f = %1) at testfile:2").arg(f)
+ << "<global>() at testfile:6";
QTest::newRow("closure") << source << expected;
}
@@ -870,7 +870,7 @@ void tst_QScriptContext::toString()
" return parentContextToString();\n"
"}; foo(1, 2, 3)", "script.qs");
QVERIFY(ret.isString());
- QCOMPARE(ret.toString(), QString::fromLatin1("foo (first=1, second=2, third=3) at script.qs:2"));
+ QCOMPARE(ret.toString(), QString::fromLatin1("foo(first = 1, second = 2, third = 3) at script.qs:2"));
}
static QScriptValue storeCalledAsConstructor(QScriptContext *ctx, QScriptEngine *eng)