forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user