Changeset 21827289 in rtems


Ignore:
Timestamp:
Jul 8, 2010, 7:37:01 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
c33c353
Parents:
c302d31a
Message:

2010-07-08 Bharath Suri <bharath.s.jois@…>

PR 1608/testing

  • psxfile01/init.c: Add a simple test case: Open file as read-only and attemp to truncate. Improves coverage.
Location:
testsuites/psxtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    rc302d31a r21827289  
     12010-07-08      Bharath Suri <bharath.s.jois@gmail.com>
     2
     3        PR 1608/testing
     4        * psxfile01/init.c: Add a simple test case: Open file as read-only
     5        and attemp to truncate. Improves coverage.
     6
    172010-07-07      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • testsuites/psxtests/psxfile01/psxfile01.scn

    rc302d31a r21827289  
    1 sparc-rtems4.11-run is /opt/rtems-4.11/bin/sparc-rtems4.11-run
    2 
    31
    42*** FILE TEST 1 ***
     
    75....dev/
    86........console (device 0, 0)
    9 ........console_b (device 0, 1)
    107***************       End of Dump        ***************
    118stat of /dev/console
     
    5249create /tmp/john
    5350tcdrain /tmp/john
     51Attempt to create a file, open in read-only mode and truncate it
    5452mknod /tmp/joel
    5553(0)the first write!!!
     
    169167....dev/
    170168........console (device 0, 0)
    171 ........console_b (device 0, 1)
    172169........tty/
    173 ............S3 (device 255, 128)
     170............S3 (device 128, 255)
    174171........test_console (device 0, 0)
    175172....etc/
     
    200197....dev/
    201198........console (device 0, 0)
    202 ........console_b (device 0, 1)
    203199........tty/
    204 ............S3 (device 255, 128)
     200............S3 (device 128, 255)
    205201........test_console (device 0, 0)
    206202....etc/
     
    222218....dev/
    223219........console (device 0, 0)
    224 ........console_b (device 0, 1)
    225220........tty/
    226 ............S3 (device 255, 128)
     221............S3 (device 128, 255)
    227222........test_console (device 0, 0)
    228223....etc/
  • testsuites/psxtests/psxfile01/test.c

    rc302d31a r21827289  
    330330  rtems_test_assert( status == 0 );
    331331
     332  /*
     333   * Open a file in read-only mode and try to truncate
     334   */
     335
     336  puts( "Attempt to create a file, open in read-only mode and truncate it" );
     337  fd = open( "/tmp/bha", O_CREAT | O_RDONLY | O_TRUNC, S_IRUSR );
     338  rtems_test_assert( fd == -1 );
     339  rtems_test_assert( errno == EINVAL );
     340
     341  status = unlink( "/tmp/bha" );
     342  rtems_test_assert( status == 0 );
     343
    332344  /*
    333345   *  Test simple write to a file at offset 0
Note: See TracChangeset for help on using the changeset viewer.