summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qdecompresshelper
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/access/qdecompresshelper')
-rw-r--r--tests/auto/network/access/qdecompresshelper/CMakeLists.txt16
-rw-r--r--tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp15
2 files changed, 20 insertions, 11 deletions
diff --git a/tests/auto/network/access/qdecompresshelper/CMakeLists.txt b/tests/auto/network/access/qdecompresshelper/CMakeLists.txt
index 49fd91db0a..09317ca3eb 100644
--- a/tests/auto/network/access/qdecompresshelper/CMakeLists.txt
+++ b/tests/auto/network/access/qdecompresshelper/CMakeLists.txt
@@ -1,9 +1,16 @@
-# Generated from qdecompresshelper.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qdecompresshelper Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qdecompresshelper LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qdecompresshelper
SOURCES
gzip.rcc.cpp
@@ -11,10 +18,7 @@ qt_internal_add_test(tst_qdecompresshelper
tst_qdecompresshelper.cpp
zstandard.rcc.cpp
DEFINES
- SRC_DIR=${CMAKE_CURRENT_SOURCE_DIR} # special case
- PUBLIC_LIBRARIES
+ SRC_DIR=${CMAKE_CURRENT_SOURCE_DIR}
+ LIBRARIES
Qt::NetworkPrivate
)
-
-#### Keys ignored in scope 1:.:.:qdecompresshelper.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp b/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp
index 43248a99dc..cd5a52c209 100644
--- a/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp
+++ b/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -319,6 +319,9 @@ void tst_QDecompressHelper::countAheadPartialRead()
void tst_QDecompressHelper::decompressBigData_data()
{
+#if defined(QT_ASAN_ENABLED)
+ QSKIP("Tests are too slow with asan enabled");
+#endif
QTest::addColumn<QByteArray>("encoding");
QTest::addColumn<QString>("path");
QTest::addColumn<qint64>("size");
@@ -420,10 +423,12 @@ void tst_QDecompressHelper::bigZlib()
{
#if QT_POINTER_SIZE < 8
QSKIP("This cannot be tested on 32-bit systems");
+#elif defined(QT_ASAN_ENABLED)
+ QSKIP("Test is too slow with asan enabled");
#else
-#ifndef QT_NO_EXCEPTIONS
+# ifndef QT_NO_EXCEPTIONS
try {
-#endif
+# 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");
@@ -443,11 +448,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
+# ifndef QT_NO_EXCEPTIONS
} catch (const std::bad_alloc &) {
QSKIP("Encountered most likely OOM.");
}
-#endif
+# endif
#endif
}