]> sigrok.org Git - libserialport.git/commitdiff
Relax timing test because it's too tight for Windows.
authorMartin Ling <redacted>
Fri, 24 Jan 2020 08:02:36 +0000 (08:02 +0000)
committerUwe Hermann <redacted>
Sun, 26 Jan 2020 20:11:46 +0000 (21:11 +0100)
On my test system, a delay of 1016ms was measured after a
sleep of 1000ms.

test_timing.c

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