diff options
author | Bernd Weimer <bweimer@blackberry.com> | 2014-05-13 10:20:48 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-19 19:33:15 +0200 |
commit | 1ea0d59c4a068b9bddab1a5161cc51f050c4a55d (patch) | |
tree | 0f1e3d8123c70c1f570b6667f06cd8a4f1e19ff8 /tests/auto | |
parent | b8f96418ed625b4acd0f2584d1d9bc065321677c (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')
-rw-r--r-- | tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp | 8 |
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 |