Skip tst_unreadableelement on Windows only

The skip applied wherever setPermissions() failed, which on Linux and
macOS would hide a real failure. Only Windows cannot take read
permission away; elsewhere the call must succeed as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Beat Hangartner
2026-10-07 01:51:00 +02:00
parent 210a26b29e
commit 1fdb0ee32e
+5 -3
View File
@@ -89,11 +89,13 @@ private slots:
.contains(QStringLiteral("RESULT placed")));
QVERIFY(QFile::exists(embedded));
#ifdef Q_OS_WIN
// 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?)");
// file the user cannot read, which Windows cannot give it.
QSKIP("Windows cannot make the file unreadable through QFile");
#endif
QVERIFY(QFile::setPermissions(m_symbol, QFileDevice::Permissions()));
QFile probe(m_symbol);
if (probe.open(QIODevice::ReadOnly))
QSKIP("permissions do not stop this user reading the file (root?)");