Skip to content

Commit

Permalink
tests: posix: uname: add test
Browse files Browse the repository at this point in the history
add ztest for uname api

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
  • Loading branch information
ycsin committed Jul 6, 2023
1 parent a9340f3 commit 879fc97
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/posix/common/src/uname.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2023 meta
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/ztest.h>
#include <sys/utsname.h>

ZTEST(posix_apis, test_posix_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)));
}

0 comments on commit 879fc97

Please sign in to comment.