diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-16 16:15:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-16 16:15:05 +0000 |
commit | a20190a40848e6322fe9a0a4eee9a5cdf6ae871e (patch) | |
tree | a60cd9e7b9ff3fd3a20524fa0ed641e70f484dad /c/src | |
parent | Web server uses the POSIX API. Therefor, it must be disabled when the (diff) | |
download | rtems-a20190a40848e6322fe9a0a4eee9a5cdf6ae871e.tar.bz2 |
Added test cases for uname().
Diffstat (limited to '')
-rw-r--r-- | c/src/tests/psxtests/psx01/init.c | 18 | ||||
-rw-r--r-- | c/src/tests/psxtests/psx01/psx01.scn | 7 |
2 files changed, 25 insertions, 0 deletions
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 <sched.h> +#include <sys/utsname.h> 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) |