diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-01-27 10:35:32 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-01-27 10:41:55 (GMT) |
commit | 44e3b8862cb0927637d841d276850fbac1681745 (patch) | |
tree | 7563e3a12378e65bdf12dc35304ded7e075df50f /tests/auto/qscriptvalue | |
parent | 634eac05a6475280f2a1cc6e41e23c0c35628247 (diff) | |
download | Qt-44e3b8862cb0927637d841d276850fbac1681745.zip Qt-44e3b8862cb0927637d841d276850fbac1681745.tar.gz Qt-44e3b8862cb0927637d841d276850fbac1681745.tar.bz2 |
Don't crash when comparing JSCore value without engine to non-JSCore value
Task-number: None, discovering while doing test refactoring
Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'tests/auto/qscriptvalue')
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index b384a55..2aeabf0 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -3091,6 +3091,20 @@ void tst_QScriptValue::strictlyEquals() QVERIFY(!falskt.strictlyEquals(null)); QVERIFY(!falskt.strictlyEquals(QScriptValue())); + QVERIFY(!QScriptValue(false).strictlyEquals(123)); + QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).strictlyEquals(123)); + QVERIFY(!QScriptValue(QScriptValue::NullValue).strictlyEquals(123)); + QVERIFY(!QScriptValue(false).strictlyEquals("ciao")); + QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).strictlyEquals("ciao")); + QVERIFY(!QScriptValue(QScriptValue::NullValue).strictlyEquals("ciao")); + QVERIFY(QScriptValue(&eng, "ciao").strictlyEquals("ciao")); + QVERIFY(QScriptValue("ciao").strictlyEquals(QScriptValue(&eng, "ciao"))); + QVERIFY(!QScriptValue("ciao").strictlyEquals(123)); + QVERIFY(!QScriptValue("ciao").strictlyEquals(QScriptValue(&eng, 123))); + QVERIFY(!QScriptValue(123).strictlyEquals("ciao")); + QVERIFY(!QScriptValue(123).strictlyEquals(QScriptValue(&eng, "ciao"))); + QVERIFY(!QScriptValue(&eng, 123).strictlyEquals("ciao")); + QScriptValue obj1 = eng.newObject(); QScriptValue obj2 = eng.newObject(); QCOMPARE(obj1.strictlyEquals(obj2), false); |