From 5c3cfd2eebc2cc8a11bf2b00f24e84a67a559b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81o=C5=9B?= Date: Fri, 10 May 2024 18:14:34 +0200 Subject: [PATCH] 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. Task-number: QTBUG-115777 Change-Id: I73cbe112331b7cb95d80bb44b792578a1eb88a07 Reviewed-by: Thiago Macieira (cherry picked from commit 7678edebba7e93ce648714cd6849023e2880813f) --- tests/auto/corelib/io/largefile/tst_largefile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index 6fcd78cf8ef..647f8f7d55d 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(QT_LARGEFILE_SUPPORT) maxSizeBits = 36; // 64 GiB #else @@ -491,12 +495,16 @@ 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 +//VxWorks: memory-mapping beyond EOF is not allowed void tst_LargeFile::mapOffsetOverflow() { enum { #ifdef Q_OS_WIN Succeeds = false, MaxOffset = 63 +#elif defined(Q_OS_VXWORKS) + Succeeds = false, + MaxOffset = 8 * sizeof(QT_OFF_T) - 1 #else Succeeds = true, # if (defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)) && Q_PROCESSOR_WORDSIZE == 4