diff options
Diffstat (limited to 'tests/auto/corelib/io/qfile')
-rw-r--r-- | tests/auto/corelib/io/qfile/test/test.pro | 2 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfile/tst_qfile.cpp | 18 |
2 files changed, 15 insertions, 5 deletions
diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index 2611ff39bd..dab5e4a3a5 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -1,5 +1,5 @@ CONFIG += testcase -QT = core network testlib +QT = core-private core network testlib TARGET = ../tst_qfile SOURCES = ../tst_qfile.cpp RESOURCES += ../qfile.qrc ../rename-fallback.qrc ../copy-fallback.qrc diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index d1a0debf4d..87d2cf83f7 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -42,13 +42,15 @@ #include <QtTest/QtTest> #include <qplatformdefs.h> -#include <QAbstractFileEngine> -#include <QFSFileEngine> #include <QCoreApplication> #include <QDebug> #include <QDir> #include <QFile> #include <QFileInfo> + +#include <private/qabstractfileengine_p.h> +#include <private/qfsfileengine_p.h> + #if !defined(Q_OS_WINCE) #include <QHostInfo> #endif @@ -70,7 +72,6 @@ # include <sys/statfs.h> #elif defined(Q_OS_WINCE) # include <qplatformdefs.h> -# include <private/qfsfileengine_p.h> #endif #include <stdio.h> @@ -1943,6 +1944,7 @@ void tst_QFile::longFileName() QVERIFY(QFile::remove(newName)); } +#ifdef QT_BUILD_INTERNAL class MyEngine : public QAbstractFileEngine { public: @@ -1998,6 +2000,7 @@ public: return new MyEngine(2); } }; +#endif void tst_QFile::fileEngineHandler() { @@ -2006,6 +2009,7 @@ void tst_QFile::fileEngineHandler() QFile file("ole.bull"); QCOMPARE(file.size(), qint64(0)); +#ifdef QT_BUILD_INTERNAL // Instantiating our handler will enable the new engine. MyHandler handler; file.setFileName("ole.bull"); @@ -2015,9 +2019,10 @@ void tst_QFile::fileEngineHandler() MyHandler2 handler2; file.setFileName("ole.bull"); QCOMPARE(file.size(), qint64(125)); - +#endif } +#ifdef QT_BUILD_INTERNAL class MyRecursiveHandler : public QAbstractFileEngineHandler { public: @@ -2032,13 +2037,18 @@ public: return 0; } }; +#endif void tst_QFile::useQFileInAFileHandler() { +#ifdef QT_BUILD_INTERNAL // This test should not dead-lock MyRecursiveHandler handler; QFile file(":!tst_qfile.cpp"); QVERIFY(file.exists()); +#else + QSKIP("This test requires -developer-build."); +#endif } void tst_QFile::getCharFF() |