Injected failure in fuzzer target

To test whether black-box fuzzing is working, this change injects an
assertion failure into tint_black_box_fuzzer_target. Once it has been
established that this failure is found by the black box fuzzers, it
should be removed.

Bug: https://crbug.com/1246587
Change-Id: I408bdb116e817879edcec025f644e6f0f6f8bb73
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65340
Auto-Submit: Alastair Donaldson <afdx@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Alastair Donaldson <afdx@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Alastair Donaldson 2021-09-28 17:31:44 +00:00 committed by Tint LUCI CQ
parent 0f1eb1ea3c
commit ac958bd1dd
1 changed files with 5 additions and 1 deletions

View File

@ -97,7 +97,11 @@ int main(int argc, const char** argv) {
if (target_format == "hlsl") {
tint::fuzzers::CommonFuzzer fuzzer(tint::fuzzers::InputFormat::kWGSL,
tint::fuzzers::OutputFormat::kHLSL);
return fuzzer.Run(data.data(), data.size());
int result = fuzzer.Run(data.data(), data.size());
assert(false &&
"Deliberate temporary assertion failure to check that ClusterFuzz "
"black box fuzzer target is working.");
return result;
} else if (target_format == "msl") {
tint::fuzzers::DataBuilder builder(data.data(), data.size());
tint::writer::msl::Options options;