Fix grpc_tool_test

reviewable/pr17308/r1
yang-g 6 years ago
parent 1885964823
commit 47e5771181
  1. 14
      test/cpp/util/grpc_tool_test.cc

@ -258,14 +258,6 @@ class GrpcToolTest : public ::testing::Test {
void ShutdownServer() { server_->Shutdown(); }
void ExitWhenError(int argc, const char** argv, const CliCredentials& cred,
GrpcToolOutputCallback callback) {
int result = GrpcToolMainLib(argc, argv, cred, callback);
if (result) {
exit(result);
}
}
std::unique_ptr<Server> server_;
TestServiceImpl service_;
reflection::ProtoServerReflectionPlugin plugin_;
@ -418,11 +410,9 @@ TEST_F(GrpcToolTest, TypeNotFound) {
const char* argv[] = {"grpc_cli", "type", server_address.c_str(),
"grpc.testing.DummyRequest"};
EXPECT_DEATH(ExitWhenError(ArraySize(argv), argv, TestCliCredentials(),
EXPECT_TRUE(1 == GrpcToolMainLib(ArraySize(argv), argv, TestCliCredentials(),
std::bind(PrintStream, &output_stream,
std::placeholders::_1)),
".*Type grpc.testing.DummyRequest not found.*");
std::placeholders::_1)));
ShutdownServer();
}

Loading…
Cancel
Save