diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-05 21:32:48 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-05 21:32:48 +0000 |
commit | 95cf41e21e41ce3ee5a791128ee3f8d7f114a3a5 (patch) | |
tree | 124b642c61bc5b9e3a919f1fb1233e9fe26fcc28 /testsuites/psxtests/psxid01 | |
parent | 2010-07-05 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-95cf41e21e41ce3ee5a791128ee3f8d7f114a3a5.tar.bz2 |
2010-07-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
cases.
Diffstat (limited to 'testsuites/psxtests/psxid01')
-rw-r--r-- | testsuites/psxtests/psxid01/init.c | 29 | ||||
-rw-r--r-- | testsuites/psxtests/psxid01/psxid01.doc | 4 | ||||
-rw-r--r-- | testsuites/psxtests/psxid01/psxid01.scn | 6 |
3 files changed, 39 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxid01/init.c b/testsuites/psxtests/psxid01/init.c index 3428929ff8..3c64aacb94 100644 --- a/testsuites/psxtests/psxid01/init.c +++ b/testsuites/psxtests/psxid01/init.c @@ -90,6 +90,33 @@ void test_pid(void) sc = issetugid(); rtems_test_assert( sc == 0 ); + + puts( "getpgrp - return local node - OK" ); + pid = getpgrp(); + printf( "getpgrp returned %d\n", pid ); + + puts( "getgroups - return 0 - OK" ); + sc = getgroups( 0, NULL ); + rtems_test_assert( sc == 0 ); + +} + +void test_getlogin(void) +{ + int sc; + char ch; + + printf( "getlogin() -- %s\n", getlogin() ); + + puts( "getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT" ); + sc = getlogin_r( NULL, LOGIN_NAME_MAX ); + rtems_test_assert( sc == EFAULT ); + + puts( "getlogin_r(buffer, 0) -- ERANGE" ); + sc = getlogin_r( &ch, 0 ); + rtems_test_assert( sc == ERANGE ); + + } rtems_task Init( @@ -107,6 +134,8 @@ rtems_task Init( test_pid(); puts( "" ); + test_getlogin(); + puts( "*** END OF TEST ID 01 ***" ); rtems_test_exit(0); diff --git a/testsuites/psxtests/psxid01/psxid01.doc b/testsuites/psxtests/psxid01/psxid01.doc index 6726cff814..d4b486cb8c 100644 --- a/testsuites/psxtests/psxid01/psxid01.doc +++ b/testsuites/psxtests/psxid01/psxid01.doc @@ -28,6 +28,10 @@ directives: __getpid getppid setsid + getpgrp + getgroups + getlogin + getlogin_r concepts: diff --git a/testsuites/psxtests/psxid01/psxid01.scn b/testsuites/psxtests/psxid01/psxid01.scn index 663f683e76..0a58a0ad8e 100644 --- a/testsuites/psxtests/psxid01/psxid01.scn +++ b/testsuites/psxtests/psxid01/psxid01.scn @@ -16,5 +16,11 @@ getpid = 1 __getpid = 1 getppid = 0 setsid - EPERM +getpgrp - return local node - OK +getpgrp returned 1 +getgroups - return 0 - OK +getlogin() -- +getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT +getlogin_r(buffer, 0) -- ERANGE *** END OF TEST ID 01 *** |