summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxclock/init.c
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/psxtests/psxclock/init.c
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 '')
-rw-r--r--testsuites/psxtests/psxclock/init.c12
1 files changed, 10 insertions, 2 deletions
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 );