aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_config
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-06-14 19:31:05 -0700
committerGravatar GitHub <noreply@github.com>2016-06-14 19:31:05 -0700
commit8fb6c924b54775be2d9fea52a39cc930460558de (patch)
treea7c19431afc9a724772f3a8309a8dc5095ec5fb0 /test/core/client_config
parentb4fc876dbb0307c2d07d087fa80a5ee3c514d389 (diff)
parent289dcb1b68c236d11a8f5a89827e95af94a7df12 (diff)
Merge pull request #6875 from y-zeng/log_check
Add format check for gpr_log and gpr_asprintf, add gpr_strpad
Diffstat (limited to 'test/core/client_config')
-rw-r--r--test/core/client_config/lb_policies_test.c13
-rw-r--r--test/core/client_config/set_initial_connect_string_test.c6
2 files changed, 10 insertions, 9 deletions
diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c
index 1534360dea..3160312db6 100644
--- a/test/core/client_config/lb_policies_test.c
+++ b/test/core/client_config/lb_policies_test.c
@@ -135,7 +135,7 @@ static void drain_cq(grpc_completion_queue *cq) {
}
static void kill_server(const servers_fixture *f, size_t i) {
- gpr_log(GPR_INFO, "KILLING SERVER %d", i);
+ gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i);
GPR_ASSERT(f->servers[i] != NULL);
grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000));
GPR_ASSERT(
@@ -157,7 +157,7 @@ typedef struct request_data {
static void revive_server(const servers_fixture *f, request_data *rdata,
size_t i) {
int got_port;
- gpr_log(GPR_INFO, "RAISE AGAIN SERVER %d", i);
+ gpr_log(GPR_INFO, "RAISE AGAIN SERVER %" PRIuPTR, i);
GPR_ASSERT(f->servers[i] == NULL);
gpr_log(GPR_DEBUG, "revive: %s", f->servers_hostports[i]);
@@ -311,7 +311,7 @@ static int *perform_request(servers_fixture *f, grpc_channel *client,
.type != GRPC_QUEUE_TIMEOUT) {
GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
read_tag = ((int)(intptr_t)ev.tag);
- gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d",
+ gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%" PRIuPTR,
ev.success, ev.type, read_tag, iter_num);
if (ev.success && read_tag >= 1000) {
GPR_ASSERT(s_idx == -1); /* only one server must reply */
@@ -643,7 +643,8 @@ static void print_failed_expectations(const int *expected_connection_sequence,
const size_t num_iters) {
size_t i;
for (i = 0; i < num_iters; i++) {
- gpr_log(GPR_ERROR, "FAILURE: Iter (expected, actual): %d (%d, %d)", i,
+ gpr_log(GPR_ERROR,
+ "FAILURE: Iter (expected, actual): %" PRIuPTR " (%d, %d)", i,
expected_connection_sequence[i % expected_seq_length],
actual_connection_sequence[i]);
}
@@ -726,8 +727,8 @@ static void verify_total_carnage_round_robin(
const int actual = actual_connection_sequence[i];
const int expected = -1;
if (actual != expected) {
- gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", expected,
- actual, i);
+ gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %" PRIuPTR,
+ expected, actual, i);
abort();
}
}
diff --git a/test/core/client_config/set_initial_connect_string_test.c b/test/core/client_config/set_initial_connect_string_test.c
index 438b949236..63371a6b34 100644
--- a/test/core/client_config/set_initial_connect_string_test.c
+++ b/test/core/client_config/set_initial_connect_string_test.c
@@ -69,7 +69,7 @@ static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
GPR_ASSERT(success);
gpr_slice_buffer_move_into(&state.temp_incoming_buffer,
&state.incoming_buffer);
- gpr_log(GPR_DEBUG, "got %d bytes, magic is %d bytes",
+ gpr_log(GPR_DEBUG, "got %" PRIuPTR " bytes, magic is %" PRIuPTR " bytes",
state.incoming_buffer.length, strlen(magic_connect_string));
if (state.incoming_buffer.length > strlen(magic_connect_string)) {
gpr_atm_rel_store(&state.done_atm, 1);
@@ -173,8 +173,8 @@ static void actually_poll_server(void *arg) {
bool done = gpr_atm_acq_load(&state.done_atm) != 0;
gpr_timespec time_left =
gpr_time_sub(deadline, gpr_now(GPR_CLOCK_REALTIME));
- gpr_log(GPR_DEBUG, "done=%d, time_left=%d.%09d", done, time_left.tv_sec,
- time_left.tv_nsec);
+ gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRId64 ".%09" PRId32, done,
+ time_left.tv_sec, time_left.tv_nsec);
if (done || gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) < 0) {
break;
}