diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index 4aaf5e4324..584d178b29 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,10 @@ +2010-07-29 Bharath Suri + + PR 1633/testing + * psximfs01/init.c, psximfs01/psximfs01.scn, + psximfs01/psximfs01.doc: New cases to exercise + IMFS_memfile_remove. + 2010-07-27 Joel Sherrill * psxobj01/Makefile.am, psxobj01/init.c, psxobj01/psxobj01.scn: Add diff --git a/testsuites/psxtests/psximfs01/init.c b/testsuites/psxtests/psximfs01/init.c index ce1c7c5669..a70cd8371b 100644 --- a/testsuites/psxtests/psximfs01/init.c +++ b/testsuites/psxtests/psximfs01/init.c @@ -138,6 +138,57 @@ void truncate_helper(void) } while (new > 0); } +void extend_helper(void) +{ + off_t position; + off_t new; + off_t sc; + int rc; + + position = lseek( TestFd, 0, SEEK_END ); + printf( "Seek to end .. returned %d\n", (int) position ); + rtems_test_assert( position == 1 ); + + /* + * test case to ftruncate a file to a length > its size + */ + + rc = ftruncate( TestFd, 2 ); + rtems_test_assert( rc == 0 ); + + puts( "lseek/ftruncate loop.." ); + new = position; + do { + sc = lseek( TestFd, new, SEEK_SET ); + if( sc == -1 ) { + if( errno == ENOSPC ) { + break; + } + else { + rtems_test_assert( 0 ); + } + } + + rc = ftruncate( TestFd, new ); + if ( rc != 0 ) { + if( errno != ENOSPC ) { + fprintf( + stderr, + "ERROR - at offset %d - returned %d and error=%s\n", + (int) new, + rc, + strerror( errno ) + ); + } + else { + break; + } + } + rtems_test_assert( rc == 0 ); + ++new; + } while ( 1 ); +} + void close_it(void) { int rc; @@ -147,11 +198,25 @@ void close_it(void) rtems_test_assert( rc == 0 ); } +void unlink_it(void) +{ + int rc; + + puts( "unlink(" FILE_NAME ") - OK" ); + rc = unlink( FILE_NAME ); + rtems_test_assert( rc == 0 ); +} + +extern Heap_Control *RTEMS_Malloc_Heap; + rtems_task Init( rtems_task_argument argument ) { int i; + void *alloc_ptr = (void *)0; + Heap_Information_block Info; + puts( "\n\n*** TEST IMFS 01 ***" ); for (i=0 ; i