diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-02 09:43:17 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-02 09:34:41 +0000 |
commit | bbb2c95d7ad329a05a8f74d80ac69b3ca5851db1 (patch) | |
tree | 2f598e268e63a4820031c31219fe94a1e6e6b991 /tests | |
parent | 0addf25bd7417acca1d3d9df145ff36c5683b0a0 (diff) |
tst_qdesktopservices: Use regular expression to suppress error message.
The error return has been observed to vary.
Task-number: QTBUG-48566
Change-Id: Iecfe7819898a6a8a482c1b2251543193ecfa4841
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp index c8964eb02c..db4b15530c 100644 --- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp +++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp @@ -35,6 +35,7 @@ #include <QtTest/QtTest> #include <qdebug.h> #include <qdesktopservices.h> +#include <qregularexpression.h> class tst_qdesktopservices : public QObject { @@ -74,7 +75,9 @@ void tst_qdesktopservices::openUrl() QCOMPARE(QDesktopServices::openUrl(QUrl()), false); #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) // this test is only valid on windows on other systems it might mean open a new document in the application handling .file - QTest::ignoreMessage(QtWarningMsg, "ShellExecute 'file://invalid.file' failed (error 3)."); + const QRegularExpression messagePattern("ShellExecute 'file://invalid\\.file' failed \\(error \\d+\\)\\."); + QVERIFY(messagePattern.isValid()); + QTest::ignoreMessage(QtWarningMsg, messagePattern); QCOMPARE(QDesktopServices::openUrl(QUrl("file://invalid.file")), false); #endif } |