MCPcopy Create free account
hub / github.com/ElementsProject/elements / ConsumeRandomLengthStringVector

Function ConsumeRandomLengthStringVector

src/test/fuzz/util.h:121–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121[[nodiscard]] inline std::vector<std::string> ConsumeRandomLengthStringVector(FuzzedDataProvider& fuzzed_data_provider, const size_t max_vector_size = 16, const size_t max_string_length = 16) noexcept
122{
123 const size_t n_elements = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, max_vector_size);
124 std::vector<std::string> r;
125 for (size_t i = 0; i < n_elements; ++i) {
126 r.push_back(fuzzed_data_provider.ConsumeRandomLengthString(max_string_length));
127 }
128 return r;
129}
130
131template <typename T>
132[[nodiscard]] inline std::vector<T> ConsumeRandomLengthIntegralVector(FuzzedDataProvider& fuzzed_data_provider, const size_t max_vector_size = 16) noexcept

Callers 4

FUZZ_TARGET_INITFunction · 0.85
FUZZ_TARGET_INITFunction · 0.85
FUZZ_TARGETFunction · 0.85
FUZZ_TARGET_INITFunction · 0.85

Calls 2

push_backMethod · 0.45

Tested by

no test coverage detected