lib: posix: mutex: check args of pthread_mutexattr_getprotocol
Perform arguments checking in the `pthread_mutexattr_getprotocol()` function. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
parent
5690088a5c
commit
50f47a44b7
2 changed files with 7 additions and 0 deletions
|
@ -60,6 +60,9 @@ static void test_mutex_common(int type, void *(*entry)(void *arg))
|
|||
|
||||
zassert_ok(pthread_mutexattr_gettype(&mut_attr, &actual_type),
|
||||
"reading mutex type is failed");
|
||||
zassert_not_ok(pthread_mutexattr_getprotocol(NULL, &protocol));
|
||||
zassert_not_ok(pthread_mutexattr_getprotocol(&mut_attr, NULL));
|
||||
zassert_not_ok(pthread_mutexattr_getprotocol(NULL, NULL));
|
||||
zassert_ok(pthread_mutexattr_getprotocol(&mut_attr, &protocol),
|
||||
"reading mutex protocol is failed");
|
||||
zassert_ok(pthread_mutexattr_destroy(&mut_attr));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue