From 805d8959787ba03a35436e1235648d01bdfd91c7 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Thu, 9 Feb 2012 11:27:15 +1000 Subject: Fixed qstandardpaths unittest to handle being run as root - testCustomRuntimeDirectory test skips if run as root Change-Id: Idcc2a1db5d8a96b2ec0248b8b1c392fffc0b2e11 Reviewed-by: Jason McDonald --- tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/corelib/io') diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 1e288e2418..ebfd640dfb 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -229,6 +229,11 @@ void tst_qstandardpaths::testRuntimeDirectory() void tst_qstandardpaths::testCustomRuntimeDirectory() { +#if defined(Q_OS_UNIX) + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); +#endif + #ifdef Q_XDG_PLATFORM qputenv("XDG_RUNTIME_DIR", QFile::encodeName("/tmp")); // It's very unlikely that /tmp is 0600 or that we can chmod it -- cgit v1.2.3