summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEven Oscar Andersen <even.oscar.andersen@qt.io>2024-04-15 16:43:37 +0200
committerEven Oscar Andersen <even.oscar.andersen@qt.io>2024-04-21 20:52:40 +0200
commit9e57e523d3e1de2164ac1dec52bfc527043a6076 (patch)
tree5ef92e347193af0c7796e1994ec2b3aafcdea91d
parent3217c563a4bee339cdadc325c7ed96a4b89b63f0 (diff)
wasm: qabstractfileengine test fails on wasm/windows
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 <morten.sorvig@qt.io>
-rw-r--r--tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp4
1 files 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 a2747f55a7..cf00c1525c 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;