summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/largefile/tst_largefile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/io/largefile/tst_largefile.cpp')
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index b09d6b6f50..f5af3bde63 100644
--- a/tests/auto/corelib/io/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -46,6 +46,12 @@ public:
// This means that files are limited to 2 GB − 1 bytes.
// Limit max size to 256MB
maxSizeBits = 28; // 256 MiB
+ #elif defined(Q_OS_VXWORKS)
+ // VxWorks doesn't support sparse files, also, default /tmp directory is a RAM-disk which
+ // limits its capacity.
+ maxSizeBits = 28; // 256 MiB
+ #elif defined (Q_OS_WASM)
+ maxSizeBits = 28; // 256 MiB
#elif defined(QT_LARGEFILE_SUPPORT)
maxSizeBits = 36; // 64 GiB
#else
@@ -491,19 +497,26 @@ void tst_LargeFile::mapFile()
//Linux: memory-mapping beyond EOF usually succeeds, but depends on the filesystem
// 32-bit: limited to 44-bit offsets (when sizeof(off_t) == 8)
//Windows: memory-mapping beyond EOF is not allowed
+//wasm: as for linux
+//VxWorks: memory-mapping beyond EOF is not allowed
void tst_LargeFile::mapOffsetOverflow()
{
enum {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
Succeeds = false,
MaxOffset = 63
-#else
+#elif defined(Q_OS_WASM)
+ Succeeds = true,
+ MaxOffset = sizeof(QT_OFF_T) > 4 ? 43 : 30
+#elif (defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)) && (Q_PROCESSOR_WORDSIZE == 4)
Succeeds = true,
-# if (defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)) && Q_PROCESSOR_WORDSIZE == 4
MaxOffset = sizeof(QT_OFF_T) > 4 ? 43 : 30
-# else
+#elif defined(Q_OS_VXWORKS)
+ Succeeds = false,
+ MaxOffset = 8 * sizeof(QT_OFF_T) - 1
+#else
+ Succeeds = true,
MaxOffset = 8 * sizeof(QT_OFF_T) - 1
-# endif
#endif
};