summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxfile01
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-07 00:22:46 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-07 00:22:46 +0000
commit99e6fb5244c6c99341fed54bbc4cfbd2fcc4d8f5 (patch)
tree9ef3d6c56d179b4b9703f45d6fd9298cbba04d01 /testsuites/psxtests/psxfile01
parent2010-08-06 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-99e6fb5244c6c99341fed54bbc4cfbd2fcc4d8f5.tar.bz2
2010-08-06 Bharath Suri <bharath.s.jois@gmail.com>
PR 1654/testing * psx13/test.c, psx13/psx13.scn: Test case to improve testing of dup2 routine. * psxfile01/test.c, psxfile01/psxfile01.scn: New test to improve testing of fcntl routine. * psximfs01/init.c, psximfs01/psximfs01.scn: Improve testing of imfs routines. * psximfs02/init.c, psximfs02/psximfs02.scn: Improve coverage of imfs routines. * psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New tests to improve coverage of getpwent.c.
Diffstat (limited to 'testsuites/psxtests/psxfile01')
-rw-r--r--testsuites/psxtests/psxfile01/psxfile01.scn10
-rw-r--r--testsuites/psxtests/psxfile01/test.c6
2 files changed, 10 insertions, 6 deletions
diff --git a/testsuites/psxtests/psxfile01/psxfile01.scn b/testsuites/psxtests/psxfile01/psxfile01.scn
index 3fc7522b86..06542ae317 100644
--- a/testsuites/psxtests/psxfile01/psxfile01.scn
+++ b/testsuites/psxtests/psxfile01/psxfile01.scn
@@ -1,10 +1,9 @@
-
*** FILE TEST 1 ***
*************** Dump of Entire IMFS ***************
/
....dev/
........console (device 0, 0)
-*************** End of Dump ***************
+*************** End of Dump ***************
stat of /dev/console
....st_dev (0xfffe:0x0)
....st_ino 3 may vary by small amount
@@ -55,6 +54,7 @@ Exercise the reentrant version _link_r -- Expect ENOENT
Unlink /tmp/bha using the reentrant version -- OK
mknod with bad type - expect EINVAL
open /tmp/bha in write only mode -- OK
+attempt fcntl on opened file -- OK
attempt to read from /tmp/bha - expect EINVAL
closing and unlinking /tmp/bha
open /tmp/bha in read only mode -- OK
@@ -192,7 +192,7 @@ This is call 5 to fprintf
........j (file 130)
....imfs/
........hidden_on_mount/
-*************** End of Dump ***************
+*************** End of Dump ***************
truncate /tmp/j to length of 40
....st_dev (0xfffe:0x0)
....st_ino 17 may vary by small amount
@@ -221,7 +221,7 @@ truncate /tmp/j to length of 40
........j (file 40)
....imfs/
........hidden_on_mount/
-*************** End of Dump ***************
+*************** End of Dump ***************
truncate /tmp/j to length of 0
truncate /tmp to length of 0 should fail with EISDIR
@@ -242,7 +242,7 @@ truncate /tmp to length of 0 should fail with EISDIR
........j (file 0)
....imfs/
........hidden_on_mount/
-*************** End of Dump ***************
+*************** End of Dump ***************
Writing First File
Writing Second File
(0)this is a test line
diff --git a/testsuites/psxtests/psxfile01/test.c b/testsuites/psxtests/psxfile01/test.c
index aa194dccd1..352ac084fb 100644
--- a/testsuites/psxtests/psxfile01/test.c
+++ b/testsuites/psxtests/psxfile01/test.c
@@ -374,7 +374,11 @@ int main(
puts( "open /tmp/bha in write only mode -- OK" );
fd = open( "/tmp/bha", O_CREAT | O_WRONLY, S_IRWXU|S_IRWXG|S_IRWXO );
rtems_test_assert( fd != -1 );
-
+
+ puts( "attempt fcntl on opened file -- OK" );
+ status = fcntl( fd, F_SETFD, 0 );
+ rtems_test_assert( status == 0 );
+
puts( "attempt to read from /tmp/bha - expect EINVAL" );
status = read( fd, buffer, 10 );
rtems_test_assert( status == -1 );