diff options
-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 }; |