From 8a0914b749bbe7da7768e07a7db5c6d4bb09472b Mon Sep 17 00:00:00 2001 From: Steve Block Date: Mon, 15 Feb 2010 12:23:52 +0000 Subject: Merge webkit.org at r54731 : Initial merge by git Change-Id: Ia79977b6cf3b0b00c06ef39419989b28e57e4f4a --- .../qt/tests/qscriptengine/tst_qscriptengine.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp') diff --git a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp index 37f3d11..b36e364 100644 --- a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp +++ b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp @@ -35,6 +35,8 @@ public slots: private slots: void evaluate(); void collectGarbage(); + void nullValue(); + void undefinedValue(); }; /* Evaluating a script that throw an unhandled exception should return an invalid value. */ @@ -54,5 +56,22 @@ void tst_QScriptEngine::collectGarbage() engine.collectGarbage(); QCOMPARE(foo.call().toString(), QString::fromAscii("pong")); } + +void tst_QScriptEngine::nullValue() +{ + QScriptEngine engine; + QScriptValue value = engine.nullValue(); + QVERIFY(value.isValid()); + QVERIFY(value.isNull()); +} + +void tst_QScriptEngine::undefinedValue() +{ + QScriptEngine engine; + QScriptValue value = engine.undefinedValue(); + QVERIFY(value.isValid()); + QVERIFY(value.isUndefined()); +} + QTEST_MAIN(tst_QScriptEngine) #include "tst_qscriptengine.moc" -- cgit v1.1