summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdir
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-07-21 11:19:49 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-07-21 11:20:03 (GMT)
commit31e358f2290c145b839fc5b7b277922c1ab6e19b (patch)
tree6569829854abd6c2011f740c3d91f6fe9e890836 /tests/auto/qdir
parent2db22b1b12cc7579d08a83ad889efe7f8f07c843 (diff)
downloadQt-31e358f2290c145b839fc5b7b277922c1ab6e19b.zip
Qt-31e358f2290c145b839fc5b7b277922c1ab6e19b.tar.gz
Qt-31e358f2290c145b839fc5b7b277922c1ab6e19b.tar.bz2
fix tests for QT_NO_PROCESS and when running tests as root
Diffstat (limited to 'tests/auto/qdir')
-rw-r--r--tests/auto/qdir/tst_qdir.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index 1fd5e88..e5b23ab 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -571,10 +571,21 @@ void tst_QDir::entryList()
return;
}
- for (int i=0; i<max; ++i)
- QCOMPARE(actual[i], expected[i]);
+ bool doContentCheck = true;
+#ifdef Q_OS_UNIX
+ if (qstrcmp(QTest::currentDataTag(), "QDir::AllEntries | QDir::Writable") == 0) {
+ // for root, everything is writeable
+ if (::getuid() == 0)
+ doContentCheck = false;
+ }
+#endif
- QCOMPARE(actual.count(), expected.count());
+ if (doContentCheck) {
+ for (int i=0; i<max; ++i)
+ QCOMPARE(actual[i], expected[i]);
+
+ QCOMPARE(actual.count(), expected.count());
+ }
QFile::remove(SRCDIR "entrylist/writable");
QFile::remove(SRCDIR "entrylist/linktofile");