From 8b95b4b5c09bf31f813fe39a3eec611c9daddb98 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 3 May 2011 12:43:15 +1000 Subject: Remove Q_ASSERT's from qscriptclass autotest Allow the extension() function to return a null QVariant, which will cause the test to fail gracefully. Change-Id: Ide9ef69c48f4bdd5a000f525fe9f395c27854da9 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern --- tests/auto/qscriptclass/tst_qscriptclass.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/auto/qscriptclass/tst_qscriptclass.cpp b/tests/auto/qscriptclass/tst_qscriptclass.cpp index 9ab8318..4d27672 100644 --- a/tests/auto/qscriptclass/tst_qscriptclass.cpp +++ b/tests/auto/qscriptclass/tst_qscriptclass.cpp @@ -369,8 +369,7 @@ QVariant TestClass::extension(Extension extension, { m_lastExtensionType = extension; m_lastExtensionArgument = argument; - if (extension == Callable) { - Q_ASSERT(m_callableMode != NotCallable); + if (extension == Callable && m_callableMode != NotCallable) { QScriptContext *ctx = qvariant_cast(argument); if (m_callableMode == CallableReturnsSum) { qsreal sum = 0; @@ -398,8 +397,7 @@ QVariant TestClass::extension(Extension extension, engine()->newQObject(ctx->thisObject(), engine()); return QVariant(); } - } else if (extension == HasInstance) { - Q_ASSERT(m_hasInstance); + } else if (extension == HasInstance && m_hasInstance) { QScriptValueList args = qvariant_cast(argument); QScriptValue obj = args.at(0); QScriptValue value = args.at(1); -- cgit v0.12