Skip some qsavefile auto tests
Some of the QSaveFile tests are not applicable with root privileges. Change-Id: I1a22906c0b14acf144f1849719152dfe9d79f426 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
6315745770
commit
b8f96418ed
@ -47,9 +47,8 @@
|
|||||||
#include <qdir.h>
|
#include <qdir.h>
|
||||||
#include <qset.h>
|
#include <qset.h>
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
|
||||||
# include <unistd.h> // for geteuid
|
#include <unistd.h> // for geteuid
|
||||||
# include <sys/types.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
@ -199,6 +198,10 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnDir_data()
|
|||||||
void tst_QSaveFile::transactionalWriteNoPermissionsOnDir()
|
void tst_QSaveFile::transactionalWriteNoPermissionsOnDir()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
|
#if !defined(Q_OS_VXWORKS)
|
||||||
|
if (::geteuid() == 0)
|
||||||
|
QSKIP("Test is not applicable with root privileges");
|
||||||
|
#endif
|
||||||
QFETCH(bool, directWriteFallback);
|
QFETCH(bool, directWriteFallback);
|
||||||
QTemporaryDir dir;
|
QTemporaryDir dir;
|
||||||
QVERIFY(dir.isValid());
|
QVERIFY(dir.isValid());
|
||||||
@ -253,6 +256,10 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnDir()
|
|||||||
|
|
||||||
void tst_QSaveFile::transactionalWriteNoPermissionsOnFile()
|
void tst_QSaveFile::transactionalWriteNoPermissionsOnFile()
|
||||||
{
|
{
|
||||||
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
|
||||||
|
if (::geteuid() == 0)
|
||||||
|
QSKIP("Test is not applicable with root privileges");
|
||||||
|
#endif
|
||||||
// Setup an existing but readonly file
|
// Setup an existing but readonly file
|
||||||
QTemporaryDir dir;
|
QTemporaryDir dir;
|
||||||
QVERIFY(dir.isValid());
|
QVERIFY(dir.isValid());
|
||||||
@ -299,6 +306,10 @@ void tst_QSaveFile::transactionalWriteCanceled()
|
|||||||
|
|
||||||
void tst_QSaveFile::transactionalWriteErrorRenaming()
|
void tst_QSaveFile::transactionalWriteErrorRenaming()
|
||||||
{
|
{
|
||||||
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
|
||||||
|
if (::geteuid() == 0)
|
||||||
|
QSKIP("Test is not applicable with root privileges");
|
||||||
|
#endif
|
||||||
QTemporaryDir dir;
|
QTemporaryDir dir;
|
||||||
QVERIFY(dir.isValid());
|
QVERIFY(dir.isValid());
|
||||||
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
|
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
|
||||||
|
Loading…
Reference in New Issue
Block a user