|
|
|
@ -86,21 +86,21 @@ class PollOverride { |
|
|
|
|
grpc_poll_function_type prev_; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class PollingCheckRegion : public PollOverride { |
|
|
|
|
class PollingOverrider : public PollOverride { |
|
|
|
|
public: |
|
|
|
|
explicit PollingCheckRegion(bool allow_blocking) |
|
|
|
|
explicit PollingOverrider(bool allow_blocking) |
|
|
|
|
: PollOverride(allow_blocking ? poll : assert_non_blocking_poll) {} |
|
|
|
|
}; |
|
|
|
|
#else |
|
|
|
|
class PollingCheckRegion { |
|
|
|
|
class PollingOverrider { |
|
|
|
|
public: |
|
|
|
|
explicit PollingCheckRegion(bool allow_blocking) {} |
|
|
|
|
explicit PollingOverrider(bool allow_blocking) {} |
|
|
|
|
}; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
class Verifier : public PollingCheckRegion { |
|
|
|
|
class Verifier { |
|
|
|
|
public: |
|
|
|
|
explicit Verifier(bool spin) : PollingCheckRegion(!spin), spin_(spin) {} |
|
|
|
|
explicit Verifier(bool spin) : spin_(spin) {} |
|
|
|
|
Verifier& Expect(int i, bool expect_ok) { |
|
|
|
|
expectations_[tag(i)] = expect_ok; |
|
|
|
|
return *this; |
|
|
|
@ -180,7 +180,7 @@ class Verifier : public PollingCheckRegion { |
|
|
|
|
|
|
|
|
|
class AsyncEnd2endTest : public ::testing::TestWithParam<bool> { |
|
|
|
|
protected: |
|
|
|
|
AsyncEnd2endTest() {} |
|
|
|
|
AsyncEnd2endTest(): poll_override_(GetParam()) {} |
|
|
|
|
|
|
|
|
|
void SetUp() GRPC_OVERRIDE { |
|
|
|
|
int port = grpc_pick_unused_port_or_die(); |
|
|
|
@ -249,6 +249,8 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<bool> { |
|
|
|
|
std::unique_ptr<Server> server_; |
|
|
|
|
grpc::testing::EchoTestService::AsyncService service_; |
|
|
|
|
std::ostringstream server_address_; |
|
|
|
|
|
|
|
|
|
PollingOverrider poll_override_; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
TEST_P(AsyncEnd2endTest, SimpleRpc) { |
|
|
|
|