tests: posix: Fix unchecked return coverity error

New test cases did not check return value of pthread_attr_init()

Fixes #33809

Signed-off-by: David Leach <david.leach@nxp.com>
This commit is contained in:
David Leach 2021-03-30 16:28:26 -05:00 committed by Anas Nashif
commit 507a06fa82

View file

@ -450,7 +450,8 @@ void test_posix_pthread_error_condition(void)
EINVAL, "get datach state error"); EINVAL, "get datach state error");
/* Initialise thread attribute to ensure won't be return with init error */ /* Initialise thread attribute to ensure won't be return with init error */
pthread_attr_init(&attr); zassert_false(pthread_attr_init(&attr),
"Unable to create pthread object attr");
zassert_false(pthread_attr_setschedpolicy(&attr, 0), zassert_false(pthread_attr_setschedpolicy(&attr, 0),
"set scheduling policy error"); "set scheduling policy error");
zassert_false(pthread_attr_setschedpolicy(&attr, 1), zassert_false(pthread_attr_setschedpolicy(&attr, 1),