summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/.prev_CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/io.pro3
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp2
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp40
-rw-r--r--tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp7
-rw-r--r--tests/auto/corelib/io/qfile/.prev_CMakeLists.txt6
-rw-r--r--tests/auto/corelib/io/qfile/CMakeLists.txt6
-rw-r--r--tests/auto/corelib/io/qfile/qfile.pro4
-rw-r--r--tests/auto/corelib/io/qfile/test.pro2
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp40
-rw-r--r--tests/auto/corelib/io/qfileinfo/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/io/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp63
-rw-r--r--tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp2
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp6
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp6
-rw-r--r--tests/auto/corelib/io/qlockfile/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp8
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.pro2
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp45
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp17
-rw-r--r--tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp4
-rw-r--r--tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp4
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp4
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp2
26 files changed, 90 insertions, 197 deletions
diff --git a/tests/auto/corelib/io/.prev_CMakeLists.txt b/tests/auto/corelib/io/.prev_CMakeLists.txt
index 5baf4c35de..b9d2954156 100644
--- a/tests/auto/corelib/io/.prev_CMakeLists.txt
+++ b/tests/auto/corelib/io/.prev_CMakeLists.txt
@@ -18,6 +18,7 @@ add_subdirectory(qloggingcategory)
add_subdirectory(qnodebug)
add_subdirectory(qsavefile)
add_subdirectory(qstandardpaths)
+add_subdirectory(qstorageinfo)
add_subdirectory(qtemporarydir)
add_subdirectory(qtemporaryfile)
add_subdirectory(qurlquery)
@@ -51,6 +52,3 @@ endif()
if(QT_FEATURE_settings AND TARGET Qt::Gui)
add_subdirectory(qsettings)
endif()
-if(NOT WINRT)
- add_subdirectory(qstorageinfo)
-endif()
diff --git a/tests/auto/corelib/io/CMakeLists.txt b/tests/auto/corelib/io/CMakeLists.txt
index 9ec9da18c9..18fc2bf375 100644
--- a/tests/auto/corelib/io/CMakeLists.txt
+++ b/tests/auto/corelib/io/CMakeLists.txt
@@ -18,6 +18,7 @@ add_subdirectory(qloggingcategory)
add_subdirectory(qnodebug)
add_subdirectory(qsavefile)
add_subdirectory(qstandardpaths)
+add_subdirectory(qstorageinfo)
add_subdirectory(qtemporarydir)
add_subdirectory(qtemporaryfile)
add_subdirectory(qurlquery)
@@ -51,6 +52,3 @@ endif()
if(QT_FEATURE_settings AND TARGET Qt::Gui)
add_subdirectory(qsettings)
endif()
-if(NOT WINRT)
- add_subdirectory(qstorageinfo)
-endif()
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index eee2c0e30d..84a4cf0dab 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -68,9 +68,6 @@ win32:!qtConfig(private_tests): SUBDIRS -= \
!qtConfig(settings): SUBDIRS -= \
qsettings
-winrt: SUBDIRS -= \
- qstorageinfo
-
android: SUBDIRS -= \
qprocess \
qdir \
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index e6d2f10c16..33d7ea1da3 100644
--- a/tests/auto/corelib/io/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -62,7 +62,7 @@ public:
, fd_(-1)
, stream_(0)
{
- #if defined(QT_LARGEFILE_SUPPORT) && !defined(Q_OS_MAC) && !defined(Q_OS_WINRT)
+ #if defined(QT_LARGEFILE_SUPPORT) && !defined(Q_OS_MAC)
maxSizeBits = 36; // 64 GiB
#elif defined(Q_OS_MAC)
// HFS+ does not support sparse files, so we limit file size for the test
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index 5462a63fab..56b19bc4c0 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -51,7 +51,7 @@
# include <sys/stat.h>
#endif
-#if defined(Q_OS_VXWORKS) || defined(Q_OS_WINRT)
+#if defined(Q_OS_VXWORKS)
#define Q_NO_SYMLINKS
#endif
@@ -587,7 +587,7 @@ void tst_QDir::exists_data()
QTest::newRow("simple dir") << (m_dataPath + "/resources") << true;
QTest::newRow("simple dir with slash") << (m_dataPath + "/resources/") << true;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
QTest::newRow("unc 1") << uncRoot << true;
QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
@@ -599,7 +599,7 @@ void tst_QDir::exists_data()
QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << false;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false;
#endif
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT))
+#if defined (Q_OS_WIN)
QTest::newRow("This drive should exist") << "C:/" << true;
// find a non-existing drive and check if it does not exist
#ifdef QT_BUILD_INTERNAL
@@ -977,7 +977,7 @@ void tst_QDir::entryListSimple_data()
QTest::newRow("simple dir") << (m_dataPath + "/resources") << 2;
QTest::newRow("simple dir with slash") << (m_dataPath + "/resources/") << 2;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
QTest::newRow("unc 1") << uncRoot << 2;
QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << 2;
@@ -1248,7 +1248,7 @@ tst_QDir::cleanPath_data()
#else
QTest::newRow("data10") << "/:/" << "/:";
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QTest::newRow("data11") << "//foo//bar" << "//foo/bar";
#endif
QTest::newRow("data12") << "ab/a/" << "ab/a"; // Path item with length of 2
@@ -1260,11 +1260,7 @@ tst_QDir::cleanPath_data()
QTest::newRow("data14") << "c://foo" << "c:/foo";
// Drive letters and unc path in one string
-#if defined(Q_OS_WINRT)
- const QString root = QDir::rootPath(); // has trailing slash
- QTest::newRow("root-up") << (root + "path/..") << root;
- QTest::newRow("above-root") << (root + "..") << (root + "..");
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
QTest::newRow("data15") << "//c:/foo" << "//c:/foo";
QTest::newRow("drive-up") << "A:/path/.." << "A:/";
QTest::newRow("drive-above-root") << "A:/.." << "A:/..";
@@ -1387,7 +1383,7 @@ void tst_QDir::absoluteFilePath_data()
QTest::addColumn<QString>("fileName");
QTest::addColumn<QString>("expectedFilePath");
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QTest::newRow("UNC-rel") << "//machine/share" << "dir" << "//machine/share/dir";
QTest::newRow("UNC-abs") << "//machine/share/path/to/blah" << "/dir" << "//machine/share/dir";
QTest::newRow("UNC-UNC") << "//machine/share/path/to/blah" << "//host/share/path" << "//host/share/path";
@@ -1425,7 +1421,7 @@ void tst_QDir::absolutePath_data()
QTest::addColumn<QString>("expectedPath");
QTest::newRow("0") << "/machine/share/dir1" << "/machine/share/dir1";
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT))
+#if defined(Q_OS_WIN)
QTest::newRow("1") << "\\machine\\share\\dir1" << "/machine/share/dir1";
QTest::newRow("2") << "//machine/share/dir1" << "//machine/share/dir1";
QTest::newRow("3") << "\\\\machine\\share\\dir1" << "//machine/share/dir1";
@@ -1493,12 +1489,10 @@ void tst_QDir::relativeFilePath_data()
QTest::newRow("27") << "C:" << "D:/" << "D:/";
QTest::newRow("28") << "C:/" << "D:" << "D:";
QTest::newRow("29") << "C:/" << "D:/" << "D:/";
-#ifndef Q_OS_WINRT
QTest::newRow("30") << "C:/foo/bar" << "//anotherHost/foo/bar" << "//anotherHost/foo/bar";
QTest::newRow("31") << "//anotherHost/foo" << "//anotherHost/foo/bar" << "bar";
QTest::newRow("32") << "//anotherHost/foo" << "bar" << "bar";
QTest::newRow("33") << "//anotherHost/foo" << "C:/foo/bar" << "C:/foo/bar";
-#endif // !Q_OS_WINRT
#endif
QTest::newRow("resource0") << ":/prefix" << "foo.bar" << "foo.bar";
@@ -1692,11 +1686,7 @@ void tst_QDir::homePath()
qputenv("HOME", envHome);
#elif defined(Q_OS_WIN)
- if (strHome.length() > 3 // root dir = "c:/"; "//" is not really valid...
-#if defined(Q_OS_WINRT)
- && strHome.length() > QDir::rootPath().length()
-#endif
- )
+ if (strHome.length() > 3) // root dir = "c:/"; "//" is not really valid...
QVERIFY(!strHome.endsWith('/'));
#endif
@@ -2149,9 +2139,6 @@ void tst_QDir::drives()
QVERIFY(list.count() >= 1); //system
QLatin1Char systemdrive('c');
#endif
-#if defined(Q_OS_WINRT)
- QSKIP("WinRT has no concept of drives");
-#endif
#if defined(Q_OS_WIN)
QVERIFY(list.count() <= 26);
bool foundsystem = false;
@@ -2208,9 +2195,7 @@ void tst_QDir::equalityOperator_data()
<< true;
//need a path in the root directory that is unlikely to be a symbolic link.
-#if defined (Q_OS_WINRT)
- QString pathinroot(QDir::rootPath() + QLatin1String("assets/.."));
-#elif defined (Q_OS_WIN)
+#if defined (Q_OS_WIN)
QString pathinroot("c:/windows/..");
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
QString pathinroot("/system/..");
@@ -2341,8 +2326,6 @@ void tst_QDir::cdBelowRoot_data()
QTest::newRow("android") << "/" << "system" << "/system";
#elif defined(Q_OS_UNIX)
QTest::newRow("unix") << "/" << "tmp" << "/tmp";
-#elif defined(Q_OS_WINRT)
- QTest::newRow("winrt") << QDir::rootPath() << QDir::rootPath() << QDir::rootPath();
#else // Windows+CE
const QString systemDrive = QString::fromLocal8Bit(qgetenv("SystemDrive")) + QLatin1Char('/');
const QString systemRoot = QString::fromLocal8Bit(qgetenv("SystemRoot"));
@@ -2370,9 +2353,6 @@ void tst_QDir::cdBelowRoot()
if (::getuid() == 0)
QSKIP("Running this test as root doesn't make sense");
#endif
-#ifdef Q_OS_WINRT
- QSKIP("WinRT has no concept of system root");
-#endif
QDir dir(targetPath);
QVERIFY2(!dir.cd("../.."), qPrintable(dir.absolutePath()));
QCOMPARE(dir.path(), targetPath);
diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
index 00e1c74d07..24e6128b4d 100644
--- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
@@ -37,7 +37,7 @@
#include <QtCore/private/qfsfileengine_p.h>
-#if defined(Q_OS_VXWORKS) || defined(Q_OS_WINRT)
+#if defined(Q_OS_VXWORKS)
#define Q_NO_SYMLINKS
#endif
@@ -220,11 +220,6 @@ void tst_QDirIterator::cleanupTestCase()
Q_FOREACH(QString dirName, createdDirectories)
currentDir.rmdir(dirName);
-
-#ifdef Q_OS_WINRT
- QDir::setCurrent(QCoreApplication::applicationDirPath());
-#endif // Q_OS_WINRT
-
}
void tst_QDirIterator::iterateRelativeDirectory_data()
diff --git a/tests/auto/corelib/io/qfile/.prev_CMakeLists.txt b/tests/auto/corelib/io/qfile/.prev_CMakeLists.txt
index cf329d37b7..196a0c056f 100644
--- a/tests/auto/corelib/io/qfile/.prev_CMakeLists.txt
+++ b/tests/auto/corelib/io/qfile/.prev_CMakeLists.txt
@@ -79,11 +79,9 @@ extend_target(tst_qfile CONDITION CONFIG___contains___builtin_testdata
BUILTIN_TESTDATA
)
-extend_target(tst_qfile CONDITION WIN32 AND NOT WINRT
+extend_target(tst_qfile CONDITION WIN32
PUBLIC_LIBRARIES
ole32
uuid
)
-if(NOT WINRT)
- add_subdirectory(stdinprocess)
-endif()
+add_subdirectory(stdinprocess)
diff --git a/tests/auto/corelib/io/qfile/CMakeLists.txt b/tests/auto/corelib/io/qfile/CMakeLists.txt
index 6bfb3fe8fd..bfea2c7f49 100644
--- a/tests/auto/corelib/io/qfile/CMakeLists.txt
+++ b/tests/auto/corelib/io/qfile/CMakeLists.txt
@@ -79,11 +79,9 @@ extend_target(tst_qfile CONDITION CONFIG___contains___builtin_testdata
BUILTIN_TESTDATA
)
-extend_target(tst_qfile CONDITION WIN32 AND NOT WINRT
+extend_target(tst_qfile CONDITION WIN32
PUBLIC_LIBRARIES
ole32
uuid
)
-if(NOT WINRT)
- add_subdirectory(stdinprocess)
-endif()
+add_subdirectory(stdinprocess)
diff --git a/tests/auto/corelib/io/qfile/qfile.pro b/tests/auto/corelib/io/qfile/qfile.pro
index 91c5c15f66..1b434a2a74 100644
--- a/tests/auto/corelib/io/qfile/qfile.pro
+++ b/tests/auto/corelib/io/qfile/qfile.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = test.pro
-!winrt: SUBDIRS += stdinprocess
+SUBDIRS = test.pro \
+ stdinprocess
diff --git a/tests/auto/corelib/io/qfile/test.pro b/tests/auto/corelib/io/qfile/test.pro
index 47b778bc33..7841973a65 100644
--- a/tests/auto/corelib/io/qfile/test.pro
+++ b/tests/auto/corelib/io/qfile/test.pro
@@ -23,6 +23,6 @@ TESTDATA += \
Makefile forCopying.txt forRenaming.txt \
resources/file1.ext1
-win32:!winrt: QMAKE_USE += ole32 uuid
+win32: QMAKE_USE += ole32 uuid
CONFIG += c++17
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index d2a83757d2..9416796c6c 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -189,19 +189,17 @@ private slots:
void copyRemovesTemporaryFile() const;
void copyShouldntOverwrite();
void copyFallback();
-#ifndef Q_OS_WINRT
void link();
void linkToDir();
void absolutePathLinkToRelativePath();
void readBrokenLink();
-#endif
void readTextFile_data();
void readTextFile();
void readTextFile2();
void writeTextFile_data();
void writeTextFile();
/* void largeFileSupport(); */
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void largeUncFileSupport();
#endif
void flush();
@@ -550,7 +548,7 @@ void tst_QFile::exists()
file.remove();
QVERIFY(!file.exists());
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
const QString uncPath = "//" + QtNetworkSettings::winServerName() + "/testshare/readme.txt";
QFile unc(uncPath);
QVERIFY2(unc.exists(), msgFileDoesNotExist(uncPath).constData());
@@ -606,7 +604,7 @@ void tst_QFile::open_data()
<< int(QIODevice::ReadOnly)
<< false
<< QFile::OpenError;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
//opening devices requires administrative privileges (and elevation).
HANDLE hTest = CreateFile(_T("\\\\.\\PhysicalDrive0"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (hTest != INVALID_HANDLE_VALUE) {
@@ -637,7 +635,7 @@ void tst_QFile::open()
QSKIP("Running this test as root doesn't make sense");
#endif
-#if defined(Q_OS_WIN32) || defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN32)
QEXPECT_FAIL("noreadfile", "Windows does not currently support non-readable files.", Abort);
#endif
if (filename.isEmpty())
@@ -689,7 +687,7 @@ void tst_QFile::size_data()
QTest::addColumn<qint64>("size");
QTest::newRow( "exist01" ) << m_testFile << (qint64)245;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// Only test UNC on Windows./
QTest::newRow("unc") << "//" + QString(QtNetworkSettings::winServerName() + "/testshare/test.pri") << (qint64)34;
#endif
@@ -1173,7 +1171,7 @@ void tst_QFile::ungetChar()
QCOMPARE(buf[2], '4');
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QString driveLetters()
{
wchar_t volumeName[MAX_PATH];
@@ -1210,9 +1208,7 @@ void tst_QFile::invalidFile_data()
#if !defined(Q_OS_WIN)
QTest::newRow( "x11" ) << QString( "qwe//" );
#else
-#if !defined(Q_OS_WINRT)
QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid");
-#endif
QTest::newRow( "colon3" ) << QString( ":failinvalid" );
QTest::newRow( "forwardslash" ) << QString( "fail/invalid" );
QTest::newRow( "asterisk" ) << QString( "fail*invalid" );
@@ -1351,7 +1347,7 @@ void tst_QFile::permissions()
QFile::remove(file);
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
if (qt_ntfs_permission_lookup)
QEXPECT_FAIL("readonly", "QTBUG-25630", Abort);
#endif
@@ -1497,7 +1493,7 @@ void tst_QFile::copyFallback()
#include <shlobj.h>
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
static QString getWorkingDirectoryForLink(const QString &linkFileName)
{
bool neededCoInit = false;
@@ -1536,7 +1532,6 @@ static QString getWorkingDirectoryForLink(const QString &linkFileName)
}
#endif
-#ifndef Q_OS_WINRT
void tst_QFile::link()
{
QFile::remove("myLink.lnk");
@@ -1611,7 +1606,6 @@ void tst_QFile::readBrokenLink()
QVERIFY(QFile::link("ole/..", "myLink2.lnk"));
QCOMPARE(QFileInfo("myLink2.lnk").symLinkTarget(), QDir::currentPath());
}
-#endif // Q_OS_WINRT
void tst_QFile::readTextFile_data()
{
@@ -1696,7 +1690,7 @@ void tst_QFile::writeTextFile()
QCOMPARE(file.readAll(), out);
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// Helper for executing QFile::open() with warning in QTRY_VERIFY(), which evaluates the condition
// multiple times
static bool qFileOpen(QFile &file, QIODevice::OpenMode ioFlags)
@@ -2427,7 +2421,7 @@ void tst_QFile::writeLargeDataBlock_data()
QTest::newRow("localfile-Fd") << "./largeblockfile.txt" << (int)OpenFd;
QTest::newRow("localfile-Stream") << "./largeblockfile.txt" << (int)OpenStream;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !defined(QT_NO_NETWORK)
+#if defined(Q_OS_WIN) && !defined(QT_NO_NETWORK)
// Some semi-randomness to avoid collisions.
QTest::newRow("unc file")
<< QString("//" + QtNetworkSettings::winServerName() + "/TESTSHAREWRITABLE/largefile-%1-%2.txt")
@@ -2787,7 +2781,7 @@ void tst_QFile::appendAndRead()
void tst_QFile::miscWithUncPathAsCurrentDir()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QString current = QDir::currentPath();
const QString path = QLatin1String("//") + QtNetworkSettings::winServerName()
+ QLatin1String("/testshare");
@@ -2876,12 +2870,8 @@ void tst_QFile::nativeHandleLeaks()
}
#ifdef Q_OS_WIN
-# ifndef Q_OS_WINRT
handle1 = ::CreateFileA("qt_file.tmp", GENERIC_READ, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-# else
- handle1 = ::CreateFile2(L"qt_file.tmp", GENERIC_READ, 0, OPEN_ALWAYS, NULL);
-# endif
QVERIFY( INVALID_HANDLE_VALUE != handle1 );
QVERIFY( ::CloseHandle(handle1) );
#endif
@@ -2895,12 +2885,8 @@ void tst_QFile::nativeHandleLeaks()
}
#ifdef Q_OS_WIN
-# ifndef Q_OS_WINRT
handle2 = ::CreateFileA("qt_file.tmp", GENERIC_READ, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-# else
- handle2 = ::CreateFile2(L"qt_file.tmp", GENERIC_READ, 0, OPEN_ALWAYS, NULL);
-# endif
QVERIFY( INVALID_HANDLE_VALUE != handle2 );
QVERIFY( ::CloseHandle(handle2) );
#endif
@@ -3720,10 +3706,6 @@ void tst_QFile::moveToTrash()
QFETCH(bool, create);
QFETCH(bool, result);
-#if defined(Q_OS_WINRT)
- QSKIP("WinRT does not have a trash", SkipAll);
-#endif
-
auto ensureFile = [](const QString &source, bool create) {
if (QFileInfo::exists(source) || !create)
return;
diff --git a/tests/auto/corelib/io/qfileinfo/CMakeLists.txt b/tests/auto/corelib/io/qfileinfo/CMakeLists.txt
index a6cf3a38f1..05a14d4e1a 100644
--- a/tests/auto/corelib/io/qfileinfo/CMakeLists.txt
+++ b/tests/auto/corelib/io/qfileinfo/CMakeLists.txt
@@ -40,7 +40,7 @@ add_qt_resource(tst_qfileinfo "testdata"
## Scopes:
#####################################################################
-extend_target(tst_qfileinfo CONDITION WIN32 AND NOT WINRT
+extend_target(tst_qfileinfo CONDITION WIN32
PUBLIC_LIBRARIES
advapi32
netapi32
diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
index af764f3679..7c0e6f1537 100644
--- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
+++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
@@ -5,7 +5,7 @@ SOURCES = tst_qfileinfo.cpp
RESOURCES += qfileinfo.qrc \
testdata.qrc
-win32:!winrt: QMAKE_USE += advapi32 netapi32
+win32: QMAKE_USE += advapi32 netapi32
# for std::filesystem tests
qtConfig(c++17): CONFIG += c++17
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index c5dafb1a29..ce41e49985 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -48,11 +48,9 @@
#endif
#ifdef Q_OS_WIN
#include <qt_windows.h>
-#if !defined(Q_OS_WINRT)
#include <private/qwinregistry_p.h>
#include <lm.h>
#endif
-#endif
#include <qplatformdefs.h>
#include <qdebug.h>
#if defined(Q_OS_WIN)
@@ -61,7 +59,7 @@
#include <private/qfileinfo_p.h>
#include "../../../../shared/filesystem.h"
-#if defined(Q_OS_VXWORKS) || defined(Q_OS_WINRT)
+#if defined(Q_OS_VXWORKS)
#define Q_NO_SYMLINKS
#endif
@@ -69,9 +67,7 @@
QT_BEGIN_NAMESPACE
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
QT_END_NAMESPACE
-# ifndef Q_OS_WINRT
bool IsUserAdmin();
-# endif
#endif
inline bool qIsLikelyToBeFat(const QString &path)
@@ -96,7 +92,7 @@ inline bool qIsLikelyToBeNfs(const QString &path)
#endif
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
# ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE // MinGW
# define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE (0x2)
# endif
@@ -126,7 +122,7 @@ static QByteArray msgInsufficientPrivileges(const QString &errorMessage)
{
return "Insufficient privileges (" + errorMessage.toLocal8Bit() + ')';
}
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
static QString seedAndTemplate()
{
@@ -261,7 +257,7 @@ private slots:
void refresh();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void ntfsJunctionPointsAndSymlinks_data();
void ntfsJunctionPointsAndSymlinks();
void brokenShortcut();
@@ -278,9 +274,7 @@ private slots:
void detachingOperations();
-#if !defined(Q_OS_WINRT)
void owner();
-#endif
void group();
void invalidState_data();
@@ -421,12 +415,12 @@ void tst_QFileInfo::isDir_data()
QTest::newRow("broken link") << "brokenlink.lnk" << false;
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT))
+#if defined(Q_OS_WIN)
QTest::newRow("drive 1") << "c:" << true;
QTest::newRow("drive 2") << "c:/" << true;
//QTest::newRow("drive 2") << "t:s" << false;
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
QTest::newRow("unc 1") << uncRoot << true;
QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
@@ -463,13 +457,13 @@ void tst_QFileInfo::isRoot_data()
QTest::newRow("simple dir") << m_resourcesDir << false;
QTest::newRow("simple dir with slash") << (m_resourcesDir + QLatin1Char('/')) << false;
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT))
+#if defined(Q_OS_WIN)
QTest::newRow("drive 1") << "c:" << false;
QTest::newRow("drive 2") << "c:/" << true;
QTest::newRow("drive 3") << "p:/" << false;
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
QTest::newRow("unc 1") << uncRoot << true;
QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
@@ -507,18 +501,13 @@ void tst_QFileInfo::exists_data()
QTest::newRow("data8") << (m_resourcesDir + "/*.ext1") << false;
QTest::newRow("data9") << (m_resourcesDir + "/file?.ext1") << false;
QTest::newRow("data10") << "." << true;
-
- // Skip for the WinRT case, as GetFileAttributesEx removes _any_
- // trailing whitespace and "." is a valid entry as seen in data10
-#ifndef Q_OS_WINRT
QTest::newRow("data11") << ". " << false;
-#endif
QTest::newRow("empty") << "" << false;
QTest::newRow("simple dir") << m_resourcesDir << true;
QTest::newRow("simple dir with slash") << (m_resourcesDir + QLatin1Char('/')) << true;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
QTest::newRow("unc 1") << uncRoot << true;
QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
@@ -553,7 +542,7 @@ void tst_QFileInfo::absolutePath_data()
QTest::addColumn<QString>("filename");
QString drivePrefix;
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT))
+#if defined(Q_OS_WIN)
drivePrefix = QDir::currentPath().left(2);
QString nonCurrentDrivePrefix =
drivePrefix.left(1).compare("X", Qt::CaseInsensitive) == 0 ? QString("Y:") : QString("X:");
@@ -563,8 +552,6 @@ void tst_QFileInfo::absolutePath_data()
QTest::newRow("<not current drive>:my.dll") << nonCurrentDrivePrefix + "my.dll"
<< nonCurrentDrivePrefix + "/"
<< "my.dll";
-#elif defined(Q_OS_WINRT)
- drivePrefix = QDir::currentPath().left(2);
#endif
QTest::newRow("0") << "/machine/share/dir1/" << drivePrefix + "/machine/share/dir1" << "";
QTest::newRow("1") << "/machine/share/dir1" << drivePrefix + "/machine/share" << "dir1";
@@ -572,7 +559,7 @@ void tst_QFileInfo::absolutePath_data()
QTest::newRow("3") << "/usr/local/bin/" << drivePrefix + "/usr/local/bin" << "";
QTest::newRow("/test") << "/test" << drivePrefix + "/" << "test";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QTest::newRow("c:\\autoexec.bat") << "c:\\autoexec.bat" << "C:/"
<< "autoexec.bat";
QTest::newRow("c:autoexec.bat") << QDir::currentPath().left(2) + "autoexec.bat" << QDir::currentPath()
@@ -748,7 +735,7 @@ void tst_QFileInfo::canonicalFilePath()
}
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
{
QString errorMessage;
const QString linkTarget = QStringLiteral("res");
@@ -846,7 +833,7 @@ void tst_QFileInfo::dir_data()
QTest::newRow("absFilePath") << QDir::currentPath() + "/tmp.txt" << false << QDir::currentPath();
QTest::newRow("absFilePathAbsPath") << QDir::currentPath() + "/tmp.txt" << true << QDir::currentPath();
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << true << ":/tst_qfileinfo/resources";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QTest::newRow("driveWithSlash") << "C:/file1.ext1.ext2" << true << "C:/";
QTest::newRow("driveWithoutSlash") << QDir::currentPath().left(2) + "file1.ext1.ext2" << false << QDir::currentPath().left(2);
#endif
@@ -1037,7 +1024,7 @@ void tst_QFileInfo::size()
void tst_QFileInfo::systemFiles()
{
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINRT)
+#if !defined(Q_OS_WIN)
QSKIP("This is a Windows only test");
#endif
QFileInfo fi("c:\\pagefile.sys");
@@ -1240,7 +1227,7 @@ void tst_QFileInfo::fileTimes()
QCOMPARE(fileInfo.birthTime(), birthTime); // mustn't have changed
QVERIFY(readTime.isValid());
-#if defined(Q_OS_WINRT) || defined(Q_OS_QNX) || (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED))
+#if defined(Q_OS_QNX) || (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED))
noAccessTime = true;
#elif defined(Q_OS_WIN)
//In Vista the last-access timestamp is not updated when the file is accessed/touched (by default).
@@ -1361,7 +1348,7 @@ void tst_QFileInfo::isShortcut_data()
<< regularFile.fileName() << false;
QTest::newRow("directory")
<< QDir::currentPath() << false;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// windows shortcuts
QVERIFY(regularFile.link("link.lnk"));
QTest::newRow("shortcut")
@@ -1397,7 +1384,6 @@ void tst_QFileInfo::isSymbolicLink_data()
#ifndef Q_NO_SYMLINKS
#if defined(Q_OS_WIN)
-#if !defined(Q_OS_WINRT)
QString errorMessage;
const DWORD creationResult = createSymbolicLink("symlink", m_sourceFile, &errorMessage);
if (creationResult == ERROR_PRIVILEGE_NOT_HELD) {
@@ -1407,7 +1393,6 @@ void tst_QFileInfo::isSymbolicLink_data()
QTest::newRow("NTFS-symlink")
<< "symlink" << true;
}
-#endif // !Q_OS_WINRT
#else // Unix:
QVERIFY(regularFile.link("symlink.lnk"));
QTest::newRow("symlink.lnk")
@@ -1450,7 +1435,7 @@ void tst_QFileInfo::link_data()
file2.open(QIODevice::WriteOnly);
QTest::newRow("existent file") << m_sourceFile << false << false << "";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// windows shortcuts
QVERIFY(file1.link("link.lnk"));
QTest::newRow("link.lnk")
@@ -1463,7 +1448,6 @@ void tst_QFileInfo::link_data()
#ifndef Q_NO_SYMLINKS
#if defined(Q_OS_WIN)
-#if !defined(Q_OS_WINRT)
QString errorMessage;
DWORD creationResult = createSymbolicLink("link", m_sourceFile, &errorMessage);
if (creationResult == ERROR_PRIVILEGE_NOT_HELD) {
@@ -1482,7 +1466,6 @@ void tst_QFileInfo::link_data()
QTest::newRow("broken link")
<< "brokenlink" << false << true << QFileInfo("dummyfile").absoluteFilePath();
}
-#endif // !Q_OS_WINRT
#else // Unix:
QVERIFY(file1.link("link"));
QTest::newRow("link")
@@ -1662,7 +1645,7 @@ void tst_QFileInfo::refresh()
QCOMPARE(info2.size(), info.size());
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
struct NtfsTestResource {
@@ -1872,13 +1855,13 @@ void tst_QFileInfo::isWritable()
QVERIFY(QFileInfo("tempfile.txt").isWritable());
tempfile.remove();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QFileInfo fi("c:\\pagefile.sys");
QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QVERIFY(!fi.isWritable());
#endif
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined (Q_OS_WIN)
QScopedValueRollback<int> ntfsMode(qt_ntfs_permission_lookup);
qt_ntfs_permission_lookup = 1;
QFileInfo fi2(QFile::decodeName(qgetenv("SystemRoot") + "/system.ini"));
@@ -2059,7 +2042,7 @@ void tst_QFileInfo::detachingOperations()
QVERIFY(!info1.caching());
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
bool IsUserAdmin()
{
BOOL b;
@@ -2081,9 +2064,8 @@ bool IsUserAdmin()
return b != FALSE;
}
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
-#ifndef Q_OS_WINRT
void tst_QFileInfo::owner()
{
QString userName;
@@ -2145,7 +2127,6 @@ void tst_QFileInfo::owner()
qt_ntfs_permission_lookup = 0;
#endif
}
-#endif // !Q_OS_WINRT
void tst_QFileInfo::group()
{
diff --git a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
index bac7a69e0f..efdfc071a3 100644
--- a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
+++ b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
@@ -96,7 +96,7 @@ void tst_QFileSelector::basicTest_data()
expectedPlatform2File = QString(":/platforms/test2");
#else
QString distributionName;
-# if (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || defined(Q_OS_FREEBSD) || defined(Q_OS_WINRT)
+# if (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || defined(Q_OS_FREEBSD)
distributionName = QSysInfo::productType();
# endif
foreach (const QString &selector, QFileSelectorPrivate::platformSelectors()) {
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 7d88601e54..4f07581587 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -34,7 +34,7 @@
#include <QElapsedTimer>
#include <QTextStream>
#include <QDir>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
#include <windows.h>
#endif
@@ -82,7 +82,7 @@ private slots:
void signalsEmittedAfterFileMoved();
void watchUnicodeCharacters();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void watchDirectoryAttributeChanges();
#endif
@@ -819,7 +819,7 @@ void tst_QFileSystemWatcher::watchUnicodeCharacters()
QTRY_COMPARE(changedSpy.count(), 1);
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void tst_QFileSystemWatcher::watchDirectoryAttributeChanges()
{
QTemporaryDir temporaryDirectory(m_tempDirPattern);
diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
index da5327594c..10214f2996 100644
--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
@@ -104,9 +104,6 @@ void tst_QIODevice::getSetCheck()
//----------------------------------------------------------------------------------
void tst_QIODevice::constructing_QTcpSocket()
{
-#if defined(Q_OS_WINRT)
- QSKIP("Synchronous socket calls are broken on winrt. See QTBUG-40922");
-#endif
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
@@ -263,9 +260,6 @@ void tst_QIODevice::unget()
buffer.ungetChar('Q');
QCOMPARE(buffer.readLine(buf, 3), qint64(1));
-#if defined(Q_OS_WINRT)
- QSKIP("Synchronous socket calls are broken on winrt. See QTBUG-40922");
-#endif
for (int i = 0; i < 2; ++i) {
QTcpSocket socket;
QIODevice *dev;
diff --git a/tests/auto/corelib/io/qlockfile/CMakeLists.txt b/tests/auto/corelib/io/qlockfile/CMakeLists.txt
index a41c442b58..d422ae9d24 100644
--- a/tests/auto/corelib/io/qlockfile/CMakeLists.txt
+++ b/tests/auto/corelib/io/qlockfile/CMakeLists.txt
@@ -15,7 +15,7 @@ add_qt_test(tst_qlockfile
## Scopes:
#####################################################################
-extend_target(tst_qlockfile CONDITION WIN32 AND NOT WINRT
+extend_target(tst_qlockfile CONDITION WIN32
PUBLIC_LIBRARIES
advapi32
)
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index 1d79d0dd1f..42bdf3eabf 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -35,7 +35,7 @@
#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
#include <unistd.h>
#include <sys/time.h>
-#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#elif defined(Q_OS_WIN)
# include <qt_windows.h>
#endif
@@ -289,7 +289,7 @@ void tst_QLockFile::staleLockFromCrashedProcessReusedPid()
{
#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
-#elif defined(Q_OS_WINRT) || defined(QT_PLATFORM_UIKIT)
+#elif defined(QT_PLATFORM_UIKIT)
QSKIP("We cannot retrieve information about other processes on this platform.");
#else
const QString fileName = dir.path() + "/staleLockFromCrashedProcessReusedPid";
@@ -463,7 +463,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(ProcessProperties)
static inline ProcessProperties processProperties()
{
ProcessProperties result;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
HANDLE processToken = NULL;
if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &processToken)) {
DWORD elevation; // struct containing a DWORD, not present in some MinGW headers.
@@ -492,7 +492,7 @@ void tst_QLockFile::noPermissionsWindows()
{
// Windows: Do the permissions test in a system directory in which
// files cannot be created.
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINRT)
+#if !defined(Q_OS_WIN)
QSKIP("This test is for desktop Windows only");
#endif
#ifdef Q_OS_WIN
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
index e33e22b36f..8ac76b0317 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
@@ -3,4 +3,4 @@ TARGET = tst_qlockfile
SOURCES += tst_qlockfile.cpp
QT = core-private testlib concurrent
-win32:!winrt: QMAKE_USE += advapi32
+win32: QMAKE_USE += advapi32
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index cef03c4591..d5f2da06d2 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -56,9 +56,7 @@
#if defined(Q_OS_WIN)
#include <QtCore/qt_windows.h>
-#ifndef Q_OS_WINRT
-# include <private/qwinregistry_p.h>
-#endif
+#include <private/qwinregistry_p.h>
#else
#include <unistd.h>
#endif
@@ -77,7 +75,7 @@ QT_FORWARD_DECLARE_CLASS(QSettings)
static inline bool canWriteNativeSystemSettings()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
HKEY key;
const LONG result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software", 0, KEY_WRITE, &key);
if (result == ERROR_SUCCESS)
@@ -159,7 +157,7 @@ private slots:
#if !defined(Q_OS_WIN) && !defined(QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER)
void dontReorderIniKeysNeedlessly();
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void consistentRegistryStorage();
#endif
@@ -214,12 +212,7 @@ void tst_QSettings::getSetCheck()
static QString settingsPath(const char *path = nullptr)
{
// Temporary path for files that are specified explicitly in the constructor.
-#ifndef Q_OS_WINRT
static const QString tempPath = QDir::tempPath() + QLatin1String("/tst_QSettings");
-#else
- static const QString tempPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
- + QLatin1String("/tst_QSettings");
-#endif
return path && *path ? tempPath + QLatin1Char('/') + QLatin1String(path) : tempPath;
}
@@ -324,7 +317,7 @@ void tst_QSettings::cleanupTestFiles()
if (settingsDir.exists())
QVERIFY(settingsDir.removeRecursively());
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QSettings("HKEY_CURRENT_USER\\Software\\software.org", QSettings::NativeFormat).clear();
QSettings("HKEY_CURRENT_USER\\Software\\other.software.org", QSettings::NativeFormat).clear();
QSettings("HKEY_CURRENT_USER\\Software\\foo", QSettings::NativeFormat).clear();
@@ -339,7 +332,7 @@ void tst_QSettings::cleanupTestFiles()
QSettings("HKEY_LOCAL_MACHINE\\Software\\bat", QSettings::NativeFormat).clear();
QSettings("HKEY_LOCAL_MACHINE\\Software\\baz", QSettings::NativeFormat).clear();
}
-#elif defined(Q_OS_DARWIN) || defined(Q_OS_WINRT)
+#elif defined(Q_OS_DARWIN)
QSettings(QSettings::UserScope, "software.org", "KillerAPP").clear();
QSettings(QSettings::SystemScope, "software.org", "KillerAPP").clear();
QSettings(QSettings::UserScope, "other.software.org", "KillerAPP").clear();
@@ -352,12 +345,7 @@ void tst_QSettings::cleanupTestFiles()
const QString foo(QLatin1String("foo"));
-#if defined(Q_OS_WINRT)
- QSettings(foo, QSettings::NativeFormat).clear();
- QFile fooFile(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QLatin1Char('/') + foo);
-#else
QFile fooFile(foo);
-#endif
if (fooFile.exists())
QVERIFY2(fooFile.remove(), qPrintable(fooFile.errorString()));
}
@@ -540,7 +528,7 @@ void tst_QSettings::ctor()
} else {
caseSensitive = pathconf(settings5.fileName().toLatin1().constData(), _PC_CASE_SENSITIVE);
}
-#elif defined(Q_OS_WIN32) || defined(Q_OS_WINRT)
+#elif defined(Q_OS_WIN32)
caseSensitive = false;
#endif
if (caseSensitive)
@@ -614,8 +602,8 @@ void tst_QSettings::ctor()
QCoreApplication::instance()->setOrganizationName("");
QCoreApplication::instance()->setApplicationName("");
QSettings settings;
-#if defined(Q_OS_MAC) || defined(Q_OS_WINRT)
- QEXPECT_FAIL("native", "Default settings on Mac/WinRT are valid, despite organization domain, name, and app name being null", Continue);
+#if defined(Q_OS_MAC)
+ QEXPECT_FAIL("native", "Default settings on Mac are valid, despite organization domain, name, and app name being null", Continue);
#endif
QCOMPARE(settings.status(), QSettings::AccessError);
QCoreApplication::instance()->setOrganizationName("software.org");
@@ -629,8 +617,8 @@ void tst_QSettings::ctor()
}
QSettings settings(format, QSettings::UserScope, "", "");
-#if defined(Q_OS_MAC) || defined(Q_OS_WINRT)
- QEXPECT_FAIL("native", "Default settings on Mac/WinRT are valid, despite organization domain, name, and app name being null", Continue);
+#if defined(Q_OS_MAC)
+ QEXPECT_FAIL("native", "Default settings on Mac are valid, despite organization domain, name, and app name being null", Continue);
#endif
QCOMPARE(settings.status(), QSettings::AccessError);
QSettings settings2(format, QSettings::UserScope, "software.org", "KillerAPP");
@@ -1724,14 +1712,9 @@ void tst_QSettings::sync()
// Now "some other app" will change other.software.org.ini
QString userConfDir = settingsPath("__user__") + QDir::separator();
-#if !defined(Q_OS_WINRT)
unlink((userConfDir + "other.software.org.ini").toLatin1());
rename((userConfDir + "software.org.ini").toLatin1(),
(userConfDir + "other.software.org.ini").toLatin1());
-#else
- QFile::remove(userConfDir + "other.software.org.ini");
- QFile::rename(userConfDir + "software.org.ini" , userConfDir + "other.software.org.ini");
-#endif
settings2.sync();
@@ -2265,7 +2248,7 @@ void tst_QSettings::testRegistryShortRootNames()
void tst_QSettings::testRegistry32And64Bit()
{
-#if !defined (Q_OS_WIN) || defined(Q_OS_WINRT)
+#if !defined (Q_OS_WIN)
QSKIP("This test is specific to the Windows registry.", SkipAll);
#else
@@ -2346,7 +2329,7 @@ void tst_QSettings::fromFile()
QString path = "foo";
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
if (format == QSettings::NativeFormat)
path = "\\HKEY_CURRENT_USER\\Software\\foo";
#endif
@@ -3491,7 +3474,7 @@ void tst_QSettings::rainersSyncBugOnMac()
{
QFETCH(QSettings::Format, format);
-#if defined(Q_OS_DARWIN) || defined(Q_OS_WINRT)
+#if defined(Q_OS_DARWIN)
if (format == QSettings::NativeFormat)
QSKIP("Apple OSes do not support direct reads from and writes to .plist files, due to caching and background syncing. See QTBUG-34899.");
#endif
@@ -3526,7 +3509,7 @@ void tst_QSettings::recursionBug()
}
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
static DWORD readKeyType(HKEY handle, QStringView rSubKey)
{
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index d0fbdb7a2a..cba7dfe9fc 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -33,7 +33,7 @@
#include <qfileinfo.h>
#include <qsysinfo.h>
#include <qregularexpression.h>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
# include <qt_windows.h>
#endif
@@ -131,7 +131,7 @@ static const char * const enumNames[MaxStandardLocation + 1 - int(QStandardPaths
void tst_qstandardpaths::initTestCase()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// Disable WOW64 redirection, see testFindExecutable()
if (QSysInfo::buildCpuArchitecture() != QSysInfo::currentCpuArchitecture()) {
void *oldMode;
@@ -140,7 +140,7 @@ void tst_qstandardpaths::initTestCase()
qErrnoWarning("Wow64DisableWow64FsRedirection() failed");
QVERIFY(disabledDisableWow64FsRedirection);
}
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
QVERIFY2(m_localConfigTempDir.isValid(), qPrintable(m_localConfigTempDir.errorString()));
QVERIFY2(m_globalConfigTempDir.isValid(), qPrintable(m_globalConfigTempDir.errorString()));
QVERIFY2(m_localAppTempDir.isValid(), qPrintable(m_localAppTempDir.errorString()));
@@ -308,9 +308,9 @@ void tst_qstandardpaths::testDataLocation()
{
// On all platforms, DataLocation should be GenericDataLocation / organization name / app name
// This allows one app to access the data of another app.
- // Android and WinRT are an exception to this case, owing to the fact that
+ // Android is an exception to this case, owing to the fact that
// applications are sandboxed.
-#if !defined(Q_OS_ANDROID) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_ANDROID)
const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation), base + "/tst_qstandardpaths");
QCoreApplication::instance()->setOrganizationName("Qt");
@@ -339,7 +339,7 @@ void tst_qstandardpaths::testAppConfigLocation()
{
// On all platforms where applications are not sandboxed,
// AppConfigLocation should be GenericConfigLocation / organization name / app name
-#if !defined(Q_OS_ANDROID) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_ANDROID)
const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation), base + "/tst_qstandardpaths");
QCoreApplication::setOrganizationName("Qt");
@@ -381,7 +381,6 @@ void tst_qstandardpaths::testFindExecutable_data()
QTest::addColumn<QString>("needle");
QTest::addColumn<QString>("expected");
#ifdef Q_OS_WIN
-# ifndef Q_OS_WINRT
const QFileInfo cmdFi = QFileInfo(QDir::cleanPath(QString::fromLocal8Bit(qgetenv("COMSPEC"))));
const QString cmdPath = cmdFi.absoluteFilePath();
@@ -406,7 +405,6 @@ void tst_qstandardpaths::testFindExecutable_data()
QTest::newRow("win8-logo-nosuffix")
<< QString() << logo << logoPath;
}
-# endif // Q_OS_WINRT
#else
const QFileInfo shFi = findSh();
Q_ASSERT(shFi.exists());
@@ -448,8 +446,6 @@ void tst_qstandardpaths::testFindExecutable()
void tst_qstandardpaths::testFindExecutableLinkToDirectory()
{
- // WinRT has no link support
-#ifndef Q_OS_WINRT
// link to directory
const QString target = QDir::tempPath() + QDir::separator() + QLatin1String("link.lnk");
QFile::remove(target);
@@ -457,7 +453,6 @@ void tst_qstandardpaths::testFindExecutableLinkToDirectory()
QVERIFY(appFile.link(target));
QVERIFY(QStandardPaths::findExecutable(target).isEmpty());
QFile::remove(target);
-#endif
}
void tst_qstandardpaths::testRuntimeDirectory()
diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
index fe63cecccd..7dd76a2be1 100644
--- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
+++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
@@ -40,14 +40,12 @@ private slots:
void defaultValues();
void dump();
void operatorEqual();
-#ifndef Q_OS_WINRT
void operatorNotEqual();
void root();
void currentStorage();
void storageList();
void tempFile();
void caching();
-#endif
};
void tst_QStorageInfo::defaultValues()
@@ -113,7 +111,6 @@ void tst_QStorageInfo::operatorEqual()
}
}
-#ifndef Q_OS_WINRT
void tst_QStorageInfo::operatorNotEqual()
{
QStorageInfo storage1 = QStorageInfo::root();
@@ -230,7 +227,6 @@ void tst_QStorageInfo::caching()
}
QVERIFY(free != storage2.bytesFree());
}
-#endif
QTEST_MAIN(tst_QStorageInfo)
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
index b4fa0b41fe..40582eba1b 100644
--- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
+++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
@@ -332,7 +332,7 @@ void tst_QTemporaryDir::nonWritableCurrentDir()
void tst_QTemporaryDir::openOnRootDrives()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
unsigned int lastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
// If it's possible to create a file in the root directory, it
@@ -346,7 +346,7 @@ void tst_QTemporaryDir::openOnRootDrives()
QVERIFY(dir.isValid());
}
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
SetErrorMode(lastErrorMode);
#endif
}
diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
index bfa9f1d744..59ded3b0c4 100644
--- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -504,7 +504,7 @@ void tst_QTemporaryFile::resize()
void tst_QTemporaryFile::openOnRootDrives()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
unsigned int lastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
// If it's possible to create a file in the root directory, it
@@ -521,7 +521,7 @@ void tst_QTemporaryFile::openOnRootDrives()
QCOMPARE(fi.absoluteDir(), driveInfo.filePath());
}
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
SetErrorMode(lastErrorMode);
#endif
}
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 5a04d194a5..26b740ae20 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -3169,12 +3169,10 @@ void tst_QUrl::fromUserInputWithCwd_data()
QTest::newRow(QByteArray(fileName) + "-in-dot") << fileName << QStringLiteral(".") << url << url;
}
-#ifndef Q_OS_WINRT // WinRT cannot cd outside current / sandbox
QDir parent(base);
QVERIFY(parent.cdUp());
QUrl parentUrl = QUrl::fromLocalFile(parent.path());
QTest::newRow("dotdot") << ".." << base << parentUrl << parentUrl;
-#endif
QTest::newRow("nonexisting") << "nonexisting" << base << QUrl("http://nonexisting") << QUrl::fromLocalFile(base + "/nonexisting");
QTest::newRow("short-url") << "example.org" << base << QUrl("http://example.org") << QUrl::fromLocalFile(base + "/example.org");