mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:47:28 +03:00
parent
c93457f1f6
commit
4116e1d802
1 changed files with 9 additions and 8 deletions
|
|
@ -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!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue