diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2020-02-19 17:17:59 +0300 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2020-02-20 10:19:14 +0300 |
commit | 9e5376327fb258e1c0207c2d6b6a2f9254f5b3ee (patch) | |
tree | 09dfed5f5568293c55c6650c6d85faabc4ffa322 | |
parent | 9b5bd48fc652a7dd47c545db8338a580592f7f35 (diff) |
Escape url.toString() before passing it to QRegularExpression
Otherwise the test fails when path contains special characters like ‘+’.
Change-Id: I461d9755436148ce979284be31ef8d204235c8a4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp index 5e855efe1a..2bee283826 100644 --- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp +++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp @@ -302,7 +302,8 @@ void tst_qqmlapplicationengine::failureToLoadTriggersWarningSignal() auto url = testFileUrl("invalid.qml"); qRegisterMetaType<QList<QQmlError>>(); QTest::ignoreMessage(QtMsgType::QtWarningMsg, "QQmlApplicationEngine failed to load component"); - QTest::ignoreMessage(QtMsgType::QtWarningMsg, QRegularExpression(url.toString() + QLatin1Char('*'))); + QTest::ignoreMessage(QtMsgType::QtWarningMsg, + QRegularExpression(QRegularExpression::escape(url.toString()) + QLatin1Char('*'))); QQmlApplicationEngine test; QSignalSpy warningObserver(&test, &QQmlApplicationEngine::warnings); test.load(url); |