Change injected failure from assert to abort

An assertion failure had been injected to check that black box fuzzing
is working, but as ClusterFuzz runs a release mode build this was not
triggering. This change turns the assertion failure into an abort. Once
it has been established that the abort is triggered by the black box
fuzzers, it should be removed.

Bug: https://crbug.com/1246587
Change-Id: I5afcea97132e5a7f13df4ba353121deccc901e60
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65901
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Alastair Donaldson <afdx@google.com>
This commit is contained in:
Alastair Donaldson 2021-10-05 14:49:17 +00:00 committed by Tint LUCI CQ
parent 22daca166b
commit 8b2181c98f
1 changed files with 5 additions and 3 deletions

View File

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