diff options
author | Yang Gao <yangg@google.com> | 2015-12-09 12:50:58 -0800 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-12-09 12:50:58 -0800 |
commit | 5b763f5355b8f1b2ee33f73e7fd6dc98972a1bc1 (patch) | |
tree | 91ffe96473376f61c8d8795937f871a2b3489b0a /test/cpp | |
parent | 141272d5de00b0a41e26b2bbea5629a5c79b5ca2 (diff) | |
parent | 017ed62ce4ba277ae3e68ffd41a5a1ee80fb82bf (diff) |
Merge pull request #4362 from vjpai/coverage-serve2
Cover an unsupported case of mixing sync and async service in server
Diffstat (limited to 'test/cpp')
-rw-r--r-- | test/cpp/end2end/async_end2end_test.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 74290c36d2..364aa417cd 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -179,6 +179,17 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<bool> { void SetUp() GRPC_OVERRIDE { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; + + // It is currently unsupported to mix sync and async services + // in the same server, so first test that (for coverage) + ServerBuilder build_bad; + build_bad.AddListeningPort(server_address_.str(), + grpc::InsecureServerCredentials()); + build_bad.RegisterAsyncService(&service_); + grpc::cpp::test::util::TestService::Service sync_service; + build_bad.RegisterService(&sync_service); + GPR_ASSERT(build_bad.BuildAndStart() == nullptr); + // Setup server ServerBuilder builder; builder.AddListeningPort(server_address_.str(), |