mirror of git://sourceware.org/git/glibc.git
nptl/tst-rwlock14: Test pthread_rwlock_timedwrlock correctly
This commit is contained in:
parent
7a773abf7c
commit
82849fde3b
|
|
@ -1,5 +1,10 @@
|
||||||
2019-03-25 Mike Crowe <mac@mcrowe.com>
|
2019-03-25 Mike Crowe <mac@mcrowe.com>
|
||||||
|
|
||||||
|
* nptl/tst-rwlock14.c (do_test): Replace duplicate calls to
|
||||||
|
pthread_rwlock_timedrdlock with calls to
|
||||||
|
pthread_rwlock_timedwrlock to ensure that the latter is tested
|
||||||
|
too. Use new function name in diagnostic messages too.
|
||||||
|
|
||||||
* nptl/tst-sem5.c: Remove unused headers. Add <support/check.h>.
|
* nptl/tst-sem5.c: Remove unused headers. Add <support/check.h>.
|
||||||
(do_test) Use libsupport test macros rather than hand-coded
|
(do_test) Use libsupport test macros rather than hand-coded
|
||||||
conditionals and error messages. Ensure that sem_init returns zero
|
conditionals and error messages. Ensure that sem_init returns zero
|
||||||
|
|
|
||||||
|
|
@ -117,15 +117,15 @@ do_test (void)
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
e = pthread_rwlock_timedrdlock (&r, &ts);
|
e = pthread_rwlock_timedwrlock (&r, &ts);
|
||||||
if (e == 0)
|
if (e == 0)
|
||||||
{
|
{
|
||||||
puts ("second rwlock_timedrdlock did not fail");
|
puts ("second rwlock_timedwrlock did not fail");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
else if (e != EINVAL)
|
else if (e != EINVAL)
|
||||||
{
|
{
|
||||||
puts ("second rwlock_timedrdlock did not return EINVAL");
|
puts ("second rwlock_timedwrlock did not return EINVAL");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,15 +145,15 @@ do_test (void)
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
e = pthread_rwlock_timedrdlock (&r, &ts);
|
e = pthread_rwlock_timedwrlock (&r, &ts);
|
||||||
if (e == 0)
|
if (e == 0)
|
||||||
{
|
{
|
||||||
puts ("third rwlock_timedrdlock did not fail");
|
puts ("third rwlock_timedwrlock did not fail");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
else if (e != EINVAL)
|
else if (e != EINVAL)
|
||||||
{
|
{
|
||||||
puts ("third rwlock_timedrdlock did not return EINVAL");
|
puts ("third rwlock_timedwrlock did not return EINVAL");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue