MCPcopy Create free account
hub / github.com/ada-url/ada / simple_fuzz

Function simple_fuzz

tests/basic_fuzzer.cpp:86–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85template <class result>
86size_t simple_fuzz(size_t N, size_t seed = 0) {
87 size_t counter = seed;
88 for (size_t trial = 0; trial < N; trial++) {
89 std::string copy =
90 url_examples[(seed++) % (sizeof(url_examples) / sizeof(std::string))];
91 auto url = ada::parse<result>(copy);
92 while (url) {
93 // mutate the string.
94 copy[(13134 * counter++) % copy.size()] = char(counter++ * 71117);
95 url = ada_parse<result>(copy);
96 }
97 }
98 return counter;
99}
100
101template <class result>
102size_t roller_fuzz(size_t N) {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected