aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/channel
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-10-13 17:26:26 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-10-13 17:26:26 -0700
commitde3daf5d630fdd4396ed37b59d9550d5665b1e58 (patch)
tree11e9d9061f1739de16341636118c209ffdfb5336 /test/core/channel
parenta4f708a4c4af88e114209eb29f625c4d4d935bb4 (diff)
More interfaces for grpc_socket_mutator
Diffstat (limited to 'test/core/channel')
-rw-r--r--test/core/channel/channel_args_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/core/channel/channel_args_test.c b/test/core/channel/channel_args_test.c
index 8ef1bff22e..d3eb969f09 100644
--- a/test/core/channel/channel_args_test.c
+++ b/test/core/channel/channel_args_test.c
@@ -134,12 +134,26 @@ static void test_compression_algorithm_states(void) {
grpc_channel_args_destroy(ch_args);
}
+static void test_set_socket_mutator(void) {
+ grpc_channel_args *ch_args;
+ grpc_socket_mutator mutator;
+ grpc_socket_mutator_init(&mutator, NULL);
+
+ ch_args = grpc_channel_args_set_socket_mutator(NULL, &mutator);
+ GPR_ASSERT(ch_args->num_args == 1);
+ GPR_ASSERT(strcmp(ch_args->args[0].key, GRPC_ARG_SOCKET_MUTATOR) == 0);
+ GPR_ASSERT(ch_args->args[0].type == GRPC_ARG_POINTER);
+
+ grpc_channel_args_destroy(ch_args);
+}
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
test_create();
test_set_compression_algorithm();
test_compression_algorithm_states();
+ test_set_socket_mutator();
grpc_shutdown();
return 0;
}