Skip to content
Welcome to the new CppUtils documentation!

Builder for configuring and registering a randomized fuzz test.

Template parameterDescription
IsSkippedIndicates whether the test execution is bypassed.
using CppUtils::UnitTest::TestSuite::FuzzTestBuilder<IsSkipped>::Base = TestBuilderBase<FuzzTestBuilder<IsSkipped>, IsSkipped>;
std::size_t testIterations;

Number of randomized iterations to execute.

std::uint64_t testSeed {Math::DeterministicRandomEngine::defaultSeed};

Deterministic pseudo-random number generator initial seed.

FuzzTestBuilder::FuzzTestBuilder(TestSuite& suite, std::string name, std::size_t iterations, std::uint64_t seed = Math::DeterministicRandomEngine::defaultSeed, std::chrono::seconds timeout = std::chrono::seconds{10}, std::string skipReason = {});
template <bool Condition>
[[nodiscard]] auto FuzzTestBuilder::rebind(std::string message) -> FuzzTestBuilder<Condition>;
auto FuzzTestBuilder::seed(std::uint64_t newSeed) -> FuzzTestBuilder&;

Sets the deterministic initial pseudo-random number generator seed for fuzz reproducibility.

ParameterDescription
newSeedSeed value.

Returns: Reference to this builder.

auto FuzzTestBuilder::operator=(auto&& function) -> void;

Registers the fuzz test callback executed for the configured iteration count.

ParameterDescription
functionInvocable accepting a DeterministicRandomEngine&.