summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxstat/test.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-13 21:13:13 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-13 21:13:13 +0000
commitb05cc329587c7b42d03f291410b5ba9caf8c92b6 (patch)
tree90113ab40c2a00b8d16d0b44f4bd40bb44889270 /testsuites/psxtests/psxstat/test.c
parent2010-07-12 Jennifer Averett (diff)
downloadrtems-b05cc329587c7b42d03f291410b5ba9caf8c92b6.tar.bz2
2010-07-12 Bharath Suri <bharath.s.jois@gmail.com>
PR 1613/testing * psxfchx01/init.c, psxfchx01/Makefile.am, psxfchx01/.cvsignore, psxfchx01/psxfchx01.doc, psxfchx01/psxfchx01.scn: New tests. Improves coverage of fchdir, fchmod, fchown directives. * configure.ac, Makefile.am: Changes to accommodate new test. * psxstat/test.c, psxstat/psxstat.scn: Added new test case to test statvfs routine under libcsupport.
Diffstat (limited to 'testsuites/psxtests/psxstat/test.c')
-rw-r--r--testsuites/psxtests/psxstat/test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxstat/test.c b/testsuites/psxtests/psxstat/test.c
index 0549806763..90f1431dfc 100644
--- a/testsuites/psxtests/psxstat/test.c
+++ b/testsuites/psxtests/psxstat/test.c
@@ -774,6 +774,29 @@ void Show_Time(void)
print_time( " - rtems_clock_get_tod - ", &time, "\n" );
}
+void test_statvfs( void )
+{
+
+ int status = 0;
+ struct statvfs stat;
+
+ puts( "statvfs, with invalid path - expect EFAULT" );
+ status = statvfs( NULL , &stat );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ puts( "create /tmp -- OK" );
+ status = mkdir( "/tmp", 0777 );
+ rtems_test_assert( status == 0 );
+
+ puts( "statvfs, with valid path - expect ENOTSUP" );
+ status = statvfs( "/tmp", &stat );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTSUP );
+
+ puts( "statvfs tested!" );
+}
+
/*
* main entry point to the test
*/
@@ -902,6 +925,8 @@ int main(
status = rtems_task_wake_after( TIMEOUT_VALUE );
lchown_multiple_files( SymLinks );
+ test_statvfs();
+
puts( "\n\n*** END OF STAT TEST 01 ***" );
rtems_test_exit(0);
}