Fixed qfile unittest rename() failing as root
When run as root was able to move file to /etc directory but was expecting a failure. Change-Id: Ic2ac5506253f2a3395ed56e88a856542bf82ad6d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This commit is contained in:
parent
2ba0700ebf
commit
7f403f368e
@ -2349,6 +2349,13 @@ void tst_QFile::rename()
|
||||
QFETCH(QString, destination);
|
||||
QFETCH(bool, result);
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
if (strcmp(QTest::currentDataTag(), "renamefile -> /etc/renamefile") == 0) {
|
||||
if (::getuid() == 0)
|
||||
QSKIP("Running this test as root doesn't make sense");
|
||||
}
|
||||
#endif
|
||||
|
||||
QFile::remove("renamedfile");
|
||||
QFile f("renamefile");
|
||||
f.open(QFile::WriteOnly);
|
||||
|
Loading…
Reference in New Issue
Block a user