summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile/tst_qfile.cpp
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@digia.com>2013-01-17 11:05:52 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 10:35:06 +0100
commit7e8cc3b3bacfb28a2096efdce84805cedce6a0d8 (patch)
tree8fd3f61d8add42cf32caad8d37720122d04c0fa1 /tests/auto/corelib/io/qfile/tst_qfile.cpp
parent10d077fa19d86e35af3a11f770ab0a7bf081263c (diff)
Fix QFile autotest for VxWorks
No users/file permissions. Open function in VxWorks DKM requires always three parameters. Change-Id: I93fb075d82aa57e210e224bfe4ede40def82c275 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto/corelib/io/qfile/tst_qfile.cpp')
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index df7b397481..137b185960 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -80,6 +80,12 @@ QT_END_NAMESPACE
# include <sys/statfs.h>
#elif defined(Q_OS_WINCE)
# include <qplatformdefs.h>
+#elif defined(Q_OS_VXWORKS)
+# include <fcntl.h>
+#if defined(_WRS_KERNEL)
+#undef QT_OPEN
+#define QT_OPEN(path, oflag) ::open(path, oflag, 0)
+#endif
#endif
#include <stdio.h>
@@ -545,7 +551,7 @@ void tst_QFile::open()
QFETCH( bool, ok );
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS)
if (::getuid() == 0)
// root and Chuck Norris don't care for file permissions. Skip.
QSKIP("Running this test as root doesn't make sense");
@@ -2242,7 +2248,7 @@ static QByteArray getLargeDataBlock()
if (array.isNull())
{
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS)
int resizeSize = 1024 * 1024; // WinCE does not have much space
#else
int resizeSize = 64 * 1024 * 1024;
@@ -2432,7 +2438,9 @@ void tst_QFile::rename()
#if defined(Q_OS_UNIX)
if (strcmp(QTest::currentDataTag(), "renamefile -> /etc/renamefile") == 0) {
+#if !defined(Q_OS_VXWORKS)
if (::getuid() == 0)
+#endif
QSKIP("Running this test as root doesn't make sense");
}
#endif
@@ -2941,6 +2949,7 @@ void tst_QFile::map()
file.close();
+#if !defined(Q_OS_VXWORKS)
#if defined(Q_OS_UNIX)
if (::getuid() != 0)
// root always has permissions
@@ -2955,6 +2964,7 @@ void tst_QFile::map()
QVERIFY(!memory);
QVERIFY(file.setPermissions(originalPermissions));
}
+#endif
QVERIFY(file.remove());
}