aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-11-18 16:34:17 +0100
committerGitHub Enterprise <[email protected]>2025-11-18 16:34:17 +0100
commit2f9b8b2000b71650ff5a2b72dae3a5312e670465 (patch)
treec58814f89b7cddc94db237f630b018e4d7982733 /src/zencore/include
parentretain xmake state between runs (#656) (diff)
downloadzen-2f9b8b2000b71650ff5a2b72dae3a5312e670465.tar.xz
zen-2f9b8b2000b71650ff5a2b72dae3a5312e670465.zip
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
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/testutils.h15
1 files changed, 15 insertions, 0 deletions
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;