diff options
author | Yang Gao <yangg@google.com> | 2015-03-17 15:49:26 -0700 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-03-17 15:49:26 -0700 |
commit | 757afaeb3072a3f3d30d2054ce1a53af168c48ce (patch) | |
tree | 84f72ff9e6eb20ba56d50ef1f7c41a7c05ea33d9 | |
parent | d672d8fbe22e414ca6fee0f279c4550ea927988c (diff) |
clang-format new changes
-rw-r--r-- | include/grpc++/completion_queue.h | 13 | ||||
-rw-r--r-- | test/cpp/end2end/async_end2end_test.cc | 26 |
2 files changed, 18 insertions, 21 deletions
diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 8a36b09a7f..d98a8bbd5f 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -77,19 +77,18 @@ class CompletionQueue { ~CompletionQueue(); // Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT - enum NextStatus {SHUTDOWN, GOT_EVENT, TIMEOUT}; + enum NextStatus { SHUTDOWN, GOT_EVENT, TIMEOUT }; // Nonblocking (until deadline) read from queue. // Cannot rely on result of tag or ok if return is TIMEOUT - NextStatus AsyncNext(void **tag, bool *ok, - std::chrono::system_clock::time_point deadline); + NextStatus AsyncNext(void** tag, bool* ok, + std::chrono::system_clock::time_point deadline); // Blocking (until deadline) read from queue. // Returns false if the queue is ready for destruction, true if event - bool Next(void **tag, bool *ok) { - return (AsyncNext(tag,ok, - std::chrono::system_clock::time_point::max()) != - SHUTDOWN); + bool Next(void** tag, bool* ok) { + return (AsyncNext(tag, ok, std::chrono::system_clock::time_point::max()) != + SHUTDOWN); } // Shutdown has to be called, and the CompletionQueue can only be diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 44b8899bf7..4a71a84eeb 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -76,11 +76,11 @@ void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { EXPECT_EQ(tag(i), got_tag); } -void verify_timed_ok(CompletionQueue* cq, int i, bool expect_ok, - std::chrono::system_clock::time_point deadline = - std::chrono::system_clock::time_point::max(), - CompletionQueue::NextStatus expected_outcome = - CompletionQueue::GOT_EVENT) { +void verify_timed_ok( + CompletionQueue* cq, int i, bool expect_ok, + std::chrono::system_clock::time_point deadline = + std::chrono::system_clock::time_point::max(), + CompletionQueue::NextStatus expected_outcome = CompletionQueue::GOT_EVENT) { bool ok; void* got_tag; EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), expected_outcome); @@ -195,18 +195,17 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { grpc::ServerAsyncResponseWriter<EchoResponse> response_writer(&srv_ctx); send_request.set_message("Hello"); - std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > - response_reader(stub_->AsyncEcho(&cli_ctx, send_request, - &cli_cq_, tag(1))); + std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader( + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - std::chrono::system_clock::time_point - time_now(std::chrono::system_clock::now()), - time_limit(std::chrono::system_clock::now()+std::chrono::seconds(5)); + std::chrono::system_clock::time_point time_now( + std::chrono::system_clock::now()), + time_limit(std::chrono::system_clock::now() + std::chrono::seconds(5)); verify_timed_ok(&srv_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); verify_timed_ok(&cli_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, - tag(2)); + tag(2)); verify_timed_ok(&srv_cq_, 2, true, time_limit); EXPECT_EQ(send_request.message(), recv_request.message()); @@ -221,9 +220,8 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { EXPECT_EQ(send_response.message(), recv_response.message()); EXPECT_TRUE(recv_status.IsOk()); - } - + // Two pings and a final pong. TEST_F(AsyncEnd2endTest, SimpleClientStreaming) { ResetStub(); |