Skip to content

Commit 5f64a47

Browse files
committed
tests: posix: headers: support pthread_setcancelstate() / type()
The function pthread_setcancelstate() has been supported for some time already in Zephyr. For some reason, it was not being checked in the "headers" testsuite. Additionally, check for pthread_setcanceltype() since it was added in a prior commit. Signed-off-by: Christopher Friedt <[email protected]>
1 parent 1e7eb7a commit 5f64a47

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/posix/headers/src/pthread_h.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ ZTEST(posix_headers, test_pthread_h)
2323
{
2424
zassert_not_equal(-1, PTHREAD_BARRIER_SERIAL_THREAD);
2525

26-
/* zassert_not_equal(-1, PTHREAD_CANCEL_ASYNCHRONOUS); */ /* not implemented */
26+
zassert_not_equal(-1, PTHREAD_CANCEL_ASYNCHRONOUS);
27+
zassert_not_equal(-1, PTHREAD_CANCEL_DEFERRED);
28+
2729
zassert_not_equal(-1, PTHREAD_CANCEL_ENABLE);
28-
/* zassert_not_equal(-1, PTHREAD_CANCEL_DEFERRED); */ /* not implemented */
2930
zassert_not_equal(-1, PTHREAD_CANCEL_DISABLE);
3031

3132
zassert_not_equal((void *)-42, PTHREAD_CANCELED);
@@ -146,8 +147,8 @@ ZTEST(posix_headers, test_pthread_h)
146147
zassert_not_null(pthread_rwlockattr_init);
147148
/* zassert_not_null(pthread_rwlockattr_setpshared); */ /* not implemented */
148149
zassert_not_null(pthread_self);
149-
/* zassert_not_null(pthread_setcancelstate); */ /* not implemented */
150-
/* zassert_not_null(pthread_setcanceltype); */ /* not implemented */
150+
zassert_not_null(pthread_setcancelstate);
151+
zassert_not_null(pthread_setcanceltype);
151152
/* zassert_not_null(pthread_setconcurrency); */ /* not implemented */
152153
zassert_not_null(pthread_setschedparam);
153154
/* zassert_not_null(pthread_setschedprio); */ /* not implemented */

0 commit comments

Comments
 (0)