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 + + PR 1598/testing + * psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New test case + added to improve coverage of getpwent.c. + 2010-08-10 Joel Sherrill 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: