From 39310a6817ea49f34afa37f43105e86adda64309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Thu, 3 Feb 2022 11:38:40 +0200 Subject: Handle situation when device running test does not have enough RAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI tests for QNX are run in QEMU which does not have enough RAM to run this test successfully. Pick-to: 6.2 6.3 Change-Id: Idab3e8b6a1e0ae3eddf5aedb82e6784a74ae9a3a Reviewed-by: Volker Hilsheimer Reviewed-by: MÃ¥rten Nordheim --- .../network/access/qdecompresshelper/tst_qdecompresshelper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/auto/network/access') diff --git a/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp b/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp index 321d373a78..3177cf02c1 100644 --- a/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp +++ b/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp @@ -443,6 +443,9 @@ void tst_QDecompressHelper::bigZlib() #if QT_POINTER_SIZE < 8 QSKIP("This cannot be tested on 32-bit systems"); #else +#ifndef QT_NO_EXCEPTIONS + try { +#endif // ZLib uses unsigned integers as their size type internally which creates some special // cases in the internal code that should be tested! QFile file(":/5GiB.txt.inflate"); @@ -462,6 +465,11 @@ void tst_QDecompressHelper::bigZlib() QByteArray output(expected + 42, Qt::Uninitialized); const qsizetype size = helper.read(output.data(), output.size()); QCOMPARE(size, expected); +#ifndef QT_NO_EXCEPTIONS + } catch (const std::bad_alloc &) { + QSKIP("Encountered most likely OOM."); + } +#endif #endif } -- cgit v1.2.3