diff options
author | Even Oscar Andersen <even.oscar.andersen@qt.io> | 2024-02-09 11:45:06 +0100 |
---|---|---|
committer | Even Oscar Andersen <even.oscar.andersen@qt.io> | 2024-03-16 10:35:13 +0100 |
commit | 49329ae2272f488949653f5e06b3f2d82e924261 (patch) | |
tree | 2fbd769d9ba73e125a4503c80ce1708511529aa3 | |
parent | b72158daf502e1f7f0d8c585df6923b4d958cb94 (diff) |
wasm: Add corelib/io/largefile
The test does not run just like that it is necessary to:
set maxSizeBits to 28
mapOffsetOverflow: Settings copied from Linux
Change-Id: Idc276a7e2d777a9a6ad0c0e90d729fb4646a38b6
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r-- | tests/auto/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/corelib/io/largefile/tst_largefile.cpp | 15 |
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 73b249d5d1..9a590cf93c 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -57,6 +57,7 @@ if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS) endif() if(WASM) + add_subdirectory(corelib/io/largefile) add_subdirectory(corelib/io/qdataurl) add_subdirectory(corelib/io/qbuffer) add_subdirectory(corelib/io/qabstractfileengine) diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index 6fcd78cf8e..6fa3569c4f 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -46,6 +46,8 @@ 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_WASM) + maxSizeBits = 28; // 256 MiB #elif defined(QT_LARGEFILE_SUPPORT) maxSizeBits = 36; // 64 GiB #else @@ -491,19 +493,22 @@ 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 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 +#else + Succeeds = true, MaxOffset = 8 * sizeof(QT_OFF_T) - 1 -# endif #endif }; |