tests/posix_semaphore: sem_timedwait should not return before abstime

Update the test as sem_timedwait is not supposed to return before the
given abstime.

Source: http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/functions/sem_timedwait.html

    The timeout shall expire when the absolute time specified by abstime
    passes, as measured by the clock on which timeouts are based (that is,
    when the value of that clock equals or exceeds abstime), or if the
    absolute time specified by abstime has already been passed at the time
    of the call.
This commit is contained in:
Gaëtan Harter 2019-03-20 15:14:54 +01:00
parent 3aec0c77ee
commit 732bcc7335
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -279,7 +279,7 @@ void test4(void)
}
uint64_str[fmt_u64_dec(uint64_str, elapsed)] = '\0';
if (elapsed < (exp - 100)) {
if (elapsed < exp) {
printf("first: waited only %s usec => FAILED\n", uint64_str);
}
else if (elapsed > (exp + TEST4_TIMEOUT_EXCEEDED_MARGIN)) {