summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2024-01-22 14:36:50 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2024-05-14 12:33:21 +0000
commit6f2ef2eacb927022e89b5e02edcbc8b06954639e (patch)
treeea5ba145b6ae22a2a609226dcc7d7920e6d5ba09
parent392c5fab815cbe41df9e25e50e4d296e7e1606f6 (diff)
QDecompressHelper: update the benchmark
After the zip bomb checks were added the benchmark was not adjusted. Also move the QByteArray creation outside the loop, to not include the time it takes to make a heap allocation. Pick-to: 6.7 6.5 Change-Id: Ia958d497dd27fc61e0084b6f5c11d76886bb24c4 Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--tests/benchmarks/network/access/qdecompresshelper/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/benchmarks/network/access/qdecompresshelper/main.cpp b/tests/benchmarks/network/access/qdecompresshelper/main.cpp
index 09c24af668..7f8b09ef0e 100644
--- a/tests/benchmarks/network/access/qdecompresshelper/main.cpp
+++ b/tests/benchmarks/network/access/qdecompresshelper/main.cpp
@@ -51,13 +51,14 @@ void tst_QDecompressHelper::decompress()
file.seek(0);
QDecompressHelper helper;
helper.setEncoding(encoding);
+ helper.setDecompressedSafetyCheckThreshold(-1);
QVERIFY(helper.isValid());
helper.feed(file.readAll());
qsizetype bytes = 0;
+ QByteArray out(64 * 1024, Qt::Uninitialized);
while (helper.hasData()) {
- QByteArray out(64 * 1024, Qt::Uninitialized);
qsizetype bytesRead = helper.read(out.data(), out.size());
bytes += bytesRead;
}