Skip to content
Snippets Groups Projects
Commit 657ab449 authored by Vijay Pai's avatar Vijay Pai
Browse files

Make single-argument constructor explicit

parent efbeb750
No related branches found
No related tags found
No related merge requests found
...@@ -536,9 +536,9 @@ TEST_P(ClientCallbackEnd2endTest, RequestEchoServerCancel) { ...@@ -536,9 +536,9 @@ TEST_P(ClientCallbackEnd2endTest, RequestEchoServerCancel) {
struct ClientCancelInfo { struct ClientCancelInfo {
bool cancel{false}; bool cancel{false};
int ops_before_cancel; int ops_before_cancel;
ClientCancelInfo() : cancel{false} {} ClientCancelInfo() : cancel{false} {}
// Allow the single-op version to be non-explicit for ease of use explicit ClientCancelInfo(int ops) : cancel{true}, ops_before_cancel{ops} {}
ClientCancelInfo(int ops) : cancel{true}, ops_before_cancel{ops} {}
}; };
class WriteClient : public grpc::experimental::ClientWriteReactor<EchoRequest> { class WriteClient : public grpc::experimental::ClientWriteReactor<EchoRequest> {
...@@ -651,7 +651,7 @@ TEST_P(ClientCallbackEnd2endTest, RequestStream) { ...@@ -651,7 +651,7 @@ TEST_P(ClientCallbackEnd2endTest, RequestStream) {
TEST_P(ClientCallbackEnd2endTest, ClientCancelsRequestStream) { TEST_P(ClientCallbackEnd2endTest, ClientCancelsRequestStream) {
MAYBE_SKIP_TEST; MAYBE_SKIP_TEST;
ResetStub(); ResetStub();
WriteClient test{stub_.get(), DO_NOT_CANCEL, 3, {2}}; WriteClient test{stub_.get(), DO_NOT_CANCEL, 3, ClientCancelInfo{2}};
test.Await(); test.Await();
// Make sure that the server interceptors got the cancel // Make sure that the server interceptors got the cancel
if (GetParam().use_interceptors) { if (GetParam().use_interceptors) {
...@@ -869,7 +869,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStream) { ...@@ -869,7 +869,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStream) {
TEST_P(ClientCallbackEnd2endTest, ClientCancelsResponseStream) { TEST_P(ClientCallbackEnd2endTest, ClientCancelsResponseStream) {
MAYBE_SKIP_TEST; MAYBE_SKIP_TEST;
ResetStub(); ResetStub();
ReadClient test{stub_.get(), DO_NOT_CANCEL, 2}; ReadClient test{stub_.get(), DO_NOT_CANCEL, ClientCancelInfo{2}};
test.Await(); test.Await();
// Because cancel in this case races with server finish, we can't be sure that // Because cancel in this case races with server finish, we can't be sure that
// server interceptors even see cancellation // server interceptors even see cancellation
...@@ -1052,7 +1052,7 @@ TEST_P(ClientCallbackEnd2endTest, ClientCancelsBidiStream) { ...@@ -1052,7 +1052,7 @@ TEST_P(ClientCallbackEnd2endTest, ClientCancelsBidiStream) {
MAYBE_SKIP_TEST; MAYBE_SKIP_TEST;
ResetStub(); ResetStub();
BidiClient test{stub_.get(), DO_NOT_CANCEL, BidiClient test{stub_.get(), DO_NOT_CANCEL,
kServerDefaultResponseStreamsToSend, 2}; kServerDefaultResponseStreamsToSend, ClientCancelInfo{2}};
test.Await(); test.Await();
// Make sure that the server interceptors were notified of a cancel // Make sure that the server interceptors were notified of a cancel
if (GetParam().use_interceptors) { if (GetParam().use_interceptors) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment