diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-10 14:50:14 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-10 14:50:14 +0000 |
commit | d9c60fdde1f23ee5e5ccf587c49fc3dfc553052e (patch) | |
tree | 46d78de5c457576c0ea47e37a9e28f596c40ca4c /testsuites | |
parent | 2010-08-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-d9c60fdde1f23ee5e5ccf587c49fc3dfc553052e.tar.bz2 |
2010-08-10 Bharath Suri <bharath.s.jois@gmail.com>
PR 1598/testing
* psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New test case
added to improve coverage of getpwent.c.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/psxtests/ChangeLog | 6 | ||||
-rw-r--r-- | testsuites/psxtests/psxpasswd02/init.c | 17 | ||||
-rw-r--r-- | testsuites/psxtests/psxpasswd02/psxpasswd02.scn | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index 089f7d8b0b..9d76021500 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,9 @@ +2010-08-10 Bharath Suri <bharath.s.jois@gmail.com> + + PR 1598/testing + * psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New test case + added to improve coverage of getpwent.c. + 2010-08-10 Joel Sherrill <joel.sherrill@oarcorp.com> PR 1665/testing diff --git a/testsuites/psxtests/psxpasswd02/init.c b/testsuites/psxtests/psxpasswd02/init.c index faeaab6053..9cd876b6e3 100644 --- a/testsuites/psxtests/psxpasswd02/init.c +++ b/testsuites/psxtests/psxpasswd02/init.c @@ -152,6 +152,23 @@ rtems_task Init( rtems_test_assert( !pw ); rtems_test_assert( errno == EINVAL ); + fp = fopen( "/etc/passwd", "w" ); + rtems_test_assert( fp != NULL ); + fprintf( fp, "\ + ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\ + ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\ + ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\ + ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\ + ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\ + ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\ + :x:999999999999:1:dummy::/:/bin/sh\n" ); + fclose( fp ); + + puts( "Init - getpwnam(\"root\") -- expected EINVAL" ); + pw = getpwnam( "root" ); + rtems_test_assert( !pw ); + rtems_test_assert( errno == EINVAL ); + puts( "Init - getgrent() -- OK" ); gr = getgrent(); rtems_test_assert( gr != NULL ); diff --git a/testsuites/psxtests/psxpasswd02/psxpasswd02.scn b/testsuites/psxtests/psxpasswd02/psxpasswd02.scn index 99d2be5635..bb4ba8273b 100644 --- a/testsuites/psxtests/psxpasswd02/psxpasswd02.scn +++ b/testsuites/psxtests/psxpasswd02/psxpasswd02.scn @@ -11,6 +11,7 @@ Init - getpwnam("root") -- expected EINVAL Init - getpwnam("root") -- expected EINVAL Init - getpwnam("root") -- expected EINVAL Init - getpwnam("root") -- expected EINVAL +Init - getpwnam("root") -- expected EINVAL Init - getgrent() -- OK group name: admin group password: |