Go to the documentation of this file.
24 #include <gtest/gtest.h>
39 #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
40 #include "src/proto/grpc/testing/echo.grpc.pb.h"
44 using grpc::testing::EchoRequest;
45 using grpc::testing::EchoResponse;
49 "To be, or not to be- that is the question:"
50 "Whether 'tis nobler in the mind to suffer"
51 "The slings and arrows of outrageous fortune"
52 "Or to take arms against a sea of troubles,"
53 "And by opposing end them. To die- to sleep-"
54 "No more; and by a sleep to say we end"
55 "The heartache, and the thousand natural shock"
56 "That flesh is heir to. 'Tis a consummation"
57 "Devoutly to be wish'd. To die- to sleep."
58 "To sleep- perchance to dream: ay, there's the rub!"
59 "For in that sleep of death what dreams may come"
60 "When we have shuffled off this mortal coil,"
61 "Must give us pause. There's the respect"
62 "That makes calamity of so long life."
63 "For who would bear the whips and scorns of time,"
64 "Th' oppressor's wrong, the proud man's contumely,"
65 "The pangs of despis'd love, the law's delay,"
66 "The insolence of office, and the spurns"
67 "That patient merit of th' unworthy takes,"
68 "When he himself might his quietus make"
69 "With a bare bodkin? Who would these fardels bear,"
70 "To grunt and sweat under a weary life,"
71 "But that the dread of something after death-"
72 "The undiscover'd country, from whose bourn"
73 "No traveller returns- puzzles the will,"
74 "And makes us rather bear those ills we have"
75 "Than fly to others that we know not of?"
76 "Thus conscience does make cowards of us all,"
77 "And thus the native hue of resolution"
78 "Is sicklied o'er with the pale cast of thought,"
79 "And enterprises of great pith and moment"
80 "With this regard their currents turn awry"
81 "And lose the name of action.- Soft you now!"
82 "The fair Ophelia!- Nymph, in thy orisons"
83 "Be all my sins rememb'red.";
88 class TestServiceImpl :
public grpc::testing::EchoTestService::Service {
96 struct timespec tv = {0, 1000000};
116 std::bind(&TestServiceImpl::BidiStream_Sender,
stream, &should_exit));
119 struct timespec tv = {0, 3000000};
150 stub_ = grpc::testing::EchoTestService::NewStub(
channel);
153 std::unique_ptr<grpc::testing::EchoTestService::Stub>
stub_;
166 TEST_F(End2endTest, StreamingThroughput) {
174 for (
int i = 0;
i < 10000;
i++) {
189 int main(
int argc,
char** argv) {
std::unique_ptr< grpc::testing::EchoTestService::Stub > stub_
std::unique_ptr< grpc::testing::EchoTestService::Stub > stub_
int nanosleep(const struct timespec *req, struct timespec *rem)
TestMultipleServiceImpl< grpc::testing::EchoTestService::Service > TestServiceImpl
int main(int argc, char **argv)
wrapped_grpc_channel * channel
A builder class for the creation and startup of grpc::Server instances.
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
#define gpr_atm_acq_load(p)
#define gpr_atm_rel_store(p, value)
static const Status & OK
An OK pre-defined instance.
std::shared_ptr< Channel > CreateChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
int grpc_pick_unused_port_or_die(void)
std::ostringstream server_address_
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
TEST_F(ChannelArgumentsTest, SetInt)
static void BidiStream_Sender(ServerReaderWriter< EchoResponse, EchoRequest > *stream, gpr_atm *should_exit)
#define ASSERT_TRUE(condition)
const char * server_address_
Status BidiStream(ServerContext *, ServerReaderWriter< EchoResponse, EchoRequest > *stream) override
const char * kLargeString
std::unique_ptr< Server > server_
static void Drainer(ClientReaderWriter< EchoRequest, EchoResponse > *reader)
std::shared_ptr< ServerCredentials > InsecureServerCredentials()
grpc::ClientContext context
std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()
Credentials for an unencrypted, unauthenticated channel.
static uv_thread_t thread
std::unique_ptr< grpc::testing::TestServiceImpl > service_
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:20