Fix QFileInfo autotest for VxWorks.
No users/groups/symlinks on VxWorks. Change-Id: I524a568202db2478b070b16a63ae425224c3aaa0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
parent
7e8cc3b3ba
commit
5ec342fefd
@ -55,8 +55,10 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#ifndef Q_OS_VXWORKS
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <qt_windows.h>
|
#include <qt_windows.h>
|
||||||
#include <qlibrary.h>
|
#include <qlibrary.h>
|
||||||
@ -72,6 +74,10 @@
|
|||||||
#include <private/qfileinfo_p.h>
|
#include <private/qfileinfo_p.h>
|
||||||
#include "../../../../shared/filesystem.h"
|
#include "../../../../shared/filesystem.h"
|
||||||
|
|
||||||
|
#if defined(Q_OS_VXWORKS)
|
||||||
|
#define Q_NO_SYMLINKS
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
extern Q_AUTOTEST_EXPORT bool qIsLikelyToBeNfs(int /* handle */);
|
extern Q_AUTOTEST_EXPORT bool qIsLikelyToBeNfs(int /* handle */);
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
@ -1014,7 +1020,7 @@ void tst_QFileInfo::fileTimes()
|
|||||||
QEXPECT_FAIL("longfile absolutepath", "No long filenames on WinCE", Abort);
|
QEXPECT_FAIL("longfile absolutepath", "No long filenames on WinCE", Abort);
|
||||||
#endif
|
#endif
|
||||||
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
|
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX && !defined(Q_OS_VXWORKS)
|
||||||
if (qIsLikelyToBeNfs(file.handle()))
|
if (qIsLikelyToBeNfs(file.handle()))
|
||||||
QSKIP("This Test doesn't work on NFS");
|
QSKIP("This Test doesn't work on NFS");
|
||||||
#endif
|
#endif
|
||||||
@ -1512,7 +1518,7 @@ void tst_QFileInfo::isWritable()
|
|||||||
#if defined (Q_OS_BLACKBERRY)
|
#if defined (Q_OS_BLACKBERRY)
|
||||||
// The Blackberry filesystem is read-only
|
// The Blackberry filesystem is read-only
|
||||||
QVERIFY(!QFileInfo("/etc/passwd").isWritable());
|
QVERIFY(!QFileInfo("/etc/passwd").isWritable());
|
||||||
#elif defined (Q_OS_UNIX)
|
#elif defined (Q_OS_UNIX) && !defined(Q_OS_VXWORKS) // VxWorks does not have users/groups
|
||||||
if (::getuid() == 0)
|
if (::getuid() == 0)
|
||||||
QVERIFY(QFileInfo("/etc/passwd").isWritable());
|
QVERIFY(QFileInfo("/etc/passwd").isWritable());
|
||||||
else
|
else
|
||||||
@ -1711,7 +1717,7 @@ QT_END_NAMESPACE
|
|||||||
void tst_QFileInfo::owner()
|
void tst_QFileInfo::owner()
|
||||||
{
|
{
|
||||||
QString userName;
|
QString userName;
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
|
||||||
{
|
{
|
||||||
passwd *user = getpwuid(geteuid());
|
passwd *user = getpwuid(geteuid());
|
||||||
QVERIFY(user);
|
QVERIFY(user);
|
||||||
@ -1774,7 +1780,7 @@ void tst_QFileInfo::owner()
|
|||||||
void tst_QFileInfo::group()
|
void tst_QFileInfo::group()
|
||||||
{
|
{
|
||||||
QString expected;
|
QString expected;
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
|
||||||
struct group *gr;
|
struct group *gr;
|
||||||
gid_t gid = getegid();
|
gid_t gid = getegid();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user