diff options
author | vjpai <vpai@google.com> | 2015-12-09 10:42:54 -0800 |
---|---|---|
committer | vjpai <vpai@google.com> | 2015-12-09 10:42:54 -0800 |
commit | 017ed62ce4ba277ae3e68ffd41a5a1ee80fb82bf (patch) | |
tree | a0a1ad241e12274b620e2c45759d06957ac3f490 /test/cpp | |
parent | eec13dc4de1023ed4cf3046f074ed2ed40d865a4 (diff) |
Cover an unsupported case of mixing sync and async service in same 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(), |