From f343b668acc9289a0c04550b7fb12709ac8abc2d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 21 Sep 2009 13:14:37 +0000 Subject: 2009-09-21 Joel Sherrill * psxclock/init.c, psxclock/psxclock.scn: Add test case for negative nanoseconds. --- testsuites/psxtests/ChangeLog | 5 +++++ testsuites/psxtests/psxclock/init.c | 12 ++++++++++-- testsuites/psxtests/psxclock/psxclock.scn | 3 ++- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'testsuites') 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 + + * psxclock/init.c, psxclock/psxclock.scn: Add test case for negative + nanoseconds. + 2009-09-20 Joel Sherrill * 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 -- cgit v1.2.3