From 5ec342fefdb00406d3bf6f3943d4b235b9094cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 16 Jan 2013 17:29:09 +0200 Subject: [PATCH] Fix QFileInfo autotest for VxWorks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No users/groups/symlinks on VxWorks. Change-Id: I524a568202db2478b070b16a63ae425224c3aaa0 Reviewed-by: Samuel Rødal --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 14 ++++++++++---- 1 file 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 #include #include +#ifndef Q_OS_VXWORKS #include #endif +#endif #ifdef Q_OS_WIN #include #include @@ -72,6 +74,10 @@ #include #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();