diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@digia.com> | 2013-01-16 17:29:09 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-19 10:35:06 +0100 |
commit | 5ec342fefdb00406d3bf6f3943d4b235b9094cc9 (patch) | |
tree | 0a996b32d88177076d47e3cf9cea87b9df57c809 /tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | |
parent | 7e8cc3b3bacfb28a2096efdce84805cedce6a0d8 (diff) |
Fix QFileInfo autotest for VxWorks.
No users/groups/symlinks on VxWorks.
Change-Id: I524a568202db2478b070b16a63ae425224c3aaa0
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp')
-rw-r--r-- | tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 06f7c35f3a..e9617e5a52 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -55,8 +55,10 @@ #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> +#ifndef Q_OS_VXWORKS #include <pwd.h> #endif +#endif #ifdef Q_OS_WIN #include <qt_windows.h> #include <qlibrary.h> @@ -72,6 +74,10 @@ #include <private/qfileinfo_p.h> #include "../../../../shared/filesystem.h" +#if defined(Q_OS_VXWORKS) +#define Q_NO_SYMLINKS +#endif + QT_BEGIN_NAMESPACE extern Q_AUTOTEST_EXPORT bool qIsLikelyToBeNfs(int /* handle */); QT_END_NAMESPACE @@ -1014,7 +1020,7 @@ void tst_QFileInfo::fileTimes() QEXPECT_FAIL("longfile absolutepath", "No long filenames on WinCE", Abort); #endif QVERIFY(file.open(QFile::WriteOnly | QFile::Text)); -#ifdef Q_OS_UNIX +#ifdef Q_OS_UNIX && !defined(Q_OS_VXWORKS) if (qIsLikelyToBeNfs(file.handle())) QSKIP("This Test doesn't work on NFS"); #endif @@ -1512,7 +1518,7 @@ void tst_QFileInfo::isWritable() #if defined (Q_OS_BLACKBERRY) // The Blackberry filesystem is read-only 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) QVERIFY(QFileInfo("/etc/passwd").isWritable()); else @@ -1711,7 +1717,7 @@ QT_END_NAMESPACE void tst_QFileInfo::owner() { QString userName; -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) { passwd *user = getpwuid(geteuid()); QVERIFY(user); @@ -1774,7 +1780,7 @@ void tst_QFileInfo::owner() void tst_QFileInfo::group() { QString expected; -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) struct group *gr; gid_t gid = getegid(); |