From 947015fbf3fe206ac59dbe90a16f1de8db7f112c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 15 Jul 2010 13:59:25 +0000 Subject: 2010-07-15 Bharath Suri PR 1617/testing * psxfile01/test.c, psxfile01/psxfile01.scn: Added new cases to exercise_link_r and _unlink_r * psxstat/test.c, psxstat/psxstat.scn: Added new cases to exercise _lstat_r and _stat_r. * psxtime/test.c, psxtime/psxtime.scn: Added new cases to exercise _gettimeofday. --- testsuites/psxtests/psxstat/psxstat.scn | 2 ++ testsuites/psxtests/psxstat/test.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'testsuites/psxtests/psxstat') diff --git a/testsuites/psxtests/psxstat/psxstat.scn b/testsuites/psxtests/psxstat/psxstat.scn index c8cc62e0b7..812ab65387 100644 --- a/testsuites/psxtests/psxstat/psxstat.scn +++ b/testsuites/psxtests/psxstat/psxstat.scn @@ -1708,6 +1708,8 @@ statvfs, with invalid path - expect EFAULT create /tmp -- OK statvfs, with valid path - expect ENOTSUP statvfs tested! +Exercise the reentrant version - _stat_r - expect EFAULT +Exercise the reentrant version - _lstat_r - expect EFAULT *** END OF STAT TEST 01 *** diff --git a/testsuites/psxtests/psxstat/test.c b/testsuites/psxtests/psxstat/test.c index 58633b9c2c..6a5f864007 100644 --- a/testsuites/psxtests/psxstat/test.c +++ b/testsuites/psxtests/psxstat/test.c @@ -5,7 +5,7 @@ * This test also exercises lstat() and lchown() when symlinks are * involved. * - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,7 @@ #define MAXSYMLINK 5 /* There needs to be a better way of getting this. */ #define TIMEOUT_VALUE ( 5 * rtems_clock_get_ticks_per_second() ) +int _lstat_r(struct _reent *, const char *, struct stat *); /* * List of files which should exist. @@ -927,6 +929,16 @@ int main( test_statvfs(); + puts( "Exercise the reentrant version - _stat_r - expect EFAULT" ); + status = _stat_r( NULL, NULL, NULL ); + rtems_test_assert( status == -1 ); + rtems_test_assert( errno == EFAULT ); + + puts( "Exercise the reentrant version - _lstat_r - expect EFAULT" ); + status = _lstat_r( NULL, NULL, NULL ); + rtems_test_assert( status == -1 ); + rtems_test_assert( errno == EFAULT ); + puts( "\n\n*** END OF STAT TEST 01 ***" ); rtems_test_exit(0); } -- cgit v1.2.3