summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qlockfile
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2014-05-13 10:20:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-19 19:33:15 +0200
commit1ea0d59c4a068b9bddab1a5161cc51f050c4a55d (patch)
tree0f1e3d8123c70c1f570b6667f06cd8a4f1e19ff8 /tests/auto/corelib/io/qlockfile
parentb8f96418ed625b4acd0f2584d1d9bc065321677c (diff)
Skip tst_QLockFile::noPermissions
QLockFile "noPermissions" test is not applicable with root privileges. Change-Id: I5779da524f24d0f1b9ef519d654856a6200da6bf Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests/auto/corelib/io/qlockfile')
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index fdb29b60d8..bd9e28beb5 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -44,6 +44,9 @@
#include <QtConcurrentRun>
#include <qlockfile.h>
#include <qtemporarydir.h>
+#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
+#include <unistd.h>
+#endif
class tst_QLockFile : public QObject
{
@@ -365,9 +368,12 @@ void tst_QLockFile::staleLockRace()
void tst_QLockFile::noPermissions()
{
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
// A readonly directory still allows us to create files, on Windows.
QSKIP("No permission testing on Windows");
+#elif defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
+ if (::geteuid() == 0)
+ QSKIP("Test is not applicable with root privileges");
#endif
// Restore permissions so that the QTemporaryDir cleanup can happen
class PermissionRestorer