summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-21 13:14:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-21 13:14:37 +0000
commitf343b668acc9289a0c04550b7fb12709ac8abc2d (patch)
treed69a86c5d349b661cf6caf2bd53beca76b1dfae5 /testsuites
parentAdd missing files. (diff)
downloadrtems-f343b668acc9289a0c04550b7fb12709ac8abc2d.tar.bz2
2009-09-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxclock/init.c, psxclock/psxclock.scn: Add test case for negative nanoseconds.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/psxtests/ChangeLog5
-rw-r--r--testsuites/psxtests/psxclock/init.c12
-rw-r--r--testsuites/psxtests/psxclock/psxclock.scn3
3 files changed, 17 insertions, 3 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog
index 1bd5d1fcef..a5b89b287b 100644
--- a/testsuites/psxtests/ChangeLog
+++ b/testsuites/psxtests/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * psxclock/init.c, psxclock/psxclock.scn: Add test case for negative
+ nanoseconds.
+
2009-09-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxsysconf/init.c, psxsysconf/psxsysconf.scn: Add test for
diff --git a/testsuites/psxtests/psxclock/init.c b/testsuites/psxtests/psxclock/init.c
index ac34d4ccde..a18231bb9c 100644
--- a/testsuites/psxtests/psxclock/init.c
+++ b/testsuites/psxtests/psxclock/init.c
@@ -147,10 +147,18 @@ rtems_task Init(
rtems_test_assert( sc == -1 );
rtems_test_assert( errno == EINVAL );
- /* this is actually a small delay or yield */
+ /* this is an error */
tv.tv_sec = -1;
tv.tv_nsec = 0;
- puts( "Init: nanosleep - negative seconds small delay " );
+ puts( "Init: nanosleep - negative seconds - EINVAL" );
+ sc = nanosleep ( &tv, &tr );
+ rtems_test_assert( sc == -1 );
+ rtems_test_assert( errno == EINVAL );
+
+ /* this is also an error */
+ tv.tv_sec = 0;
+ tv.tv_nsec = -1;
+ puts( "Init: nanosleep - negative nanoseconds - EINVAL" );
sc = nanosleep ( &tv, &tr );
rtems_test_assert( sc == -1 );
rtems_test_assert( errno == EINVAL );
diff --git a/testsuites/psxtests/psxclock/psxclock.scn b/testsuites/psxtests/psxclock/psxclock.scn
index c5b3e1e062..1144faa726 100644
--- a/testsuites/psxtests/psxclock/psxclock.scn
+++ b/testsuites/psxtests/psxclock/psxclock.scn
@@ -20,7 +20,8 @@ Init: seconds remaining (0)
Init: nanosleep - EINVAL (NULL time)
Init: nanosleep - EINVAL (too many nanoseconds)
-Init: nanosleep - negative seconds small delay
+Init: nanosleep - negative seconds - EINVAL
+Init: nanosleep - negative nanoseconds - EINVAL
Init: nanosleep - delay so small results in one tick
Init: nanosleep - yield with remaining
Init: nanosleep - yield with NULL time remaining