18#include "pw_allocator/allocator.h"
19#include "pw_allocator/test_harness.h"
20#include "pw_fuzzer/fuzztest.h"
22namespace pw::allocator::test {
32fuzzer::Domain<Request> ArbitraryRequest(
size_t max_size);
43template <
size_t kMaxRequests,
size_t kMaxSize>
44auto ArbitraryRequests() {
45 return fuzzer::VectorOf<kMaxRequests>(ArbitraryRequest(kMaxSize));
82template <
size_t kIndex,
typename... Args>
83Request MakeRequest(Args... args) {
84 if constexpr (kIndex == 0) {
85 return AllocationRequest{
static_cast<size_t>(args)...};
87 if constexpr (kIndex == 1) {
88 return DeallocationRequest{
static_cast<size_t>(args)...};
90 if constexpr (kIndex == 2) {
91 return ReallocationRequest{
static_cast<size_t>(args)...};
96inline constexpr size_t kMaxRequests = 256;
97inline constexpr size_t kMaxSize = 2048;
99inline auto DefaultArbitraryRequests() {
100 return pw::allocator::test::ArbitraryRequests<kMaxRequests, kMaxSize>();