From 1ea0d59c4a068b9bddab1a5161cc51f050c4a55d Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Tue, 13 May 2014 10:20:48 +0200 Subject: Skip tst_QLockFile::noPermissions QLockFile "noPermissions" test is not applicable with root privileges. Change-Id: I5779da524f24d0f1b9ef519d654856a6200da6bf Reviewed-by: David Faure --- tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') 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 #include #include +#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) +#include +#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 -- cgit v1.2.3