aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-09-22 16:10:03 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-09-22 16:10:03 -0700
commit1c9cae1613ef7951382e9f8a372cdb3345212475 (patch)
tree27d3f6efedaf8db61534cc75d838155e7a546c13
parentd3cfb5ee0e72bdc4b0926a5388bb86e8db5e895b (diff)
Add some currently failing tests
-rw-r--r--test/core/iomgr/buffer_pool_test.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/core/iomgr/buffer_pool_test.c b/test/core/iomgr/buffer_pool_test.c
index d28b557f7d..7993d94100 100644
--- a/test/core/iomgr/buffer_pool_test.c
+++ b/test/core/iomgr/buffer_pool_test.c
@@ -71,12 +71,48 @@ static void test_buffer_user_no_op(void) {
destroy_user(&usr);
}
+static void test_instant_alloc_then_free(void) {
+ gpr_log(GPR_INFO, "** test_instant_alloc_then_free **");
+ grpc_buffer_pool *p = grpc_buffer_pool_create();
+ grpc_buffer_user usr;
+ grpc_buffer_user_init(&usr, p);
+ {
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_buffer_user_alloc(&exec_ctx, &usr, 1024, NULL);
+ grpc_exec_ctx_finish(&exec_ctx);
+ }
+ {
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_buffer_user_free(&exec_ctx, &usr, 1024);
+ grpc_exec_ctx_finish(&exec_ctx);
+ }
+ grpc_buffer_pool_unref(p);
+ destroy_user(&usr);
+}
+
+static void test_instant_alloc_free_pair(void) {
+ gpr_log(GPR_INFO, "** test_instant_alloc_free_pair **");
+ grpc_buffer_pool *p = grpc_buffer_pool_create();
+ grpc_buffer_user usr;
+ grpc_buffer_user_init(&usr, p);
+ {
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_buffer_user_alloc(&exec_ctx, &usr, 1024, NULL);
+ grpc_buffer_user_free(&exec_ctx, &usr, 1024);
+ grpc_exec_ctx_finish(&exec_ctx);
+ }
+ grpc_buffer_pool_unref(p);
+ destroy_user(&usr);
+}
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
test_no_op();
test_resize_then_destroy();
test_buffer_user_no_op();
+ test_instant_alloc_then_free();
+ test_instant_alloc_free_pair();
grpc_shutdown();
return 0;
}