summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-09 04:52:46 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-09 08:39:41 (GMT)
commit3b7f3757efb038fe523a00d474d1b92920f9abe8 (patch)
tree418ac08323458c227a96429d430e18d39167824a
parent00f724c943b83f10f9ca9475570708536947538e (diff)
downloadQt-3b7f3757efb038fe523a00d474d1b92920f9abe8.zip
Qt-3b7f3757efb038fe523a00d474d1b92920f9abe8.tar.gz
Qt-3b7f3757efb038fe523a00d474d1b92920f9abe8.tar.bz2
Remove Q_ASSERT from qscriptengine autotest
Rather than aborting in debug builds and failing silently in release builds, output a meaningful warning message and return a null QScriptValue which will cause the "isQObject" check in the testfunction to fail. Change-Id: I69fd9c15a69924d0abfde6710ea6ae4bf7e013fa Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index bc4091d..1a9db8f 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -5701,7 +5701,10 @@ void tst_QScriptEngine::collectGarbageAfterNativeArguments()
static QScriptValue constructQObjectFromThisObject(QScriptContext *ctx, QScriptEngine *eng)
{
- Q_ASSERT(ctx->isCalledAsConstructor());
+ if (!ctx->isCalledAsConstructor()) {
+ qWarning("%s: ctx->isCalledAsConstructor() returned false", Q_FUNC_INFO);
+ return QScriptValue();
+ }
return eng->newQObject(ctx->thisObject(), new QObject, QScriptEngine::ScriptOwnership);
}