From 9e57e523d3e1de2164ac1dec52bfc527043a6076 Mon Sep 17 00:00:00 2001 From: Even Oscar Andersen Date: Mon, 15 Apr 2024 16:43:37 +0200 Subject: [PATCH] wasm: qabstractfileengine test fails on wasm/windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test assumes either windows or unix line endings, however wasm can run on either system, causing problem with git config core.autocrlf=true Fix the test so that on wasm we correct filesize if necessary Change-Id: Ieb86c5388aa931d8ca06822e1c09a2c55801de67 Reviewed-by: Morten Johan Sørvig --- .../io/qabstractfileengine/tst_qabstractfileengine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp index a2747f55a78..cf00c1525c5 100644 --- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp +++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp @@ -621,12 +621,12 @@ void tst_QAbstractFileEngine::fileIO() * the original size + the '\r' characters added by autocrlf. */ QFile::OpenMode openMode = QIODevice::ReadOnly | QIODevice::Unbuffered; -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined(Q_OS_WASM) openMode |= QIODevice::Text; #endif QVERIFY(file.open(openMode)); QVERIFY(file.isOpen()); -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) || defined(Q_OS_WASM) const qint64 convertedSize = fileSize + readContent.count('\n'); if (file.size() == convertedSize) fileSize = convertedSize;