aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qjsvalue/tst_qjsvalue.cpp')
-rw-r--r--tests/auto/qml/qjsvalue/tst_qjsvalue.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
index 95f554776f..cab4686c37 100644
--- a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
+++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
@@ -1128,6 +1128,10 @@ void tst_QJSValue::toVariant()
// array
{
+ auto handler = qInstallMessageHandler([](QtMsgType type, const QMessageLogContext &, const QString &) {
+ if (type == QtMsgType::QtWarningMsg)
+ QFAIL("Converting QJSValue to QVariant should not cause error messages");
+ });
QVariantList listIn;
listIn << 123 << "hello";
QJSValue array = eng.toScriptValue(listIn);
@@ -1145,8 +1149,9 @@ void tst_QJSValue::toVariant()
QCOMPARE(array2.property("length").toInt(), array.property("length").toInt());
for (int i = 0; i < array.property("length").toInt(); ++i)
QVERIFY(array2.property(i).strictlyEquals(array.property(i)));
- }
+ qInstallMessageHandler(handler);
+ }
}
void tst_QJSValue::toQObject_nonQObject_data()