Expand unit tests for fuzzer::Merger
authorMarco Vanotti <mvanotti@google.com>
Fri, 12 Feb 2021 19:13:49 +0000 (11:13 -0800)
committerMarco Vanotti <mvanotti@google.com>
Fri, 12 Feb 2021 19:18:34 +0000 (11:18 -0800)
commit0fe4701e515333556920aecc845feb2cc70e116c
tree63502c7fe29e4c74450a82f8dd9f93d67df6b90f
parentaa4e466caa8b8451ea8b1d3356da69158428cb3a
Expand unit tests for fuzzer::Merger

This change adds additional unit tests for fuzzer::Merger::Parse and fuzzer::Merger::Merge in anticipation of additional changes to the merge control file format to support cross-process fuzzing.

It modifies the parameter handling of Merge slightly in order to make NewFeatures and NewCov consistent with NewFiles; namely, Merge *replaces* the contents of these output parameters rather than accumulating them (thereby fixing a buggy return value).

This is change 1 of (at least) 18 for cross-process fuzzing support.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D94506
compiler-rt/lib/fuzzer/FuzzerFork.cpp
compiler-rt/lib/fuzzer/FuzzerMerge.cpp
compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp