summaryrefslogtreecommitdiff
path: root/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp')
-rw-r--r--tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
index c720f00aa0..b02d3ab00e 100644
--- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
+++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
@@ -95,9 +95,11 @@ protected:
static QScriptValue qscript_fail(QScriptContext *ctx, QScriptEngine *eng)
{
QScriptValue realFail = ctx->callee().data();
- Q_ASSERT(realFail.isFunction());
+ if (!realFail.isFunction())
+ qFatal("%s: realFail must be a function", Q_FUNC_INFO);
QScriptValue ret = realFail.call(ctx->thisObject(), ctx->argumentsObject());
- Q_ASSERT(eng->hasUncaughtException());
+ if (!eng->hasUncaughtException())
+ qFatal("%s: realFail function did not throw an exception", Q_FUNC_INFO);
ret.setProperty("expected", ctx->argument(0));
ret.setProperty("actual", ctx->argument(1));
ret.setProperty("message", ctx->argument(2));
@@ -153,10 +155,14 @@ void tst_QScriptV8TestSuite::runTestFunction(int testIndex)
QScriptValue ret = engine.evaluate(contents);
if (engine.hasUncaughtException()) {
if (!ret.isError()) {
- Q_ASSERT(ret.instanceOf(engine.globalObject().property("MjsUnitAssertionError")));
+ int lineNumber = ret.property("lineNumber").toInt32();
+ QTest::qVerify(ret.instanceOf(engine.globalObject().property("MjsUnitAssertionError")),
+ ret.toString().toLatin1(),
+ "",
+ path.toLatin1(),
+ lineNumber);
QString actual = ret.property("actual").toString();
QString expected = ret.property("expected").toString();
- int lineNumber = ret.property("lineNumber").toInt32();
QString failMessage;
if (shouldGenerateExpectedFailures) {
if (ret.property("message").isString())