24 #include <gtest/gtest.h>
32 #include "src/proto/grpc/testing/echo.grpc.pb.h"
40 #if GRPC_ALLOW_EXCEPTIONS
41 class ExceptingServiceImpl :
public grpc::testing::EchoTestService::Service {
44 EchoResponse* )
override {
49 EchoResponse* )
override {
50 throw ServiceException();
54 class ServiceException final :
public std::exception {
59 const char* what()
const noexcept
override {
return kErrorMessage; }
67 void SetUp()
override {
73 void TearDown()
override {
server_->Shutdown(); }
81 std::unique_ptr<grpc::testing::EchoTestService::Stub>
stub_;
82 std::unique_ptr<Server>
server_;
92 for (
int i = 0;
i < 10;
i++) {
100 TEST_F(ExceptionTest, RequestStream) {
104 for (
int i = 0;
i < 10;
i++) {
115 #endif // GRPC_ALLOW_EXCEPTIONS
120 int main(
int argc,
char** argv) {