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