Skip to content

Commit

Permalink
test: fix -Wformat warnings in inspector cctest
Browse files Browse the repository at this point in the history
Print size_t and ssize_t using %zd and %zu respectively, not %ld.

PR-URL: #8034
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bnoordhuis authored and jasnell committed Oct 6, 2016
1 parent 4cd3090 commit ae2c344
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/cctest/test_inspector_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void check_data_cb(read_expects* expectation, ssize_t nread,
c = expectation->expected[expectation->pos++];
actual = buf->base[i];
if (c != actual) {
fprintf(stderr, "Unexpected character at position %ld\n",
fprintf(stderr, "Unexpected character at position %zd\n",
expectation->pos - 1);
GTEST_ASSERT_EQ(c, actual);
}
Expand Down Expand Up @@ -171,7 +171,7 @@ static void fail_callback(uv_stream_t* stream, ssize_t nread,
if (nread < 0) {
fprintf(stderr, "IO error: %s\n", uv_strerror(nread));
} else {
fprintf(stderr, "Read %ld bytes\n", nread);
fprintf(stderr, "Read %zd bytes\n", nread);
}
ASSERT_TRUE(false); // Shouldn't have been called
}
Expand Down Expand Up @@ -262,7 +262,7 @@ static void expect_on_server(const char* data, size_t len) {
char actual = expects->actual_data[expects->actual_offset++];
char expected = data[i];
if (expected != actual) {
fprintf(stderr, "Character %ld:\n", i);
fprintf(stderr, "Character %zu:\n", i);
GTEST_ASSERT_EQ(expected, actual);
}
}
Expand Down

0 comments on commit ae2c344

Please sign in to comment.