#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel.h"
-#include "test/core/util/memory_counters.h"
#include "test/core/util/mock_endpoint.h"
bool squelch = true;
bool leak_check = true;
-static void discard_write(grpc_slice slice) {}
+static void discard_write(grpc_slice /*slice*/) {}
static void* tag(int n) { return (void*)static_cast<uintptr_t>(n); }
-static void dont_log(gpr_log_func_args* args) {}
+static void dont_log(gpr_log_func_args* /*args*/) {}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
grpc_test_only_set_slice_hash_seed(0);
- struct grpc_memory_counters counters;
if (squelch) gpr_set_log_function(dont_log);
- if (leak_check) grpc_memory_counters_init();
grpc_init();
{
grpc_core::ExecCtx exec_ctx;
mock_endpoint, grpc_slice_from_copied_buffer((const char*)data, size));
grpc_event ev;
- while (1) {
+ while (true) {
grpc_core::ExecCtx::Get()->Flush();
ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME),
nullptr);
}
}
grpc_shutdown();
- if (leak_check) {
- counters = grpc_memory_counters_snapshot();
- grpc_memory_counters_destroy();
- GPR_ASSERT(counters.total_size_relative == 0);
- }
return 0;
}