1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

Relax timing test because it's too tight for Windows.

On my test system, a delay of 1016ms was measured after a
sleep of 1000ms.
This commit is contained in:
Martin Ling 2020-01-24 08:02:36 +00:00 committed by Uwe Hermann
parent 6339fa04d6
commit f6abee5c78

View File

@ -30,7 +30,7 @@ int main(int argc, char *argv[])
time_sub(&b, &a, &c); time_sub(&b, &a, &c);
printf("Measured: %ums\n", time_as_ms(&c)); printf("Measured: %ums\n", time_as_ms(&c));
assert(time_as_ms(&c) >= 999); assert(time_as_ms(&c) >= 999);
assert(time_as_ms(&c) <= 1001); assert(time_as_ms(&c) <= 1050);
printf("Starting 3s timeout\n"); printf("Starting 3s timeout\n");
timeout_start(&to, 3000); timeout_start(&to, 3000);
printf("Time to wait: %dms\n", timeout_remaining_ms(&to)); printf("Time to wait: %dms\n", timeout_remaining_ms(&to));