diff options
Diffstat (limited to 'tests/auto/corelib/io')
16 files changed, 303 insertions, 45 deletions
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 52e7ebadb1..a6775ec2b6 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -528,7 +528,7 @@ void tst_QDir::removeRecursivelyFailure() #ifdef Q_OS_UNIX QFile dirAsFile(path); // yay, I have to use QFile to change a dir's permissions... - QVERIFY(dirAsFile.setPermissions(QFile::Permissions(0))); // no permissions + QVERIFY(dirAsFile.setPermissions({})); // no permissions QVERIFY(!QDir().rmdir(path)); QDir dir(path); diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index 0b125925bb..00e1c74d07 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -236,7 +236,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data() QTest::addColumn<QStringList>("entries"); QTest::newRow("no flags") - << QString("entrylist") << QDirIterator::IteratorFlags(0) + << QString("entrylist") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::NoFilter) << QStringList("*") << QString( "entrylist/.," @@ -252,7 +252,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/writable").split(','); QTest::newRow("NoDot") - << QString("entrylist") << QDirIterator::IteratorFlags(0) + << QString("entrylist") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::AllEntries | QDir::NoDot) << QStringList("*") << QString( "entrylist/..," @@ -267,7 +267,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/writable").split(','); QTest::newRow("NoDotDot") - << QString("entrylist") << QDirIterator::IteratorFlags(0) + << QString("entrylist") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::AllEntries | QDir::NoDotDot) << QStringList("*") << QString( "entrylist/.," @@ -282,7 +282,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/writable").split(','); QTest::newRow("NoDotAndDotDot") - << QString("entrylist") << QDirIterator::IteratorFlags(0) + << QString("entrylist") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::AllEntries | QDir::NoDotAndDotDot) << QStringList("*") << QString( "entrylist/file," @@ -335,12 +335,12 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/writable").split(','); QTest::newRow("empty, default") - << QString("empty") << QDirIterator::IteratorFlags(0) + << QString("empty") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::NoFilter) << QStringList("*") << QString("empty/.,empty/..").split(','); QTest::newRow("empty, QDir::NoDotAndDotDot") - << QString("empty") << QDirIterator::IteratorFlags(0) + << QString("empty") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::NoDotAndDotDot) << QStringList("*") << QStringList(); } @@ -399,13 +399,13 @@ void tst_QDirIterator::iterateResource_data() QTest::addColumn<QStringList>("nameFilters"); QTest::addColumn<QStringList>("entries"); - QTest::newRow("invalid") << QString::fromLatin1(":/testdata/burpaburpa") << QDirIterator::IteratorFlags(0) + QTest::newRow("invalid") << QString::fromLatin1(":/testdata/burpaburpa") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::NoFilter) << QStringList(QLatin1String("*")) << QStringList(); - QTest::newRow(":/testdata") << QString::fromLatin1(":/testdata/") << QDirIterator::IteratorFlags(0) + QTest::newRow(":/testdata") << QString::fromLatin1(":/testdata/") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::NoFilter) << QStringList(QLatin1String("*")) << QString::fromLatin1(":/testdata/entrylist").split(QLatin1String(",")); - QTest::newRow(":/testdata/entrylist") << QString::fromLatin1(":/testdata/entrylist") << QDirIterator::IteratorFlags(0) + QTest::newRow(":/testdata/entrylist") << QString::fromLatin1(":/testdata/entrylist") << QDirIterator::IteratorFlags{} << QDir::Filters(QDir::NoFilter) << QStringList(QLatin1String("*")) << QString::fromLatin1(":/testdata/entrylist/directory,:/testdata/entrylist/file").split(QLatin1String(",")); QTest::newRow(":/testdata recursive") << QString::fromLatin1(":/testdata") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories) diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index b8ae95dd93..16a30af892 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -499,7 +499,7 @@ void tst_QFile::initTestCase() file.write("b", 1); file.close(); #ifndef Q_OS_WIN // Not supported on Windows. - QVERIFY2(file.setPermissions(0), qPrintable(file.errorString())); + QVERIFY2(file.setPermissions({ }), qPrintable(file.errorString())); #else QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData()); #endif @@ -2211,7 +2211,7 @@ public: QStringList entryList(QDir::Filters, const QStringList &) const { return QStringList(); } bool caseSensitive() const { return false; } bool isRelativePath() const { return false; } - FileFlags fileFlags(FileFlags) const { return 0; } + FileFlags fileFlags(FileFlags) const { return { }; } bool chmod(uint) { return false; } QString fileName(FileName) const { return name; } uint ownerId(FileOwner) const { return 0; } diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 0597a7d521..09ef0ea44f 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1813,19 +1813,22 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks() QVERIFY2(creationResult == ERROR_SUCCESS, qPrintable(errorMessage)); QFileInfo fi(path); - const bool actualIsSymLink = fi.isSymbolicLink(); + auto guard = qScopeGuard([&fi, this]() { + // Ensure that junctions, mountpoints are removed. If this fails, do not remove + // temporary directory to prevent it from trashing the system. + if (fi.isDir()) { + if (!QDir().rmdir(fi.filePath())) { + qWarning("Unable to remove NTFS junction '%ls', keeping '%ls'.", + qUtf16Printable(fi.fileName()), + qUtf16Printable(QDir::toNativeSeparators(m_dir.path()))); + m_dir.setAutoRemove(false); + } + } + }); const QString actualSymLinkTarget = isSymLink ? fi.symLinkTarget() : QString(); const QString actualCanonicalFilePath = isSymLink ? fi.canonicalFilePath() : QString(); - // Ensure that junctions, mountpoints are removed. If this fails, do not remove - // temporary directory to prevent it from trashing the system. - if (fi.isDir()) { - if (!QDir().rmdir(fi.filePath())) { - qWarning("Unable to remove NTFS junction '%s'', keeping '%s'.", - qPrintable(fi.fileName()), qPrintable(QDir::toNativeSeparators(m_dir.path()))); - m_dir.setAutoRemove(false); - } - } - QCOMPARE(actualIsSymLink, isSymLink); + QCOMPARE(fi.isJunction(), resource.type == NtfsTestResource::Junction); + QCOMPARE(fi.isSymbolicLink(), isSymLink); if (isSymLink) { QCOMPARE(actualSymLinkTarget, linkTarget); QCOMPARE(actualCanonicalFilePath, canonicalFilePath); diff --git a/tests/auto/corelib/io/qfilesystemengine/qfilesystemengine.pro b/tests/auto/corelib/io/qfilesystemengine/qfilesystemengine.pro new file mode 100644 index 0000000000..ed59b48d5e --- /dev/null +++ b/tests/auto/corelib/io/qfilesystemengine/qfilesystemengine.pro @@ -0,0 +1,6 @@ +CONFIG += testcase +TARGET = tst_qfilesystemengine +QT = core-private testlib +SOURCES = tst_qfilesystemengine.cpp \ + $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry.cpp +HEADERS = $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry_p.h diff --git a/tests/auto/corelib/io/qfilesystemengine/tst_qfilesystemengine.cpp b/tests/auto/corelib/io/qfilesystemengine/tst_qfilesystemengine.cpp new file mode 100644 index 0000000000..b64852057a --- /dev/null +++ b/tests/auto/corelib/io/qfilesystemengine/tst_qfilesystemengine.cpp @@ -0,0 +1,168 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> +#include <QtCore/QTemporaryDir> +#include <QtCore/QTemporaryFile> + +#include <QtCore/private/qfilesystementry_p.h> +#include <QtCore/private/qfilesystemengine_p.h> + +class tst_QFileSystemEngine : public QObject +{ + Q_OBJECT + +private slots: + void cleanupTestCase(); + void moveToTrash_data(); + void moveToTrash(); + +private: + QStringList createdEntries; +}; + +void tst_QFileSystemEngine::cleanupTestCase() +{ + for (QString entry : createdEntries) { + QFileInfo entryInfo(entry); + if (!entryInfo.exists()) + continue; + QDir entryDir(entry); + if (entryInfo.isDir()) { + if (!entryDir.removeRecursively()) + qWarning("Failed to remove trashed dir '%s'", entry.toLocal8Bit().constData()); + } else if (!QFile::remove(entry)) { + qWarning("Failed to remove trashed file '%s'", entry.toLocal8Bit().constData()); + } + } +} + +void tst_QFileSystemEngine::moveToTrash_data() +{ + QTest::addColumn<QString>("filePath"); + QTest::addColumn<bool>("create"); + QTest::addColumn<bool>("success"); + + { + QTemporaryFile tempFile; + tempFile.open(); + QTest::newRow("temporary file") + << tempFile.fileName() + << true << true; + } + { + QTemporaryDir tempDir; + tempDir.setAutoRemove(false); + QTest::newRow("temporary dir") + << tempDir.path() + QLatin1Char('/') + << true << true; + } + { + QTemporaryDir homeDir(QFileSystemEngine::homePath() + QLatin1String("/XXXXXX")); + homeDir.setAutoRemove(false); + QTemporaryFile homeFile(homeDir.path() + + QLatin1String("/tst_qfilesystemengine-XXXXXX")); + homeFile.open(); + QTest::newRow("home file") + << homeFile.fileName() + << true << true; + + QTest::newRow("home dir") + << homeDir.path() + QLatin1Char('/') + << true << true; + } + + QTest::newRow("unmovable") + << QFileSystemEngine::rootPath() + << false << false; + QTest::newRow("no such file") + << QString::fromLatin1("no/such/file") + << false << false; +} + +void tst_QFileSystemEngine::moveToTrash() +{ + QFETCH(QString, filePath); + QFETCH(bool, create); + QFETCH(bool, success); + +#if defined(Q_OS_WINRT) + QSKIP("WinRT does not have a trash", SkipAll); +#endif + + if (create && !QFileInfo::exists(filePath)) { + createdEntries << filePath; + if (filePath.endsWith(QLatin1Char('/'))) { + QDir temp(QFileSystemEngine::rootPath()); + temp.mkdir(filePath); + QFile file(filePath + QLatin1String("test")); + if (!file.open(QIODevice::WriteOnly)) + QSKIP("Couldn't create directory with file"); + } else { + QFile file(filePath); + if (!file.open(QIODevice::WriteOnly)) + QSKIP("Couldn't open file for writing"); + } + QVERIFY(QFileInfo::exists(filePath)); + } + + QFileSystemEntry entry(filePath); + QFileSystemEntry newLocation; + QSystemError error; + + bool existed = QFileInfo::exists(filePath); + bool result = QFileSystemEngine::moveFileToTrash(entry, newLocation, error); + QCOMPARE(result, success); + if (result) { + QCOMPARE(error.error(), 0); + QVERIFY(existed != QFileInfo::exists(filePath)); + const QString newPath = newLocation.filePath(); +#if defined(Q_OS_WIN) + // one of the Windows code paths doesn't provide the location of the object in the trash + if (newPath.isEmpty()) + QEXPECT_FAIL("", "Qt built without IFileOperations support on Windows!", Continue); +#endif + QVERIFY(!newPath.isEmpty()); + if (!newPath.isEmpty()) { + createdEntries << newPath; + QFileInfo trashInfo(newPath); + QVERIFY(trashInfo.exists()); +#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) + QString infoFile = trashInfo.absolutePath() + QLatin1String("/../info/") + + trashInfo.fileName() + QLatin1String(".trashinfo"); + createdEntries << infoFile; +#endif + } + } else { + QVERIFY(error.error() != 0); + QCOMPARE(existed, QFileInfo::exists(filePath)); + } +} + +QTEST_MAIN(tst_QFileSystemEngine) +#include <tst_qfilesystemengine.moc> diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp index 8703b15dda..4969e417f4 100644 --- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp +++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp @@ -444,7 +444,7 @@ void tst_QLockFile::noPermissions() const QString fileName = dir.path() + "/staleLock"; QFile dirAsFile(dir.path()); // I have to use QFile to change a dir's permissions... - QVERIFY2(dirAsFile.setPermissions(QFile::Permissions(0)), qPrintable(dir.path())); // no permissions + QVERIFY2(dirAsFile.setPermissions(QFile::Permissions{}), qPrintable(dir.path())); // no permissions PermissionRestorer permissionRestorer(dir.path()); QLockFile lockFile(fileName); diff --git a/tests/auto/corelib/io/qresourceengine/compressed.qrc b/tests/auto/corelib/io/qresourceengine/compressed.qrc new file mode 100644 index 0000000000..f7c7cbc20f --- /dev/null +++ b/tests/auto/corelib/io/qresourceengine/compressed.qrc @@ -0,0 +1,5 @@ +<RCC version="1.0"> + <qresource> + <file>zero.txt</file> + </qresource> +</RCC> diff --git a/tests/auto/corelib/io/qresourceengine/generateResources.sh b/tests/auto/corelib/io/qresourceengine/generateResources.sh new file mode 100755 index 0000000000..9894f6bfb7 --- /dev/null +++ b/tests/auto/corelib/io/qresourceengine/generateResources.sh @@ -0,0 +1,7 @@ +#!/bin/sh +count=`awk '/ZERO_FILE_LEN/ { print $3 }' tst_qresourceengine.cpp` +dd if=/dev/zero of=zero.txt bs=1 count=$count +rcc --binary -o uncompressed.rcc --no-compress compressed.qrc +rcc --binary -o zlib.rcc --compress-algo zlib --compress 9 compressed.qrc +rcc --binary -o zstd.rcc --compress-algo zstd --compress 19 compressed.qrc +rm zero.txt diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro index f523116cc9..345e3d13b9 100644 --- a/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro +++ b/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_qresourceengine -QT = core testlib +QT = core-private testlib SOURCES = tst_qresourceengine.cpp RESOURCES += testqrc/test.qrc @@ -15,7 +15,8 @@ QMAKE_DISTCLEAN += $${runtime_resource.target} TESTDATA += \ parentdir.txt \ - testqrc/* + testqrc/* \ + *.rcc GENERATED_TESTDATA = $${runtime_resource.target} android:!android-embedded { diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp index 44c8c4b681..902e6db12a 100644 --- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp +++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp @@ -27,10 +27,10 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <QtCore/QCoreApplication> -#include <QtCore/QMimeDatabase> +#include <QtCore/QScopeGuard> +#include <QtCore/private/qglobal_p.h> class tst_QResourceEngine: public QObject { @@ -51,6 +51,8 @@ private slots: void checkUnregisterResource_data(); void checkUnregisterResource(); + void compressedResource_data(); + void compressedResource(); void checkStructure_data(); void checkStructure(); void searchPath_data(); @@ -106,6 +108,75 @@ void tst_QResourceEngine::cleanupTestCase() QVERIFY(QResource::unregisterResource(m_runtimeResourceRcc, "/secondary_root/")); } +void tst_QResourceEngine::compressedResource_data() +{ + QTest::addColumn<QString>("fileName"); + QTest::addColumn<int>("compressionAlgo"); + QTest::addColumn<bool>("supported"); + + QTest::newRow("uncompressed") + << QFINDTESTDATA("uncompressed.rcc") << int(QResource::NoCompression) << true; + QTest::newRow("zlib") + << QFINDTESTDATA("zlib.rcc") << int(QResource::ZlibCompression) << true; + QTest::newRow("zstd") + << QFINDTESTDATA("zstd.rcc") << int(QResource::ZstdCompression) << QT_CONFIG(zstd); +} + +// Note: generateResource.sh parses this line. Make sure it's a simple number. +#define ZERO_FILE_LEN 16384 +// End note +void tst_QResourceEngine::compressedResource() +{ + QFETCH(QString, fileName); + QFETCH(int, compressionAlgo); + QFETCH(bool, supported); + const QByteArray expectedData(ZERO_FILE_LEN, '\0'); + + QVERIFY(!QResource("zero.txt").isValid()); + QCOMPARE(QResource::registerResource(fileName), supported); + if (!supported) + return; + + auto unregister = qScopeGuard([=] { QResource::unregisterResource(fileName); }); + + QResource resource("zero.txt"); + QVERIFY(resource.isValid()); + QVERIFY(resource.size() > 0); + QVERIFY(resource.data()); + QCOMPARE(resource.compressionAlgorithm(), QResource::Compression(compressionAlgo)); + + if (compressionAlgo == QResource::NoCompression) { + QCOMPARE(resource.size(), ZERO_FILE_LEN); + QCOMPARE(memcmp(resource.data(), expectedData.data(), ZERO_FILE_LEN), 0); + + // API guarantees it will be QByteArray::fromRawData: + QCOMPARE(static_cast<const void *>(resource.uncompressedData().constData()), + static_cast<const void *>(resource.data())); + } else { + // reasonable expectation: + QVERIFY(resource.size() < ZERO_FILE_LEN); + } + + // using the engine + QFile f(":/zero.txt"); + QVERIFY(f.exists()); + QVERIFY(f.open(QIODevice::ReadOnly)); + + // verify that we can decompress correctly + QCOMPARE(resource.uncompressedSize(), ZERO_FILE_LEN); + QCOMPARE(f.size(), ZERO_FILE_LEN); + + QByteArray data = resource.uncompressedData(); + QCOMPARE(data.size(), expectedData.size()); + QCOMPARE(data, expectedData); + + // decompression through the engine + data = f.readAll(); + QCOMPARE(data.size(), expectedData.size()); + QCOMPARE(data, expectedData); +} + + void tst_QResourceEngine::checkStructure_data() { QTest::addColumn<QString>("pathName"); @@ -119,24 +190,20 @@ void tst_QResourceEngine::checkStructure_data() QStringList rootContents; rootContents << QLatin1String("aliasdir") +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) + << QLatin1String("android_testdata") +#endif << QLatin1String("otherdir") - << QLatin1String("qt-project.org") << QLatin1String("runtime_resource") << QLatin1String("searchpath1") << QLatin1String("searchpath2") << QLatin1String("secondary_root") << QLatin1String("staticplugin") << QLatin1String("test") - << QLatin1String("withoutslashes"); - -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) - rootContents.insert(1, QLatin1String("android_testdata")); -#endif - #if defined(BUILTIN_TESTDATA) - rootContents.insert(9, QLatin1String("testqrc")); + << QLatin1String("testqrc") #endif - + << QLatin1String("withoutslashes"); QTest::newRow("root dir") << QString(":/") << QByteArray() @@ -145,7 +212,13 @@ void tst_QResourceEngine::checkStructure_data() << "parentdir.txt" << "runtime_resource.rcc" #endif - << "search_file.txt") + << "search_file.txt" +#if defined(BUILTIN_TESTDATA) + << "uncompressed.rcc" + << "zlib.rcc" + << "zstd.rcc" +#endif + ) << rootContents << QLocale::c() << qlonglong(0); @@ -352,11 +425,6 @@ void tst_QResourceEngine::checkStructure() QFETCH(QLocale, locale); QFETCH(qlonglong, contentsSize); - // We rely on the existence of the root "qt-project.org" in resources. For - // static builds on MSVC these resources are only added if they are used. - QMimeDatabase db; - Q_UNUSED(db); - bool directory = (containedDirs.size() + containedFiles.size() > 0); QLocale::setDefault(locale); diff --git a/tests/auto/corelib/io/qresourceengine/uncompressed.rcc b/tests/auto/corelib/io/qresourceengine/uncompressed.rcc Binary files differnew file mode 100644 index 0000000000..4b009f73d5 --- /dev/null +++ b/tests/auto/corelib/io/qresourceengine/uncompressed.rcc diff --git a/tests/auto/corelib/io/qresourceengine/zlib.rcc b/tests/auto/corelib/io/qresourceengine/zlib.rcc Binary files differnew file mode 100644 index 0000000000..66f79fa630 --- /dev/null +++ b/tests/auto/corelib/io/qresourceengine/zlib.rcc diff --git a/tests/auto/corelib/io/qresourceengine/zstd.rcc b/tests/auto/corelib/io/qresourceengine/zstd.rcc Binary files differnew file mode 100644 index 0000000000..672fa05d14 --- /dev/null +++ b/tests/auto/corelib/io/qresourceengine/zstd.rcc diff --git a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp index f1327933c4..8e500d7c8e 100644 --- a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp +++ b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp @@ -356,7 +356,7 @@ void tst_QSaveFile::transactionalWriteErrorRenaming() #ifdef Q_OS_UNIX // Make rename() fail for lack of permissions in the directory QFile dirAsFile(dir.path()); // yay, I have to use QFile to change a dir's permissions... - QVERIFY(dirAsFile.setPermissions(QFile::Permissions(0))); // no permissions + QVERIFY(dirAsFile.setPermissions(QFile::Permissions{})); // no permissions PermissionRestorer permissionRestorer(dir.path()); #else // Windows: Make rename() fail for lack of permissions on an existing target file diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp index bcf6d6c32b..5c6e633749 100644 --- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp +++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp @@ -848,7 +848,7 @@ void tst_QUrlInternal::correctEncodedMistakes() QString dataTag = QTest::currentDataTag(); QString output = dataTag; - if (!qt_urlRecode(output, input.constData(), input.constData() + input.length(), 0)) + if (!qt_urlRecode(output, input.constData(), input.constData() + input.length(), { })) output += input; QCOMPARE(output, dataTag + expected); |