mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 17:18:48 -05:00
tests: Fix format specifiers
This commit is contained in:
parent
eb49683e55
commit
df3647c9c8
@ -69,7 +69,7 @@ int test(char *URL)
|
|||||||
goto test_cleanup;
|
goto test_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("header length is ........: %lu\n", headerSize);
|
printf("header length is ........: %ld\n", headerSize);
|
||||||
printf("header length should be..: %lu\n", realHeaderSize);
|
printf("header length should be..: %lu\n", realHeaderSize);
|
||||||
|
|
||||||
test_cleanup:
|
test_cleanup:
|
||||||
|
@ -71,7 +71,7 @@ int test(char *URL)
|
|||||||
}
|
}
|
||||||
if(protocol != CURLPROTO_HTTP) {
|
if(protocol != CURLPROTO_HTTP) {
|
||||||
fprintf(stderr, "%s:%d protocol of http resource is incorrect; "
|
fprintf(stderr, "%s:%d protocol of http resource is incorrect; "
|
||||||
"expected %ld but is %ld\n",
|
"expected %d but is %ld\n",
|
||||||
__FILE__, __LINE__, CURLPROTO_HTTP, protocol);
|
__FILE__, __LINE__, CURLPROTO_HTTP, protocol);
|
||||||
res = CURLE_HTTP_RETURNED_ERROR;
|
res = CURLE_HTTP_RETURNED_ERROR;
|
||||||
goto test_cleanup;
|
goto test_cleanup;
|
||||||
|
@ -72,7 +72,7 @@ int test(char *URL)
|
|||||||
if(memcmp(scheme, "HTTP", 5) != 0) {
|
if(memcmp(scheme, "HTTP", 5) != 0) {
|
||||||
fprintf(stderr, "%s:%d scheme of http resource is incorrect; "
|
fprintf(stderr, "%s:%d scheme of http resource is incorrect; "
|
||||||
"expected 'HTTP' but is %s\n",
|
"expected 'HTTP' but is %s\n",
|
||||||
__FILE__, __LINE__, CURLPROTO_HTTP,
|
__FILE__, __LINE__,
|
||||||
(scheme == NULL ? "NULL" : "invalid"));
|
(scheme == NULL ? "NULL" : "invalid"));
|
||||||
res = CURLE_HTTP_RETURNED_ERROR;
|
res = CURLE_HTTP_RETURNED_ERROR;
|
||||||
goto test_cleanup;
|
goto test_cleanup;
|
||||||
|
@ -46,11 +46,11 @@ void dump(const char *text,
|
|||||||
/* without the hex output, we can fit more on screen */
|
/* without the hex output, we can fit more on screen */
|
||||||
width = 0x40;
|
width = 0x40;
|
||||||
|
|
||||||
fprintf(stream, "%s, %d bytes (0x%x)\n", text, (int)size, (int)size);
|
fprintf(stream, "%s, %zu bytes (0x%zx)\n", text, size, size);
|
||||||
|
|
||||||
for(i = 0; i<size; i += width) {
|
for(i = 0; i<size; i += width) {
|
||||||
|
|
||||||
fprintf(stream, "%04x: ", (int)i);
|
fprintf(stream, "%04zx: ", i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
|
@ -43,12 +43,12 @@ void libtest_debug_dump(const char *timebuf, const char *text, FILE *stream,
|
|||||||
/* without the hex output, we can fit more on screen */
|
/* without the hex output, we can fit more on screen */
|
||||||
width = 0x40;
|
width = 0x40;
|
||||||
|
|
||||||
fprintf(stream, "%s%s, %d bytes (0x%x)\n", timebuf, text,
|
fprintf(stream, "%s%s, %zu bytes (0x%zx)\n", timebuf, text,
|
||||||
(int)size, (int)size);
|
size, size);
|
||||||
|
|
||||||
for(i = 0; i < size; i += width) {
|
for(i = 0; i < size; i += width) {
|
||||||
|
|
||||||
fprintf(stream, "%04x: ", (int)i);
|
fprintf(stream, "%04zx: ", i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
/* include memdebug.h last */
|
/* include memdebug.h last */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
#define LOGFILE "log/fake_ntlm%d.log"
|
#define LOGFILE "log/fake_ntlm%ld.log"
|
||||||
|
|
||||||
const char *serverlogfile;
|
const char *serverlogfile;
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ UNITTEST_START
|
|||||||
int rem = (i + 7)%NUM_NODES;
|
int rem = (i + 7)%NUM_NODES;
|
||||||
printf("Tree look:\n");
|
printf("Tree look:\n");
|
||||||
splayprint(root, 0, 1);
|
splayprint(root, 0, 1);
|
||||||
printf("remove pointer %d, payload %zd\n", rem,
|
printf("remove pointer %d, payload %zu\n", rem,
|
||||||
*(size_t *)nodes[rem].payload);
|
*(size_t *)nodes[rem].payload);
|
||||||
rc = Curl_splayremovebyaddr(root, &nodes[rem], &root);
|
rc = Curl_splayremovebyaddr(root, &nodes[rem], &root);
|
||||||
if(rc) {
|
if(rc) {
|
||||||
@ -130,7 +130,7 @@ UNITTEST_START
|
|||||||
tv_now.tv_usec = i;
|
tv_now.tv_usec = i;
|
||||||
root = Curl_splaygetbest(tv_now, root, &removed);
|
root = Curl_splaygetbest(tv_now, root, &removed);
|
||||||
while(removed != NULL) {
|
while(removed != NULL) {
|
||||||
printf("removed payload %zd[%zd]\n",
|
printf("removed payload %zu[%zu]\n",
|
||||||
(*(size_t *)removed->payload) / 10,
|
(*(size_t *)removed->payload) / 10,
|
||||||
(*(size_t *)removed->payload) % 10);
|
(*(size_t *)removed->payload) % 10);
|
||||||
root = Curl_splaygetbest(tv_now, root, &removed);
|
root = Curl_splaygetbest(tv_now, root, &removed);
|
||||||
|
@ -79,13 +79,13 @@ UNITTEST_START
|
|||||||
abort_unless(out != NULL, "returned NULL!");
|
abort_unless(out != NULL, "returned NULL!");
|
||||||
|
|
||||||
if(strcmp(out, pairs[i].output)) {
|
if(strcmp(out, pairs[i].output)) {
|
||||||
fprintf(stderr, "Test %d: '%s' gave '%s' instead of '%s'\n",
|
fprintf(stderr, "Test %u: '%s' gave '%s' instead of '%s'\n",
|
||||||
i, pairs[i].input, out, pairs[i].output);
|
i, pairs[i].input, out, pairs[i].output);
|
||||||
fail("Test case output mismatched");
|
fail("Test case output mismatched");
|
||||||
fails++;
|
fails++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf(stderr, "Test %d: OK\n", i);
|
fprintf(stderr, "Test %u: OK\n", i);
|
||||||
free(out);
|
free(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user