aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util/one_corpus_entry_fuzzer.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-12-06 09:47:54 -0800
committerGravatar GitHub <noreply@github.com>2017-12-06 09:47:54 -0800
commit8cf1470a51ea276ca84825e7495d4ee24743540d (patch)
tree72385cc865094115bc08cb813201d48cb09840bb /test/core/util/one_corpus_entry_fuzzer.cc
parent1d4e99508409be052bd129ba507bae1fbe7eb7fa (diff)
Revert "Revert "All instances of exec_ctx being passed around in src/core removed""
Diffstat (limited to 'test/core/util/one_corpus_entry_fuzzer.cc')
-rw-r--r--test/core/util/one_corpus_entry_fuzzer.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/core/util/one_corpus_entry_fuzzer.cc b/test/core/util/one_corpus_entry_fuzzer.cc
index c0b67da1e2..c745eb5dc6 100644
--- a/test/core/util/one_corpus_entry_fuzzer.cc
+++ b/test/core/util/one_corpus_entry_fuzzer.cc
@@ -18,7 +18,10 @@
#include <stdbool.h>
+#include <grpc/grpc.h>
+
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/load_file.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
@@ -30,10 +33,15 @@ int main(int argc, char** argv) {
grpc_slice buffer;
squelch = false;
leak_check = false;
+ /* TODO(yashkt) Calling grpc_init breaks tests. Fix the tests and replace
+ * grpc_core::ExecCtx::GlobalInit with grpc_init and GlobalShutdown with
+ * grpc_shutdown */
GPR_ASSERT(
GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer)));
LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer),
GRPC_SLICE_LENGTH(buffer));
+ grpc_core::ExecCtx::GlobalInit();
grpc_slice_unref(buffer);
+ grpc_core::ExecCtx::GlobalShutdown();
return 0;
}