The current switch (fuzzed_data_provider.ConsumeIntegralInRange<int>(0, nn)) { case 0: ... case 1: ... case nn: ...
has several problems:
- It makes it hard to review newly added targets, because it requires manual counting of cases
- It makes it hard to update a target, because updating all case labels is trivial, but tedious to review and causes merge conflicts
Updating the target raises the question whether the case labels should be preserved to not invalidate the existing fuzz inputs format. Fuzz input format might already change implicitly on every commit, so this isn’t something worthwhile to pursue.Edit: This pull doesn’t fix this problem.
Fix all issues by adding a new CallOneOf
helper