aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-04-12 02:11:10 +0200
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-04-12 02:11:10 +0200
commit839cdb51d5521b2792d04a351d864d9c35ab7511 (patch)
treefd40e373b1cc2a3a65b63d73c994f9d1730d77b8 /test/core
parentfd998eb33fb13d3c804504fd85fe316e1e28d599 (diff)
Adding memory checks for server fuzzer.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/end2end/fuzzers/server_fuzzer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c
index 393d33033b..c82df42ebf 100644
--- a/test/core/end2end/fuzzers/server_fuzzer.c
+++ b/test/core/end2end/fuzzers/server_fuzzer.c
@@ -35,6 +35,7 @@
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/surface/server.h"
+#include "test/core/util/memory_counters.h"
#include "test/core/util/mock_endpoint.h"
static const bool squelch = true;
@@ -48,8 +49,10 @@ static void dont_log(gpr_log_func_args *args) {}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_test_only_set_metadata_hash_seed(0);
+ struct grpc_memory_counters counters;
if (squelch) gpr_set_log_function(dont_log);
grpc_init();
+ grpc_memory_counters_init();
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_endpoint *mock_endpoint = grpc_mock_endpoint_create(discard_write);
@@ -116,6 +119,9 @@ done:
}
grpc_server_destroy(server);
grpc_completion_queue_destroy(cq);
+ counters = grpc_memory_counters_snapshot();
+ grpc_memory_counters_destroy();
grpc_shutdown();
+ GPR_ASSERT(counters.total_size_relative == 0);
return 0;
}