diff --git a/tests/qttest/tst_unreadableelement.cpp b/tests/qttest/tst_unreadableelement.cpp index 906b8da58..607ac210b 100644 --- a/tests/qttest/tst_unreadableelement.cpp +++ b/tests/qttest/tst_unreadableelement.cpp @@ -89,7 +89,11 @@ private slots: .contains(QStringLiteral("RESULT placed"))); QVERIFY(QFile::exists(embedded)); - QVERIFY(QFile::setPermissions(m_symbol, QFileDevice::Permissions())); + // Qt cannot take read permission away on Windows: it only knows the + // read-only flag there, so this returns false. The check needs a + // file the user cannot read, which this system cannot give it. + if (!QFile::setPermissions(m_symbol, QFileDevice::Permissions())) + QSKIP("this system cannot make the file unreadable (Windows?)"); QFile probe(m_symbol); if (probe.open(QIODevice::ReadOnly)) QSKIP("permissions do not stop this user reading the file (root?)");