diff options
author | Chris Johns <chrisj@rtems.org> | 2017-10-19 16:39:16 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2017-10-23 16:25:45 +1100 |
commit | 98c6d501452f02264ff148a1b8479e420c81562d (patch) | |
tree | 8c6cd90ccd1df98f782396d94d6acdbfe5d042cb /testsuites/psxtests/psximfs01 | |
parent | posix: Fix POSIX disabled build (diff) | |
download | rtems-98c6d501452f02264ff148a1b8479e420c81562d.tar.bz2 |
testsuite: Use printk for all test output where possible.
- Remove the printf support leaving the direct printk support configured
with TESTS_USE_PRINTK and all other output goes via a buffered vsniprintf
call to printk.
- Control the test's single init for functions and global data with
TEST_INIT and not CONFIGURE_INIT. They are now separate.
Updates #3170.
Diffstat (limited to 'testsuites/psxtests/psximfs01')
-rw-r--r-- | testsuites/psxtests/psximfs01/init.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/testsuites/psxtests/psximfs01/init.c b/testsuites/psxtests/psximfs01/init.c index 76bb156daf..380ece7b60 100644 --- a/testsuites/psxtests/psximfs01/init.c +++ b/testsuites/psxtests/psximfs01/init.c @@ -11,6 +11,8 @@ #include "config.h" #endif +#define TEST_INIT + #include <tmacros.h> #include "test_support.h" @@ -70,8 +72,7 @@ void write_helper(void) printf( "Total written = %zd\n", TotalWritten ); return; } - fprintf( - stderr, + printf( "Unable to create largest IMFS file (error=%s)\n", strerror(errno) ); @@ -79,7 +80,7 @@ void write_helper(void) } TotalWritten += written; } while (1); - + } void read_helper(void) @@ -93,8 +94,7 @@ void read_helper(void) sc = read( TestFd, &ch, sizeof(ch) ); if ( sc == 1 ) { if ( ch != (i%256) ) { - fprintf( - stderr, + printf( "MISMATCH 0x%02x != 0x%02x at offset %d\n", ch, i % 256, @@ -104,8 +104,7 @@ void read_helper(void) } i++; } else if ( sc != 0 ) { - fprintf( - stderr, + printf( "ERROR - at offset %d - returned %zd and error=%s\n", i, sc, @@ -139,12 +138,11 @@ void truncate_helper(void) rc = ftruncate( TestFd, new ); if ( rc != 0 ) { - fprintf( - stderr, - "ERROR - at offset %d - returned %d and error=%s\n", - (int) new, - rc, - strerror( errno ) + printf( + "ERROR - at offset %d - returned %d and error=%s\n", + (int) new, + rc, + strerror( errno ) ); } rtems_test_assert( rc == 0 ); @@ -162,8 +160,8 @@ void extend_helper(int eno) position = lseek( TestFd, 0, SEEK_END ); printf( "Seek to end .. returned %d\n", (int) position ); - /* - * test case to ftruncate a file to a length > its size + /* + * test case to ftruncate a file to a length > its size */ rc = ftruncate( TestFd, 2 ); @@ -178,12 +176,11 @@ void extend_helper(int eno) rc = ftruncate( TestFd, new ); if ( rc != 0 ) { if( errno != eno ) { - fprintf( - stderr, - "ERROR - at offset %d - returned %d and error=%s\n", - (int) new, - rc, - strerror( errno ) + printf( + "ERROR - at offset %d - returned %d and error=%s\n", + (int) new, + rc, + strerror( errno ) ); break; } @@ -239,7 +236,7 @@ rtems_task Init( open_it(true, false); read_helper(); close_it(); - + open_it(false, false); truncate_helper(); @@ -250,7 +247,7 @@ rtems_task Init( extend_helper(ENOSPC); - /* + /* * free the allocated heap memory */ free(alloc_ptr); |