From f9f10857354a0775730595ce1e7a435b62bd1bf9 Mon Sep 17 00:00:00 2001 From: Dimitrios Apostolou Date: Fri, 8 Apr 2022 21:48:09 +0200 Subject: [PATCH] Skip test that fails with Address Sanitizer enabled These particular testcases request huge buffers from malloc() .This is intentional and the test expects malloc() to return NULL. Address sanitizer catches this and considers it a problem. Could also be skipped in runtime by setting the environment variable: ASAN_OPTIONS=allocator_may_return_null=1 Task-number: QTBUG-89400 Change-Id: Id3a9b586be9c0bad4a007e1731f2bc1a879cc76e Reviewed-by: Thiago Macieira --- .../qcborstreamreader/tst_qcborstreamreader.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp b/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp index 8d0b5a054e..6253c2fcef 100644 --- a/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp +++ b/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp @@ -957,6 +957,13 @@ void tst_QCborStreamReader::hugeDeviceValidation() if (!useDevice) return; +#if (defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)) + if ( qstrcmp(QTest::currentDataTag(), "bytearray-just-too-big") == 0 + || qstrcmp(QTest::currentDataTag(), "string-just-too-big") == 0) + QSKIP("This test tries to allocate a huge memory buffer," + " which Address Sanitizer flags as a problem"); +#endif + QFETCH(QSharedPointer, device); QFETCH(CborError, expectedError); QFETCH(CborError, expectedValidationError);