summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-08-04 11:14:08 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-08-04 13:35:05 (GMT)
commit109b4d19e2c677c3eafaf6b4a9df605cb3aeb481 (patch)
treee3d31d7417058b23eeaecd2e8e3b5533264415cd /tests
parente2852e547216562751a5d05ebdfbd001113cc9b6 (diff)
downloadQt-109b4d19e2c677c3eafaf6b4a9df605cb3aeb481.zip
Qt-109b4d19e2c677c3eafaf6b4a9df605cb3aeb481.tar.gz
Qt-109b4d19e2c677c3eafaf6b4a9df605cb3aeb481.tar.bz2
Do not crash if using popContext() while the current context have not been pushed
Reviewed-by: Kent Hansen
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp8
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp4
2 files changed, 4 insertions, 8 deletions
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index 7a363ac..87db0ad 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -487,12 +487,8 @@ void tst_QScriptContext::pushAndPopContext()
QCOMPARE(eng.currentContext(), topLevel);
// popping the top-level context is not allowed
- QEXPECT_FAIL("", "Crashes", Continue);
-#if 1
- QVERIFY(false);
-#else
- eng.popContext()
-#endif
+ QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::popContext() doesn't match with pushContext()");
+ eng.popContext();
QCOMPARE(eng.currentContext(), topLevel);
{
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 0b16980..f7bac56 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -193,9 +193,9 @@ void tst_QScriptEngine::pushPopContext()
eng.popContext();
eng.popContext();
- QEXPECT_FAIL("", "cannot pop more context than it pushes", Abort);
- QVERIFY(false);
+ QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::popContext() doesn't match with pushContext()");
eng.popContext(); // ignored
+ QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::popContext() doesn't match with pushContext()");
eng.popContext(); // ignored
}