Fixed qstandardpaths unittest to handle being run as root
- testCustomRuntimeDirectory test skips if run as root Change-Id: Idcc2a1db5d8a96b2ec0248b8b1c392fffc0b2e11 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This commit is contained in:
parent
951c0b7afa
commit
805d895978
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user