summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2012-02-09 10:36:08 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-09 06:53:00 +0100
commit7f403f368eac8a0ebba83a1c30e83ff0a3963acb (patch)
tree628cbf75d4461473de3edf17fee551a0bcf09eab /tests
parent2ba0700ebffabb6d89595724ef7efe5baf230928 (diff)
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 67a4f71f54..0ed1b8ed5a 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -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);