ab6102f70f
Add a trivial suite that simply ensures headers exist and that they supply standard symbols and constants. These tests are intended to be ordered exactly as the respective feature appears in the respective specification at https://pubs.opengroup.org/onlinepubs/9699919799 Over time, as POSIX support improves, we can enable additional checks. If `CONFIG_POSIX_API=n`, then we simply ensure that the header can be included, that constants and structures exist, including the existence of required fields in each structure. We check that a constant exist, by comparing its value against an arbitrary number. If the constant does not exist, it would of course be a compile error. ``` zassert_not_equal(-1, POLLIN); ``` We check that a structure contains required fields by comparing the field offset with an arbitrary number. If the field does not exist, of course, there would be a compile error. ``` zassert_not_equal(-1, offsetof(struct pollfd, fd)); ``` For non-scalar constants, we simply attempt to assign a value to the specific type: ``` struct in6_addr any6 = IN6ADDR_ANY_INIT; ``` If `CONFIG_POSIX_API=y`, then we additionally check that required functions are non-NULL (limited to what is currently supported in Zephyr). ``` zassert_not_null(pthread_create); ``` Note: functional verification tests should be done outside of this test suite. Signed-off-by: Chris Friedt <cfriedt@meta.com> |
||
---|---|---|
.. | ||
common | ||
eventfd | ||
eventfd_basic | ||
fs | ||
getopt | ||
headers |