diff options
Diffstat (limited to 'tests/auto/qml/qqmlengine/tst_qqmlengine.cpp')
| -rw-r--r-- | tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index 00d28cfe60..b82a1f4174 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -1337,6 +1337,8 @@ void tst_qqmlengine::createComponentOnSingletonDestruction() void tst_qqmlengine::uiLanguage() { + const QRegularExpression bindingLoopWarningRegex(".*QML QtObject: Binding loop detected for property \"textToTranslate\".*"); + { QQmlEngine engine; @@ -1348,19 +1350,19 @@ void tst_qqmlengine::uiLanguage() QQmlComponent component(&engine, testFileUrl("uiLanguage.qml")); - QTest::ignoreMessage(QtMsgType::QtWarningMsg, (component.url().toString() + ":2:1: QML QtObject: Binding loop detected for property \"textToTranslate\"").toLatin1()); + QTest::ignoreMessage(QtMsgType::QtWarningMsg, bindingLoopWarningRegex); QScopedPointer<QObject> object(component.create()); QVERIFY(!object.isNull()); QVERIFY(engine.uiLanguage().isEmpty()); QCOMPARE(object->property("numberOfTranslationBindingEvaluations").toInt(), 1); - QTest::ignoreMessage(QtMsgType::QtWarningMsg, (component.url().toString() + ":2:1: QML QtObject: Binding loop detected for property \"textToTranslate\"").toLatin1()); + QTest::ignoreMessage(QtMsgType::QtWarningMsg, bindingLoopWarningRegex); engine.setUiLanguage("TestLanguage"); QCOMPARE(object->property("numberOfTranslationBindingEvaluations").toInt(), 2); QCOMPARE(object->property("chosenLanguage").toString(), "TestLanguage"); - QTest::ignoreMessage(QtMsgType::QtWarningMsg, (component.url().toString() + ":2:1: QML QtObject: Binding loop detected for property \"textToTranslate\"").toLatin1()); + QTest::ignoreMessage(QtMsgType::QtWarningMsg, bindingLoopWarningRegex); engine.evaluate("Qt.uiLanguage = \"anotherLanguage\""); QCOMPARE(engine.uiLanguage(), QString("anotherLanguage")); QCOMPARE(object->property("numberOfTranslationBindingEvaluations").toInt(), 3); @@ -1371,7 +1373,7 @@ void tst_qqmlengine::uiLanguage() QQmlEngine engine; QQmlComponent component(&engine, testFileUrl("uiLanguage.qml")); - QTest::ignoreMessage(QtMsgType::QtWarningMsg, (component.url().toString() + ":2:1: QML QtObject: Binding loop detected for property \"textToTranslate\"").toLatin1()); + QTest::ignoreMessage(QtMsgType::QtWarningMsg, bindingLoopWarningRegex); QScopedPointer<QObject> object(component.create()); QVERIFY(!object.isNull()); |
