|
|
@ -34,22 +34,21 @@ namespace testing { |
|
|
|
/// test mode rather than letting it follow the normal paths.
|
|
|
|
/// test mode rather than letting it follow the normal paths.
|
|
|
|
class DefaultReactorTestPeer { |
|
|
|
class DefaultReactorTestPeer { |
|
|
|
public: |
|
|
|
public: |
|
|
|
explicit DefaultReactorTestPeer(experimental::CallbackServerContext* ctx) |
|
|
|
explicit DefaultReactorTestPeer(CallbackServerContext* ctx) |
|
|
|
: DefaultReactorTestPeer(ctx, [](::grpc::Status) {}) {} |
|
|
|
: DefaultReactorTestPeer(ctx, [](Status) {}) {} |
|
|
|
DefaultReactorTestPeer(experimental::CallbackServerContext* ctx, |
|
|
|
DefaultReactorTestPeer(CallbackServerContext* ctx, |
|
|
|
std::function<void(::grpc::Status)> finish_func) |
|
|
|
std::function<void(Status)> finish_func) |
|
|
|
: ctx_(ctx) { |
|
|
|
: ctx_(ctx) { |
|
|
|
ctx->SetupTestDefaultReactor(std::move(finish_func)); |
|
|
|
ctx->SetupTestDefaultReactor(std::move(finish_func)); |
|
|
|
} |
|
|
|
} |
|
|
|
::grpc::experimental::ServerUnaryReactor* reactor() const { |
|
|
|
ServerUnaryReactor* reactor() const { |
|
|
|
return reinterpret_cast<experimental::ServerUnaryReactor*>( |
|
|
|
return reinterpret_cast<ServerUnaryReactor*>(&ctx_->default_reactor_); |
|
|
|
&ctx_->default_reactor_); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
bool test_status_set() const { return ctx_->test_status_set(); } |
|
|
|
bool test_status_set() const { return ctx_->test_status_set(); } |
|
|
|
Status test_status() const { return ctx_->test_status(); } |
|
|
|
Status test_status() const { return ctx_->test_status(); } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
experimental::CallbackServerContext* const ctx_; // not owned
|
|
|
|
CallbackServerContext* const ctx_; // not owned
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
} // namespace testing
|
|
|
|
} // namespace testing
|
|
|
|