summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-02-03 11:38:40 +0200
committerPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-02-09 14:17:53 +0000
commit39310a6817ea49f34afa37f43105e86adda64309 (patch)
treea8c6979921b2e53c6cd84c8b16ce46e421f23636 /tests/auto/network/access
parent11fcfd75a0a3b1059c73f87e1e64db800d7a5cff (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. Pick-to: 6.2 6.3 Change-Id: Idab3e8b6a1e0ae3eddf5aedb82e6784a74ae9a3a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/access')
-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
}