summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
}