From a20190a40848e6322fe9a0a4eee9a5cdf6ae871e Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 16 Nov 1999 16:15:05 +0000 Subject: Added test cases for uname(). --- c/src/tests/psxtests/psx01/init.c | 18 ++++++++++++++++++ c/src/tests/psxtests/psx01/psx01.scn | 7 +++++++ 2 files changed, 25 insertions(+) (limited to 'c') diff --git a/c/src/tests/psxtests/psx01/init.c b/c/src/tests/psxtests/psx01/init.c index a2101a5f16..2d82fb472e 100644 --- a/c/src/tests/psxtests/psx01/init.c +++ b/c/src/tests/psxtests/psx01/init.c @@ -13,6 +13,7 @@ #define CONFIGURE_INIT #include "system.h" #include +#include void *POSIX_Init( void *argument @@ -27,11 +28,28 @@ void *POSIX_Init( time_t seconds1; time_t remaining; struct tm tm; + struct utsname uts; puts( "\n\n*** POSIX TEST 1 ***" ); build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); + /* print some system information */ + + puts( "Init: uname - EFAULT (invalid uts pointer argument)" ); + status = uname( NULL ); + assert( status == -1 ); + assert( errno == EFAULT ); + + status = uname( &uts ); + assert( !status ); + printf( "Init: uts.sysname: %s\n", uts.sysname ); + printf( "Init: uts.nodename: %s\n", uts.nodename ); + printf( "Init: uts.release: %s\n", uts.release ); + printf( "Init: uts.version: %s\n", uts.version ); + printf( "Init: uts.machine: %s\n", uts.machine ); + puts(""); + /* error cases in clock_gettime and clock_settime */ puts( "Init: clock_gettime - EINVAL (invalid clockid)" ); diff --git a/c/src/tests/psxtests/psx01/psx01.scn b/c/src/tests/psxtests/psx01/psx01.scn index 22d9fdc9a3..c9b05b9e54 100644 --- a/c/src/tests/psxtests/psx01/psx01.scn +++ b/c/src/tests/psxtests/psx01/psx01.scn @@ -1,4 +1,11 @@ *** POSIX TEST 1 *** +Init: uname - EFAULT (invalid uts pointer argument) +Init: uts.sysname: RTEMS +Init: uts.nodename: Node 1 +Init: uts.release: rtems-19991105 +Init: uts.version: +Init: uts.machine: SPARC/erc32 + Init: clock_gettime - EINVAL (invalid clockid) Init: clock_settime - EINVAL (invalid clockid) Init: clock_getres - EINVAL (invalid clockid) -- cgit v1.2.3