From 637f76418f88a504c0fa0bf75d1771fbc7d9c5f4 Mon Sep 17 00:00:00 2001 From: Yong Cong Sin Date: Wed, 5 Jul 2023 00:51:22 +0800 Subject: [PATCH] tests: posix: uname: add test add ztest for uname api Signed-off-by: Yong Cong Sin --- tests/posix/common/src/uname.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/posix/common/src/uname.c diff --git a/tests/posix/common/src/uname.c b/tests/posix/common/src/uname.c new file mode 100644 index 00000000000000..bda6ce666ea5b7 --- /dev/null +++ b/tests/posix/common/src/uname.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +ZTEST(posix_apis, test_uname) +{ + struct utsname info; + + zassert_ok(uname(&info)); + zassert_ok(strncmp(info.sysname, "Zephyr", sizeof(info.sysname))); + zassert_ok(strncmp(info.machine, CONFIG_ARCH, sizeof(info.machine))); +}