aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRikard Falkeborn <rikard.falkeborn@gmail.com>2018-09-16 22:04:49 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-01-04 23:50:48 +0100
commitfa2d6ba84d7f87148738f3cbccf29016dd324f87 (patch)
tree7015e5aa21deac71011e72d36322dfbfc38423a2 /tests
parentc7c362a24c0247644f9fde05e8ea353af4a94b04 (diff)
printf: fix format specifiers
Closes #3426
Diffstat (limited to 'tests')
-rw-r--r--tests/libtest/lib557.c2
-rw-r--r--tests/unit/unit1650.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c
index 22ab9ec2e..e9415c432 100644
--- a/tests/libtest/lib557.c
+++ b/tests/libtest/lib557.c
@@ -1396,7 +1396,7 @@ static int _strlen_check(int linenumber, char *buf, size_t len)
size_t buflen = strlen(buf);
if(len != buflen) {
/* they shouldn't differ */
- printf("sprintf strlen:%d failed:\nwe '%d'\nsystem: '%d'\n",
+ printf("sprintf strlen:%d failed:\nwe '%zu'\nsystem: '%zu'\n",
linenumber, buflen, len);
return 1;
}
diff --git a/tests/unit/unit1650.c b/tests/unit/unit1650.c
index 4962bfac9..adc91236a 100644
--- a/tests/unit/unit1650.c
+++ b/tests/unit/unit1650.c
@@ -160,13 +160,13 @@ UNITTEST_START
int rc = doh_encode(req[i].name, req[i].type,
buffer, sizeof(buffer), &size);
if(rc != req[i].rc) {
- fprintf(stderr, "req %d: Expected return code %d got %d\n", i,
+ fprintf(stderr, "req %zu: Expected return code %d got %d\n", i,
req[i].rc, rc);
return 1;
}
else if(size != req[i].size) {
- fprintf(stderr, "req %d: Expected size %d got %d\n", i,
- (int)req[i].size, (int)size);
+ fprintf(stderr, "req %zu: Expected size %zu got %zu\n", i,
+ req[i].size, size);
fprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size));
return 2;
}
@@ -188,7 +188,7 @@ UNITTEST_START
rc = doh_decode((unsigned char *)resp[i].packet, resp[i].size,
resp[i].type, &d);
if(rc != resp[i].rc) {
- fprintf(stderr, "resp %d: Expected return code %d got %d\n", i,
+ fprintf(stderr, "resp %zu: Expected return code %d got %d\n", i,
resp[i].rc, rc);
return 4;
}
@@ -229,7 +229,7 @@ UNITTEST_START
}
de_cleanup(&d);
if(resp[i].out && strcmp((char *)buffer, resp[i].out)) {
- fprintf(stderr, "resp %d: Expected %s got %s\n", i,
+ fprintf(stderr, "resp %zu: Expected %s got %s\n", i,
resp[i].out, buffer);
return 1;
}
@@ -244,7 +244,7 @@ UNITTEST_START
rc = doh_decode((unsigned char *)full49, i, DNS_TYPE_A, &d);
if(!rc) {
/* none of them should work */
- fprintf(stderr, "%d: %d\n", i, rc);
+ fprintf(stderr, "%zu: %d\n", i, rc);
return 5;
}
}
@@ -257,7 +257,7 @@ UNITTEST_START
DNS_TYPE_A, &d);
if(!rc) {
/* none of them should work */
- fprintf(stderr, "2 %d: %d\n", i, rc);
+ fprintf(stderr, "2 %zu: %d\n", i, rc);
return 7;
}
}