summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-02-03 11:38:40 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-09 14:56:09 +0000
commit72d085769d158ed7925225c568d8a2552ca42f48 (patch)
treef3cf0379e0bd00f731c64c4437ded40e1c2da219 /tests
parenta0dabf5e23574de13c96c0262e2f4c0d09e38dab (diff)
Handle situation when device running test does not have enough RAM
CI tests for QNX are run in QEMU which does not have enough RAM to run this test successfully. Change-Id: Idab3e8b6a1e0ae3eddf5aedb82e6784a74ae9a3a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 39310a6817ea49f34afa37f43105e86adda64309) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp8
1 files changed, 8 insertions, 0 deletions
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
}