diff options
Diffstat (limited to 'tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp')
-rw-r--r-- | tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 8650bc4d1e..4319d8b7f1 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -133,9 +133,7 @@ private slots: void size_data(); void size(); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) void systemFiles(); -#endif void compare_data(); void compare(); @@ -174,10 +172,8 @@ private slots: void isWritable(); void isExecutable(); -#ifdef Q_OS_MAC void testDecomposedUnicodeNames_data(); void testDecomposedUnicodeNames(); -#endif void equalOperator() const; void equalOperatorWithDifferentSlashes() const; @@ -873,16 +869,16 @@ void tst_QFileInfo::size() QTEST(int(fi.size()), "size"); } -// This is a Windows only test. -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) void tst_QFileInfo::systemFiles() { +#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE) + QSKIP("This is a Windows only test"); +#endif QFileInfo fi("c:\\pagefile.sys"); QVERIFY(fi.exists()); // task 167099 QVERIFY(fi.size() > 0); // task 189202 QVERIFY(fi.lastModified().isValid()); } -#endif void tst_QFileInfo::compare_data() { @@ -1487,8 +1483,6 @@ void tst_QFileInfo::isExecutable() } -// This is a OS X only test (unless you know more about filesystems, then maybe you should try it ;) -#ifdef Q_OS_MAC void tst_QFileInfo::testDecomposedUnicodeNames_data() { QTest::addColumn<QString>("filePath"); @@ -1503,21 +1497,32 @@ void tst_QFileInfo::testDecomposedUnicodeNames_data() static void createFileNative(const QString &filePath) { +#ifdef Q_OS_UNIX int fd = open(filePath.normalized(QString::NormalizationForm_D).toUtf8().constData(), O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); if (fd < 0) { QFAIL("couldn't create file"); } else { close(fd); } +#else + Q_UNUSED(filePath); +#endif } static void removeFileNative(const QString &filePath) { +#ifdef Q_OS_UNIX unlink(filePath.normalized(QString::NormalizationForm_D).toUtf8().constData()); +#else + Q_UNUSED(filePath); +#endif } void tst_QFileInfo::testDecomposedUnicodeNames() { +#ifndef Q_OS_MAC + QSKIP("This is a OS X only test (unless you know more about filesystems, then maybe you should try it ;)"); +#endif QFETCH(QString, filePath); createFileNative(filePath); @@ -1526,7 +1531,6 @@ void tst_QFileInfo::testDecomposedUnicodeNames() QTEST(file.exists(), "exists"); removeFileNative(filePath); } -#endif void tst_QFileInfo::equalOperator() const { |