diff options
author | Rafael Roquetto <rafael.roquetto.qnx@kdab.com> | 2013-05-30 14:55:22 -0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-07 22:18:42 +0200 |
commit | d4dba8a5c414bfdd7cbec6e6ee133f04604b2d2c (patch) | |
tree | 5a52c1cb3b6343033c15c1475fa183e67d412540 | |
parent | 528fd2149ecdc921bf0af91de9dd3262498c9121 (diff) |
Unix: fix tst_QFile when run as root
Because tests are usually run as root on some setups, it does not
make sense to test for the right permissions of a readonly file.
Change-Id: I484f88722d3a9ce7123edc0fb57acae528fa194e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | tests/auto/corelib/io/qfile/tst_qfile.cpp | 7 |
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 cca4655f58..42dca7fc66 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1193,6 +1193,13 @@ void tst_QFile::permissions() if (qt_ntfs_permission_lookup) QEXPECT_FAIL("readonly", "QTBUG-25630", Abort); #endif +#ifdef Q_OS_UNIX + if (strcmp(QTest::currentDataTag(), "readonly") == 0) { + // in case accidentally run as root + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); + } +#endif QCOMPARE((memberResult == QFile::Permissions(perms)), expected); QCOMPARE((staticResult == QFile::Permissions(perms)), expected); } |