| 61 | |
| 62 | template<typename B = uint8_t> |
| 63 | [[nodiscard]] inline std::vector<B> ConsumeRandomLengthByteVector(FuzzedDataProvider& fuzzed_data_provider, const std::optional<size_t>& max_length = std::nullopt) noexcept |
| 64 | { |
| 65 | static_assert(sizeof(B) == 1); |
| 66 | const std::string s = max_length ? |
| 67 | fuzzed_data_provider.ConsumeRandomLengthString(*max_length) : |
| 68 | fuzzed_data_provider.ConsumeRandomLengthString(); |
| 69 | std::vector<B> ret(s.size()); |
| 70 | std::copy(s.begin(), s.end(), reinterpret_cast<char*>(ret.data())); |
| 71 | return ret; |
| 72 | } |
| 73 | |
| 74 | [[nodiscard]] inline DataStream ConsumeDataStream(FuzzedDataProvider& fuzzed_data_provider, const std::optional<size_t>& max_length = std::nullopt) noexcept |
| 75 | { |
no test coverage detected