diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-03 02:43:15 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-04 04:17:32 (GMT) |
commit | 8b95b4b5c09bf31f813fe39a3eec611c9daddb98 (patch) | |
tree | a889c8bbf81942fa0155e89ab1051149f7f792ea /tests/auto | |
parent | 7bd6ca895e5fa4de197d9d7bf2e7b578c01c3c2a (diff) | |
download | Qt-8b95b4b5c09bf31f813fe39a3eec611c9daddb98.zip Qt-8b95b4b5c09bf31f813fe39a3eec611c9daddb98.tar.gz Qt-8b95b4b5c09bf31f813fe39a3eec611c9daddb98.tar.bz2 |
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
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qscriptclass/tst_qscriptclass.cpp | 6 |
1 files 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<QScriptContext*>(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<QScriptValueList>(argument); QScriptValue obj = args.at(0); QScriptValue value = args.at(1); |