diff options
author | 2017-11-28 13:23:36 -0800 | |
---|---|---|
committer | 2017-11-28 13:23:36 -0800 | |
commit | 81fc8c9c336fab7a71b448f748a32d680301277c (patch) | |
tree | 5cd64fd191db0f87d59ef53768c1b6760b4f1654 /test/core/util/one_corpus_entry_fuzzer.cc | |
parent | 3285f4c7329bf4305133be74f88dd4b10d5e2052 (diff) |
Fix tests to call grpc_init and grpc_shutdown before using exec_ctx
Diffstat (limited to 'test/core/util/one_corpus_entry_fuzzer.cc')
-rw-r--r-- | test/core/util/one_corpus_entry_fuzzer.cc | 10 |
1 files changed, 10 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..fc75125a9b 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,17 @@ 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 */ + grpc_core::ExecCtx::GlobalInit(); 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::GlobalShutdown(); + grpc_core::ExecCtx::GlobalInit(); grpc_slice_unref(buffer); + grpc_core::ExecCtx::GlobalShutdown(); return 0; } |