diff options
author | yang-g <yangg@google.com> | 2015-11-25 11:45:33 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-11-25 11:45:33 -0800 |
commit | 52705590e463df5e6b852f15866cdfbfcf902fcb (patch) | |
tree | e9ac30bc757b13d497aa1441947c62b9c3506201 /test | |
parent | a23f17b1233453334ad137a3aeb338c801b5ada4 (diff) |
Add set pointer api to channel_arguments
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/common/channel_arguments_test.cc (renamed from test/cpp/client/channel_arguments_test.cc) | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/cpp/client/channel_arguments_test.cc b/test/cpp/common/channel_arguments_test.cc index 3d75e7b0e6..e010d375cf 100644 --- a/test/cpp/client/channel_arguments_test.cc +++ b/test/cpp/common/channel_arguments_test.cc @@ -115,6 +115,22 @@ TEST_F(ChannelArgumentsTest, SetString) { } } +TEST_F(ChannelArgumentsTest, SetPointer) { + grpc_channel_args args; + ChannelArguments channel_args; + // Empty arguments. + SetChannelArgs(channel_args, &args); + EXPECT_EQ(static_cast<size_t>(0), args.num_args); + + grpc::string key("key0"); + channel_args.SetPointer(key, &key); + SetChannelArgs(channel_args, &args); + EXPECT_EQ(static_cast<size_t>(1), args.num_args); + EXPECT_EQ(GRPC_ARG_POINTER, args.args[0].type); + EXPECT_STREQ("key0", args.args[0].key); + EXPECT_EQ(&key, args.args[0].value.pointer.p); +} + } // namespace testing } // namespace grpc |