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 <arpa/inet.h> 11 #else 12 #include <zephyr/posix/arpa/inet.h> 13 #endif 14 15 /** 16 * @brief existence test for `<arpa/inet.h>` 17 * 18 * @see <a href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/arpa_inet.h.html">arpa/inet.h</a> 19 */ ZTEST(posix_headers,test_arpa_inet_h)20ZTEST(posix_headers, test_arpa_inet_h) 21 { 22 zassert_not_equal(-1, htonl(0)); 23 zassert_not_equal(-1, htons(0)); 24 zassert_not_equal(-1, ntohl(0)); 25 zassert_not_equal(-1, ntohs(0)); 26 27 if (IS_ENABLED(CONFIG_POSIX_API)) { 28 /* zassert_not_null(inet_addr); */ /* not implemented */ 29 /* zassert_not_null(inet_ntoa); */ /* not implemented */ 30 zassert_not_null(inet_ntop); 31 zassert_not_null(inet_pton); 32 } 33 } 34