summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdir/tst_qdir.cpp
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-10-11 14:35:58 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-10-12 12:59:01 (GMT)
commit75016a4a3bb2ae536a3a813f0ef410b1a0c83742 (patch)
tree2ad95a2a8febedcd040d0399ce8aa59accac3b06 /tests/auto/qdir/tst_qdir.cpp
parent4f9b25ffa8025702c82a32538b82d15acf03303b (diff)
downloadQt-75016a4a3bb2ae536a3a813f0ef410b1a0c83742.zip
Qt-75016a4a3bb2ae536a3a813f0ef410b1a0c83742.tar.gz
Qt-75016a4a3bb2ae536a3a813f0ef410b1a0c83742.tar.bz2
Add test to test QDir caching behavior.
Also fix the qfileenginemodel test to be less fragile Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'tests/auto/qdir/tst_qdir.cpp')
-rw-r--r--tests/auto/qdir/tst_qdir.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index 2bb0a3e..d540f29 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -175,6 +175,8 @@ private slots:
void detachingOperations();
+ void testCaching();
+
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
void isRoot_data();
void isRoot();
@@ -1663,6 +1665,17 @@ void tst_QDir::detachingOperations()
QCOMPARE(dir1.sorting(), sorting);
}
+void tst_QDir::testCaching()
+{
+ QString dirName = QString::fromLatin1("testCaching");
+ QDir::current().rmdir(dirName); // cleanup a previous run.
+ QDir dir(dirName);
+ QVERIFY(!dir.exists());
+ QDir::current().mkdir(dirName);
+ QVERIFY(QDir(dirName).exists()); // dir exists
+ QVERIFY(dir.exists()); // QDir doesn't cache the 'exist' between calls.
+}
+
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
void tst_QDir::isRoot_data()
{