1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 22:07:36 +00:00

LibTest: Add the RandomnessSource abstraction

This will be a foundational part of bootstrapping generators: this is
the way they'll get prerecorded values from / record random values into
RandomRuns. (Generators don't get in contact with RandomRuns
themselves, they just interact with the RandomnessSource.)
This commit is contained in:
Martin Janiczek 2023-10-24 00:35:15 +02:00 committed by Andrew Kaster
parent d4e4189a34
commit 7e5a3650fe
5 changed files with 91 additions and 0 deletions

View file

@ -11,6 +11,7 @@
#include <AK/CheckedFormatString.h>
#include <AK/Math.h>
#include <LibTest/CrashTest.h>
#include <LibTest/Randomized/RandomnessSource.h>
#include <LibTest/TestResult.h>
namespace AK {
@ -22,6 +23,9 @@ namespace Test {
// Declare helpers so that we can call them from VERIFY in included headers
// the setter for TestResult is already declared in TestResult.h
TestResult current_test_result();
Randomized::RandomnessSource& randomness_source();
void set_randomness_source(Randomized::RandomnessSource);
}
#define EXPECT_EQ(a, b) \