aboutsummaryrefslogtreecommitdiff
path: root/third_party/libprotobuf-mutator/test_fuzzer/test_fuzzer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libprotobuf-mutator/test_fuzzer/test_fuzzer.cc')
-rw-r--r--third_party/libprotobuf-mutator/test_fuzzer/test_fuzzer.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/third_party/libprotobuf-mutator/test_fuzzer/test_fuzzer.cc b/third_party/libprotobuf-mutator/test_fuzzer/test_fuzzer.cc
new file mode 100644
index 00000000..e7af5346
--- /dev/null
+++ b/third_party/libprotobuf-mutator/test_fuzzer/test_fuzzer.cc
@@ -0,0 +1,16 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Test fuzzer that when built successfully proves that fuzzable_proto_library
+// is working. Building this fuzzer without using fuzzable_proto_library will
+// fail because of test_fuzzer_input.proto
+
+#include <iostream>
+
+#include "third_party/libprotobuf-mutator/src/src/libfuzzer/libfuzzer_macro.h"
+#include "third_party/libprotobuf-mutator/test_fuzzer/test_fuzzer_input.pb.h"
+
+DEFINE_PROTO_FUZZER(const lpm_test_fuzzer::TestFuzzerInput& input) {
+ std::cout << input.imported().imported_publicly().input() << std::endl;
+}