| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <fidl/test/emptystruct/cpp/fidl.h> |
| |
| #include "lib/fidl/cpp/fuzzing/traits.h" |
| #include "lib/fidl/cpp/internal/header.h" |
| // For ::std::max_element(). |
| #include <algorithm> |
| // For uint64_t. |
| #include <stdint.h> |
| |
| namespace fuzzing { |
| |
| using Empty = ::fidl::test::emptystruct::Empty; |
| |
| template <> |
| struct MinSize<Empty> { |
| operator size_t() { return MinSize<uint8_t>(); } |
| }; |
| template <> |
| struct Allocate<Empty> { |
| Empty operator()(FuzzInput* src, size_t* size) { |
| ZX_ASSERT(*size >= MinSize<Empty>()); |
| Empty out; |
| const size_t slack_per_member = (*size - MinSize<Empty>()) / 1; |
| size_t out_size; |
| out_size = MinSize<uint8_t>() + slack_per_member; |
| out.__reserved = Allocate<uint8_t>{}(src, &out_size); |
| return out; |
| } |
| }; |
| |
| } // namespace fuzzing |