Skip to content

Commit 11886c7

Browse files
committed
posix: Adds test case for pthread_equal functions
Adds test case for pthread_equal Adds test coverage for same and different thread id Signed-off-by: Jai Arora <[email protected]>
1 parent d0ac563 commit 11886c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/posix/common/src/pthread.c

+6
Original file line numberDiff line numberDiff line change
@@ -771,3 +771,9 @@ ZTEST(posix_apis, test_barrier)
771771
ret = pthread_barrierattr_destroy(&attr);
772772
zassert_equal(ret, 0, "pthread_barrierattr_destroy failed");
773773
}
774+
775+
ZTEST(posix_apis, test_pthread_equal)
776+
{
777+
zassert_true(pthread_equal(pthread_self(), pthread_self()));
778+
zassert_false(pthread_equal(pthread_self(), (pthread_t)4242));
779+
}

0 commit comments

Comments
 (0)