Change formatter for size_t from %d to %zu in tests

This commit is contained in:
Erik Ekman 2021-06-05 14:47:24 +02:00
parent f2b619faad
commit 3c7169fcf5
3 changed files with 10 additions and 10 deletions

View File

@ -103,8 +103,8 @@ START_TEST(test_base32_blksize)
val = base32_ops.encode(encbuf, &enclen, rawbuf, rawlen);
ck_assert_msg(rawlen == 5, "raw length was %d not 5", rawlen);
ck_assert_msg(enclen == 5, "encoded %d bytes, not 5", enclen);
ck_assert_msg(rawlen == 5, "raw length was %zu not 5", rawlen);
ck_assert_msg(enclen == 5, "encoded %zu bytes, not 5", enclen);
ck_assert_msg(val == 8, "encoded string %s was length %d", encbuf, val);
memset(rawbuf, 0, rawlen + 16);
@ -112,7 +112,7 @@ START_TEST(test_base32_blksize)
enclen = val;
val = base32_ops.decode(rawbuf, &rawlen, encbuf, enclen);
ck_assert_msg(rawlen == 5, "raw length was %d not 5", rawlen);
ck_assert_msg(rawlen == 5, "raw length was %zu not 5", rawlen);
ck_assert_msg(val == 5, "val was not 5 but %d", val);
for (i = 0; i < rawlen; i++) {
ck_assert(rawbuf[i] == 'A');

View File

@ -116,8 +116,8 @@ START_TEST(test_base64_blksize)
val = base64_ops.encode(encbuf, &enclen, rawbuf, rawlen);
ck_assert_msg(rawlen == 3, "raw length was %d not 3", rawlen);
ck_assert_msg(enclen == 3, "encoded %d bytes, not 3", enclen);
ck_assert_msg(rawlen == 3, "raw length was %zu not 3", rawlen);
ck_assert_msg(enclen == 3, "encoded %zu bytes, not 3", enclen);
ck_assert_msg(val == 4, "encoded string %s was length %d", encbuf, val);
memset(rawbuf, 0, rawlen + 16);
@ -125,7 +125,7 @@ START_TEST(test_base64_blksize)
enclen = val;
val = base64_ops.decode(rawbuf, &rawlen, encbuf, enclen);
ck_assert_msg(rawlen == 3, "raw length was %d not 3", rawlen);
ck_assert_msg(rawlen == 3, "raw length was %zu not 3", rawlen);
ck_assert(val == 3);
for (i = 0; i < rawlen; i++) {
ck_assert(rawbuf[i] == 'A');

View File

@ -103,7 +103,7 @@ START_TEST(test_encode_query)
ck_assert_msg(strncmp(query_packet, buf, sizeof(query_packet)) == 0,
"Did not compile expected packet");
ck_assert_msg(ret == len,
"Bad packet length: %d, expected %d", ret, len);
"Bad packet length: %d, expected %zu", ret, len);
}
END_TEST
@ -129,7 +129,7 @@ START_TEST(test_decode_query)
ck_assert_msg(strncmp(buf, innerData, strlen(innerData)) == 0,
"Did not extract expected host: '%s'", buf);
ck_assert_msg(strlen(buf) == strlen(innerData),
"Bad host length: %d, expected %d: '%s'",
"Bad host length: %zu, expected %zu: '%s'",
strlen(buf), strlen(innerData), buf);
}
END_TEST
@ -171,7 +171,7 @@ START_TEST(test_decode_response)
ret = dns_decode(buf, len, &q, QR_ANSWER, answer_packet, sizeof(answer_packet)-1);
ck_assert_msg(ret == strlen(msgData),
"Bad data length: %d, expected %d", ret, strlen(msgData));
"Bad data length: %d, expected %zu", ret, strlen(msgData));
ck_assert_msg(strncmp(msgData, buf, strlen(msgData)) == 0,
"Did not extract expected data");
ck_assert(q.id == 0x0539);
@ -190,7 +190,7 @@ START_TEST(test_decode_response_with_high_trans_id)
ret = dns_decode(buf, len, &q, QR_ANSWER, answer_packet_high_trans_id, sizeof(answer_packet_high_trans_id)-1);
ck_assert_msg(ret == strlen(msgData),
"Bad data length: %d, expected %d", ret, strlen(msgData));
"Bad data length: %d, expected %zu", ret, strlen(msgData));
ck_assert_msg(strncmp(msgData, buf, strlen(msgData)) == 0,
"Did not extract expected data");
ck_assert_msg(q.id == 0x8539,