summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-15 13:59:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-15 13:59:25 +0000
commit947015fbf3fe206ac59dbe90a16f1de8db7f112c (patch)
tree74d49c89d77bdab182bd84a6059000d3cde0cce1
parent2010-07-15 Bharath Suri <bharath.s.jois@gmail.com> (diff)
downloadrtems-947015fbf3fe206ac59dbe90a16f1de8db7f112c.tar.bz2
2010-07-15 Bharath Suri <bharath.s.jois@gmail.com>
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.
-rw-r--r--testsuites/psxtests/ChangeLog10
-rw-r--r--testsuites/psxtests/psxfile01/psxfile01.scn3
-rw-r--r--testsuites/psxtests/psxfile01/test.c9
-rw-r--r--testsuites/psxtests/psxstat/psxstat.scn2
-rw-r--r--testsuites/psxtests/psxstat/test.c14
-rw-r--r--testsuites/psxtests/psxtime/psxtime.scn4
-rw-r--r--testsuites/psxtests/psxtime/test.c7
7 files changed, 45 insertions, 4 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog
index 59b802e006..8994a45093 100644
--- a/testsuites/psxtests/ChangeLog
+++ b/testsuites/psxtests/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-15 Bharath Suri <bharath.s.jois@gmail.com>
+
+ 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.
+
2010-07-16 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* psxstat/test.c: Avoid NULL pointer access.
diff --git a/testsuites/psxtests/psxfile01/psxfile01.scn b/testsuites/psxtests/psxfile01/psxfile01.scn
index f4bbe70c59..8d56722a87 100644
--- a/testsuites/psxtests/psxfile01/psxfile01.scn
+++ b/testsuites/psxtests/psxfile01/psxfile01.scn
@@ -1,4 +1,3 @@
-
*** FILE TEST 1 ***
*************** Dump of Entire IMFS ***************
/
@@ -49,6 +48,8 @@ Attempt to recreate /tmp/tom
create /tmp/john
tcdrain /tmp/john
Attempt to create a file, open in read-only mode and truncate it
+Exercise the reentrant version _link_r -- Expect EFAULT
+Unlink /tmp/bha using the reentrant version -- OK
mknod /tmp/joel
(0)the first write!!!
diff --git a/testsuites/psxtests/psxfile01/test.c b/testsuites/psxtests/psxfile01/test.c
index bcecbcea37..e376b8fe05 100644
--- a/testsuites/psxtests/psxfile01/test.c
+++ b/testsuites/psxtests/psxfile01/test.c
@@ -30,6 +30,7 @@
#include <errno.h>
#include <string.h>
#include <ctype.h>
+#include <reent.h>
#include <rtems/imfs.h>
#include <rtems.h>
@@ -338,7 +339,13 @@ int main(
rtems_test_assert( fd == -1 );
rtems_test_assert( errno == EINVAL );
- status = unlink( "/tmp/bha" );
+ puts( "Exercise the reentrant version _link_r -- Expect EFAULT" );
+ status = _link_r( NULL, NULL, NULL );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ puts( "Unlink /tmp/bha using the reentrant version -- OK" );
+ status = _unlink_r( NULL, "/tmp/bha" );
rtems_test_assert( status == 0 );
/*
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 <unistd.h>
#include <errno.h>
#include <string.h>
+#include <reent.h>
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/imfs.h>
@@ -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);
}
diff --git a/testsuites/psxtests/psxtime/psxtime.scn b/testsuites/psxtests/psxtime/psxtime.scn
index 6f6602db37..d41082d6fe 100644
--- a/testsuites/psxtests/psxtime/psxtime.scn
+++ b/testsuites/psxtests/psxtime/psxtime.scn
@@ -1,5 +1,7 @@
+
*** POSIX TIME OF DAY TEST ***
gettimeofday( NULL, NULL ) - EFAULT
+_gettimeofday( NULL, NULL ) - EFAULT
rtems_clock_set 12:45:00 01/01/1988
adjtime - NULL delta - EINVAL
adjtime - delta out of range - EINVAL
@@ -9,7 +11,7 @@ adjtime - delta of one second forward, olddelta=NULL
adjtime - delta of one second forward
adjtime - delta of almost two seconds forward
adjtime - delta of almost one second forward which bumps second
-rtems_clock_get_tod 12:45:04 01/01/1988
+rtems_clock_get_tod 12:45:05 01/01/1988
rtems_clock_set 12:45:00 01/01/1988
rtems_clock_get_tod 12:45:00 01/01/1988
gettimeofday: Fri Jan 1 12:45:00 1988
diff --git a/testsuites/psxtests/psxtime/test.c b/testsuites/psxtests/psxtime/test.c
index 41db252450..d1f056b9e6 100644
--- a/testsuites/psxtests/psxtime/test.c
+++ b/testsuites/psxtests/psxtime/test.c
@@ -27,6 +27,8 @@
extern int adjtime(const struct timeval *delta, struct timeval *olddelta);
#endif
+extern int _gettimeofday(struct timeval *__p, void *__tz);
+
void test_adjtime(void);
void check_a_tod(
rtems_time_of_day *the_tod
@@ -202,6 +204,11 @@ int main(
rtems_test_assert( sc == -1 );
rtems_test_assert( errno == EFAULT );
+ puts( "_gettimeofday( NULL, NULL ) - EFAULT" );
+ sc = _gettimeofday( NULL, NULL );
+ rtems_test_assert( sc == -1 );
+ rtems_test_assert( errno == EFAULT );
+
test_adjtime();
/*