Description
tst_qstandardpaths::testCustomRuntimeDirectory_data contains test "rows" like
addRow("environment:file", [](QDir &d) { QString p = d.filePath("file"); QFile f(p); f.open(QIODevice::WriteOnly); f.setPermissions(QFile::ReadOwner | QFile::WriteOwner); updateRuntimeDir(p); QTest::ignoreMessage(QtWarningMsg, QString("QStandardPaths: runtime directory '%1' is not a directory, " "but a regular file permissions 0600 owned by UID %2 GID %3") .arg(p).arg(getuid()).arg(getgid()).toLatin1()); return fallbackXdgRuntimeDir(); });
open, setPermissions etc. are fallible operations. They ought to fail the autotest if they fail. However, due to the way this is coded ("data-function-driven"), we can't just wrap them in QVERIFY.
This testcase should be refactored.
Attachments
For Gerrit Dashboard: QTBUG-123623 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
550841,4 | tst_moc: handle QFile::open failures from non-test functions | dev | qt/qtbase | Status: MERGED | +2 | 0 |
552114,4 | tst_qstandardpaths: check the return value of QFile::open | dev | qt/qtbase | Status: MERGED | +2 | 0 |