Skip to content

Commit

Permalink
wasm: qabstractfileengine test fails on wasm/windows
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
EvenOAndersen committed Apr 21, 2024
1 parent 3217c56 commit 9e57e52
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9e57e52

Please sign in to comment.