Convert fuzzer to use TransformBuilder

Missed this fuzzer when implementing this class.

BUG=chromium:1255122

Change-Id: Ic5c7ef031db04a779734faeffa1d72d972dd2254
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65880
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ryan Harrison 2021-10-05 14:51:28 +00:00 committed by Tint LUCI CQ
parent 8b2181c98f
commit add3cb000b
1 changed files with 4 additions and 3 deletions

View File

@ -14,16 +14,17 @@
#include "fuzzers/fuzzer_init.h" #include "fuzzers/fuzzer_init.h"
#include "fuzzers/tint_common_fuzzer.h" #include "fuzzers/tint_common_fuzzer.h"
#include "fuzzers/transform_builder.h"
namespace tint { namespace tint {
namespace fuzzers { namespace fuzzers {
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
transform::Manager transform_manager; TransformBuilder tb(data, size);
transform_manager.Add<transform::Renamer>(); tb.AddTransform<transform::Renamer>();
fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.SetTransformManager(&transform_manager, {}); fuzzer.SetTransformManager(tb.manager(), tb.data_map());
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);
return fuzzer.Run(data, size); return fuzzer.Run(data, size);