From 2f9b8b2000b71650ff5a2b72dae3a5312e670465 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 18 Nov 2025 16:34:17 +0100 Subject: loose chunk filtering bug when using wildcards (#654) * fix filtering of loose chunks when downloading with a filter add tests * changelog * move InlineRemoveUnusedHashes * remove extra braces --- src/zencore/include/zencore/testutils.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/zencore/include') diff --git a/src/zencore/include/zencore/testutils.h b/src/zencore/include/zencore/testutils.h index 45fde4eda..e2a4f8346 100644 --- a/src/zencore/include/zencore/testutils.h +++ b/src/zencore/include/zencore/testutils.h @@ -35,6 +35,21 @@ struct ScopedCurrentDirectoryChange IoBuffer CreateRandomBlob(uint64_t Size); IoBuffer CreateSemiRandomBlob(uint64_t Size); +struct FastRandom +{ + uint64_t Seed = 0x7CEBF54E45B9F5D1; + inline uint64_t Next() + { + uint64_t z = (Seed += UINT64_C(0x9E3779B97F4A7C15)); + z = (z ^ (z >> 30)) * UINT64_C(0xBF58476D1CE4E5B9); + z = (z ^ (z >> 27)) * UINT64_C(0x94D049BB133111EB); + return z ^ (z >> 31); + } +}; + +IoBuffer CreateRandomBlob(FastRandom& Random, uint64_t Size); +IoBuffer CreateSemiRandomBlob(FastRandom& Random, uint64_t Size); + struct FalseType { static const bool Enabled = false; -- cgit v1.2.3