tests: posix: common: init check for stdin, stdout, and stderr

Add a test to help ensure stdin, stdout, and stderr are
initialized statically.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This commit is contained in:
Christopher Friedt 2023-10-12 21:01:11 -04:00 committed by Chris Friedt
parent 12ea06cac2
commit 254c6711ed

View file

@ -4,8 +4,18 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <pthread.h>
#include <zephyr/ztest.h>
ZTEST_SUITE(posix_apis, NULL, NULL, NULL, NULL, NULL);
extern bool fdtable_fd_is_initialized(int fd);
static void *setup(void)
{
/* ensure that the the stdin, stdout, and stderr fdtable entries are initialized */
zassert_true(fdtable_fd_is_initialized(0));
zassert_true(fdtable_fd_is_initialized(1));
zassert_true(fdtable_fd_is_initialized(2));
return NULL;
}
ZTEST_SUITE(posix_apis, NULL, setup, NULL, NULL, NULL);