summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qdiriterator
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-02-17 20:09:17 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-22 00:07:31 +0100
commit7bbe79fe5f54ed7542d935600036d3c8b401505f (patch)
treec37504bd357768150ea75b79b947ad570729ca5e /tests/auto/corelib/io/qdiriterator
parent9beeb3030be3e0ab6513164b785fca3ade4c90e9 (diff)
Drop file-engine abstraction from public API
This abstraction imposed serious performance penalties and is being dropped from the public API. In particular, by allowing file names to be arbitrarily hijacked by different file engines, and requiring engines to be instantiated in order to decide, it imposed unnecessary overhead on all file operations. Another flaw in the design with direct impact on performance is how engines have no way to provide (or retain) additional information obtained when querying the filesystem. In many places this has meant repeated operations on the file system, where useful information is immediately discarded to be queried again subsequently. For Qt 4.8 a major refactoring of the code base took place to allow bypassing the file-engine abstraction in select places, with considerable performance gains observed. In Qt 5 it is expected we'll be able to take this further, reaping even more benefits, but the abstraction has to go. [Dropping this now does not preclude that virtual file systems make an appearance in Qt at a later point in Qt 5's lifecycle. Hopefully with a new and improved abstraction.] Forward declarations for QFileExtension(Result) were dropped, as the classes were never used or defined. Tests using "internalized" classes will only fully run on developer builds. QFSFileEngine was removed altogether from exception safety test, as it isn't its intent to test internal API. Change-Id: Ie910e6c2628be202ea9e05366b091d6d529b246b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/corelib/io/qdiriterator')
-rw-r--r--tests/auto/corelib/io/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
index cfb3201c43..ef59fc48e3 100644
--- a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
@@ -1,6 +1,6 @@
CONFIG += testcase parallel_test
TARGET = tst_qdiriterator
-QT = core testlib
+QT = core-private core testlib
SOURCES = tst_qdiriterator.cpp
RESOURCES += qdiriterator.qrc
diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
index d5d490dc29..37d3e1ab68 100644
--- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
@@ -48,6 +48,8 @@
#include <qfileinfo.h>
#include <qstringlist.h>
+#include <QtCore/private/qfsfileengine_p.h>
+
#if defined(Q_OS_VXWORKS)
#define Q_NO_SYMLINKS
#endif
@@ -454,6 +456,7 @@ void tst_QDirIterator::stopLinkLoop()
// The goal of this test is only to ensure that the test above don't malfunction
}
+#ifdef QT_BUILD_INTERNAL
class EngineWithNoIterator : public QFSFileEngine
{
public:
@@ -473,13 +476,18 @@ public:
return new EngineWithNoIterator(fileName);
}
};
+#endif
void tst_QDirIterator::engineWithNoIterator()
{
+#ifdef QT_BUILD_INTERNAL
EngineWithNoIteratorHandler handler;
QDir("entrylist").entryList();
QVERIFY(true); // test that the above line doesn't crash
+#else
+ QSKIP("This test requires -developer-build.");
+#endif
}
void tst_QDirIterator::absoluteFilePathsFromRelativeIteratorPath()