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 <mqueue.h>
11 #else
12 #include <zephyr/posix/mqueue.h>
13 #endif
14
15 /**
16 * @brief existence test for `<mqueue.h>`
17 *
18 * @see <a href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html">mqueue.h</a>
19 */
ZTEST(posix_headers,test_mqueue_h)20 ZTEST(posix_headers, test_mqueue_h)
21 {
22 zassert_not_equal((mqd_t)-1, (mqd_t)NULL);
23
24 zassert_not_equal(-1, offsetof(struct mq_attr, mq_flags));
25 zassert_not_equal(-1, offsetof(struct mq_attr, mq_maxmsg));
26 zassert_not_equal(-1, offsetof(struct mq_attr, mq_msgsize));
27 zassert_not_equal(-1, offsetof(struct mq_attr, mq_curmsgs));
28
29 if (IS_ENABLED(CONFIG_POSIX_API)) {
30 zassert_not_null(mq_close);
31 zassert_not_null(mq_getattr);
32 zassert_not_null(mq_notify);
33 zassert_not_null(mq_open);
34 zassert_not_null(mq_receive);
35 zassert_not_null(mq_send);
36 zassert_not_null(mq_setattr);
37 zassert_not_null(mq_timedreceive);
38 zassert_not_null(mq_timedsend);
39 zassert_not_null(mq_unlink);
40 }
41 }
42