From 0ba114408ebb153b29c85dd8be9847095a6a6954 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 10 Jun 2016 15:15:44 -0700 Subject: Fix gpr_log format mismatches in c++ tests --- test/cpp/interop/client.cc | 5 +++-- test/cpp/interop/interop_client.cc | 10 ++++++---- test/cpp/interop/metrics_client.cc | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'test/cpp/interop') diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 7727824979..addaf174f2 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -171,8 +171,9 @@ int main(int argc, char** argv) { "large_unary|large_compressed_unary|client_streaming|server_streaming|" "server_compressed_streaming|half_duplex|ping_pong|cancel_after_begin|" "cancel_after_first_response|timeout_on_sleeping_server|empty_stream|" - "compute_engine_creds|jwt_token_creds|oauth2_auth_token|per_rpc_creds", - "status_code_and_message|custom_metadata", FLAGS_test_case.c_str()); + "compute_engine_creds|jwt_token_creds|oauth2_auth_token|per_rpc_creds|" + "status_code_and_message|custom_metadata", + FLAGS_test_case.c_str()); ret = 1; } diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index a0479e8f68..f9813f38c1 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -433,7 +433,7 @@ bool InteropClient::DoResponseStreaming() { // most likely due to connection failure. gpr_log(GPR_ERROR, "DoResponseStreaming(): Read fewer streams (%d) than " - "response_stream_sizes.size() (%d)", + "response_stream_sizes.size() (%" PRIu64 ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } @@ -517,9 +517,11 @@ bool InteropClient::DoResponseCompressedStreaming() { // stream->Read() failed before reading all the expected messages. This // is most likely due to a connection failure. gpr_log(GPR_ERROR, - "DoResponseCompressedStreaming(): Responses read (k=%d) is " + "DoResponseCompressedStreaming(): Responses read (k=%" PRIuPTR + ") is " "less than the expected messages (i.e " - "response_stream_sizes.size() (%d)). (i=%d, j=%d)", + "response_stream_sizes.size() (%" PRIu64 ")). (i=%" PRIuPTR + ", j=%" PRIuPTR ")", k, response_stream_sizes.size(), i, j); return TransientFailureOrAbort(); } @@ -608,7 +610,7 @@ bool InteropClient::DoHalfDuplex() { // most likely due to a connection failure gpr_log(GPR_ERROR, "DoHalfDuplex(): Responses read (i=%d) are less than the expected " - "number of messages response_stream_sizes.size() (%d)", + "number of messages response_stream_sizes.size() (%" PRIu64 ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } diff --git a/test/cpp/interop/metrics_client.cc b/test/cpp/interop/metrics_client.cc index c8c2215fab..7a0cb994df 100644 --- a/test/cpp/interop/metrics_client.cc +++ b/test/cpp/interop/metrics_client.cc @@ -76,7 +76,7 @@ bool PrintMetrics(std::unique_ptr stub, bool total_only, while (reader->Read(&gauge_response)) { if (gauge_response.value_case() == GaugeResponse::kLongValue) { if (!total_only) { - gpr_log(GPR_INFO, "%s: %ld", gauge_response.name().c_str(), + gpr_log(GPR_INFO, "%s: %lld", gauge_response.name().c_str(), gauge_response.long_value()); } overall_qps += gauge_response.long_value(); -- cgit v1.2.3 From beaa35724c4eb67eb5f890d6f66e0fd3b2f50aaa Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 10 Jun 2016 15:46:14 -0700 Subject: Fix type mismatch for type_size --- src/core/ext/transport/chttp2/transport/parsing.c | 6 ++++-- test/cpp/end2end/async_end2end_test.cc | 8 ++++---- test/cpp/end2end/zookeeper_test.cc | 2 +- test/cpp/interop/interop_client.cc | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'test/cpp/interop') diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index 8f72a4ff99..3c74258352 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -649,7 +649,8 @@ static void on_initial_header(void *tp, grpc_mdelem *md) { if (new_size > metadata_size_limit) { if (!stream_parsing->exceeded_metadata_size) { gpr_log(GPR_DEBUG, - "received initial metadata size exceeds limit (%lu vs. %lu)", + "received initial metadata size exceeds limit (%" PRIuPTR + " vs. %" PRIuPTR ")", new_size, metadata_size_limit); stream_parsing->seen_error = true; stream_parsing->exceeded_metadata_size = true; @@ -695,7 +696,8 @@ static void on_trailing_header(void *tp, grpc_mdelem *md) { if (new_size > metadata_size_limit) { if (!stream_parsing->exceeded_metadata_size) { gpr_log(GPR_DEBUG, - "received trailing metadata size exceeds limit (%lu vs. %lu)", + "received trailing metadata size exceeds limit (%" PRIuPTR + " vs. %" PRIuPTR ")", new_size, metadata_size_limit); stream_parsing->seen_error = true; stream_parsing->exceeded_metadata_size = true; diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 5915187d43..8229bda6bf 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -229,10 +229,10 @@ class TestScenario { credentials_type(creds_type), message_content(content) {} void Log() const { - gpr_log(GPR_INFO, - "Scenario: disable_blocking %d, credentials %s, message size %d", - disable_blocking, credentials_type.c_str(), - (int)(message_content.size())); + gpr_log( + GPR_INFO, + "Scenario: disable_blocking %d, credentials %s, message size %" PRIuPTR, + disable_blocking, credentials_type.c_str(), message_content.size()); } bool disable_blocking; const grpc::string credentials_type; diff --git a/test/cpp/end2end/zookeeper_test.cc b/test/cpp/end2end/zookeeper_test.cc index 12853a1b98..b44668fe84 100644 --- a/test/cpp/end2end/zookeeper_test.cc +++ b/test/cpp/end2end/zookeeper_test.cc @@ -101,7 +101,7 @@ class ZookeeperTest : public ::testing::Test { zookeeper_address_ = addr_str; gpr_free(addr); } - gpr_log(GPR_DEBUG, zookeeper_address_.c_str()); + gpr_log(GPR_DEBUG, "%s, " zookeeper_address_.c_str()); // Connects to zookeeper server zoo_set_debug_level(ZOO_LOG_LEVEL_WARN); diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index f9813f38c1..0bf1fd6f73 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -433,7 +433,7 @@ bool InteropClient::DoResponseStreaming() { // most likely due to connection failure. gpr_log(GPR_ERROR, "DoResponseStreaming(): Read fewer streams (%d) than " - "response_stream_sizes.size() (%" PRIu64 ")", + "response_stream_sizes.size() (%" PRIuPTR ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } @@ -520,7 +520,7 @@ bool InteropClient::DoResponseCompressedStreaming() { "DoResponseCompressedStreaming(): Responses read (k=%" PRIuPTR ") is " "less than the expected messages (i.e " - "response_stream_sizes.size() (%" PRIu64 ")). (i=%" PRIuPTR + "response_stream_sizes.size() (%" PRIuPTR ")). (i=%" PRIuPTR ", j=%" PRIuPTR ")", k, response_stream_sizes.size(), i, j); return TransientFailureOrAbort(); @@ -610,7 +610,7 @@ bool InteropClient::DoHalfDuplex() { // most likely due to a connection failure gpr_log(GPR_ERROR, "DoHalfDuplex(): Responses read (i=%d) are less than the expected " - "number of messages response_stream_sizes.size() (%" PRIu64 ")", + "number of messages response_stream_sizes.size() (%" PRIuPTR ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } -- cgit v1.2.3