unit1323: sync time types and printf masks, drop casts
No binary (build failed)
—
(log yok)
| @@ -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!"); | |
| } | |
| } | |