summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/largefile/tst_largefile.cpp
diff options
context:
space:
mode:
authorMichał Łoś <michal.los@siili.com>2024-05-10 18:14:34 +0200
committerMichał Łoś <michal.los@siili.com>2024-05-16 14:04:41 +0200
commit7678edebba7e93ce648714cd6849023e2880813f (patch)
tree5c9e6083fa8c3900003450e70b90c7e8d267ca71 /tests/auto/corelib/io/largefile/tst_largefile.cpp
parent88cb405514270a320d2993e8fb1c7b7b62646112 (diff)
Limit size of large files test for VxWorks
VxWorks doesn't allow mapping file beyond EOF, adjust tests to encompass that. Additionally, for testing on VxWorks we use use builtin /tmp which is a RAM disk (in case of VxWorks-supported imx.6 bord which have 1GB of RAM), set max size of tested large file to 256MB, 28 bits. Pick-to: 6.7 Task-number: QTBUG-115777 Change-Id: I73cbe112331b7cb95d80bb44b792578a1eb88a07 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/largefile/tst_largefile.cpp')
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index 6fa3569c4f..f5af3bde63 100644
--- a/tests/auto/corelib/io/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -46,6 +46,10 @@ 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)
@@ -494,6 +498,7 @@ void tst_LargeFile::mapFile()
// 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 {
@@ -506,6 +511,9 @@ void tst_LargeFile::mapOffsetOverflow()
#elif (defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)) && (Q_PROCESSOR_WORDSIZE == 4)
Succeeds = true,
MaxOffset = sizeof(QT_OFF_T) > 4 ? 43 : 30
+#elif defined(Q_OS_VXWORKS)
+ Succeeds = false,
+ MaxOffset = 8 * sizeof(QT_OFF_T) - 1
#else
Succeeds = true,
MaxOffset = 8 * sizeof(QT_OFF_T) - 1