1 /* 2 * Copyright (c) 2022 Meta 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include "_common.h" 8 9 #ifdef CONFIG_POSIX_API 10 #include <semaphore.h> 11 #else 12 #include <zephyr/posix/semaphore.h> 13 #endif 14 15 /** 16 * @brief existence test for `<semaphore.h>` 17 * 18 * @see <a href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html">semaphore.h</a> 19 */ ZTEST(posix_headers,test_semaphore_h)20ZTEST(posix_headers, test_semaphore_h) 21 { 22 /* zassert_not_equal(SEM_FAILED, (sem_t *)42); */ /* not implemented */ 23 24 if (IS_ENABLED(CONFIG_POSIX_API)) { 25 zassert_not_null(sem_close); 26 zassert_not_null(sem_destroy); 27 zassert_not_null(sem_getvalue); 28 zassert_not_null(sem_init); 29 zassert_not_null(sem_open); 30 zassert_not_null(sem_post); 31 zassert_not_null(sem_timedwait); 32 zassert_not_null(sem_trywait); 33 zassert_not_null(sem_unlink); 34 zassert_not_null(sem_wait); 35 } 36 } 37