From: Viktor Szakats Date: Sun, 5 Oct 2025 22:10:13 +0000 (+0200) Subject: unit1323: sync time types and printf masks, drop casts X-Git-Tag: rc-8_17_0-2~243 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4116e1d8028b30bfb0156b9b42042e0d930656f5;p=thirdparty%2Fcurl.git unit1323: sync time types and printf masks, drop casts Closes #18860 --- diff --git a/tests/unit/unit1323.c b/tests/unit/unit1323.c index 41d4fd31d3..a4e3eab2e1 100644 --- a/tests/unit/unit1323.c +++ b/tests/unit/unit1323.c @@ -30,14 +30,14 @@ static CURLcode test_unit1323(const char *arg) struct a { struct curltime first; struct curltime second; - time_t result; + timediff_t result; }; struct a tests[] = { - { {36762, 8345 }, {36761, 995926 }, 13 }, - { {36761, 995926 }, {36762, 8345 }, -13 }, - { {36761, 995926 }, {0, 0}, 36761995 }, - { {0, 0}, {36761, 995926 }, -36761995 }, + { {36762, 8345}, {36761, 995926}, 13 }, + { {36761, 995926}, {36762, 8345}, -13 }, + { {36761, 995926}, {0, 0}, 36761995 }, + { {0, 0}, {36761, 995926}, -36761995 }, }; size_t i; @@ -45,13 +45,14 @@ static CURLcode test_unit1323(const char *arg) for(i = 0; i < CURL_ARRAYSIZE(tests); i++) { timediff_t result = curlx_timediff(tests[i].first, tests[i].second); if(result != tests[i].result) { - curl_mprintf("%ld.%06u to %ld.%06u got %d, but expected %ld\n", + curl_mprintf("%ld.%06u to %ld.%06u got %" FMT_TIMEDIFF_T + ", but expected %" FMT_TIMEDIFF_T "\n", (long)tests[i].first.tv_sec, tests[i].first.tv_usec, (long)tests[i].second.tv_sec, tests[i].second.tv_usec, - (int)result, - (long)tests[i].result); + result, + tests[i].result); fail("unexpected result!"); } }