diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-06-15 15:34:33 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-06-15 15:35:05 (GMT) |
commit | 9d6069f32962128f737b83a4bf7d7e7309983023 (patch) | |
tree | d5c37af610ffceeb76ad9878a2039112be917193 /tests/auto/qscriptcontextinfo | |
parent | b8231cb61129964dfecaf862b6ef5fecb6753c01 (diff) | |
download | Qt-9d6069f32962128f737b83a4bf7d7e7309983023.zip Qt-9d6069f32962128f737b83a4bf7d7e7309983023.tar.gz Qt-9d6069f32962128f737b83a4bf7d7e7309983023.tar.bz2 |
add a bunch of qtscript autotests
Get that code coverage up.
Diffstat (limited to 'tests/auto/qscriptcontextinfo')
-rw-r--r-- | tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp index df1e14f..82c66f8 100644 --- a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp +++ b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp @@ -95,6 +95,7 @@ private slots: void builtinFunctionNames(); void nullContext(); void streaming(); + void assignmentAndComparison(); }; tst_QScriptContextInfo::tst_QScriptContextInfo() @@ -553,5 +554,24 @@ void tst_QScriptContextInfo::streaming() } } +void tst_QScriptContextInfo::assignmentAndComparison() +{ + QScriptEngine eng; + eng.globalObject().setProperty("getContextInfoList", eng.newFunction(getContextInfoList)); + QString fileName = "ciao.qs"; + int lineNumber = 456; + QScriptValue ret = eng.evaluate("function bar(a, b, c) {\n return getContextInfoList();\n}\nbar()", + fileName, lineNumber); + QList<QScriptContextInfo> lst = qscriptvalue_cast<QList<QScriptContextInfo> >(ret); + QCOMPARE(lst.size(), 3); + QScriptContextInfo ci = lst.at(0); + QScriptContextInfo same = ci; + QVERIFY(ci == same); + QVERIFY(!(ci != same)); + QScriptContextInfo other = lst.at(1); + QVERIFY(!(ci == other)); + QVERIFY(ci != other); +} + QTEST_MAIN(tst_QScriptContextInfo) #include "tst_qscriptcontextinfo.moc" |