1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

C11 threads: Fix inaccuracies in testsuite

- tst-mtx-recursive.c: mtx_init fails to use mtx_plain.  Per C11
  specs, using mtx_recursive alone is not supported.  This isn't
  catched because mtx_plain is defined as 0.

- tst-thrd-sleep.c: thrd_sleep returns 0 on success, a negative
  value on failure.  Testing against thrd_success is incorrect.

- tst-tss-basic.c: tss_set is incorrectly checkd for a non-0
  value.  The test should test aginst C11 threads error codes.
  This isn't catched because thrd_success is defined as 0.

Note that all three tests fail on FreeBSD, which defines all mutex type
values, as well as all C11 threads error codes with non-0 values.
This commit is contained in:
Corinna Vinschen
2020-09-07 11:42:51 +02:00
committed by Florian Weimer
parent 721a853415
commit 7b51d9f69e
3 changed files with 3 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ static int
sleep_thrd (void *arg)
{
struct timespec const *tl = (struct timespec const *) arg;
if (thrd_sleep (tl, NULL) != thrd_success)
if (thrd_sleep (tl, NULL) != 0)
FAIL_EXIT1 ("thrd_sleep failed");
thrd_exit (thrd_success);