summaryrefslogtreecommitdiffstats
path: root/c/src/tests/sptests/sp29/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-05 22:03:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-05 22:03:44 +0000
commit280c4ca92112b34f25ad834946c1b8da64490f56 (patch)
tree60c04d0985da9c980cf40c750f02133bb0aaae1b /c/src/tests/sptests/sp29/init.c
parentChanged screen to reflect change in object class numbers with ITRON (diff)
downloadrtems-280c4ca92112b34f25ad834946c1b8da64490f56.tar.bz2
Corrected test and screen to reflect implementation working.
Diffstat (limited to 'c/src/tests/sptests/sp29/init.c')
-rw-r--r--c/src/tests/sptests/sp29/init.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/c/src/tests/sptests/sp29/init.c b/c/src/tests/sptests/sp29/init.c
index a016ebca4b..b8a0193ef2 100644
--- a/c/src/tests/sptests/sp29/init.c
+++ b/c/src/tests/sptests/sp29/init.c
@@ -67,6 +67,9 @@ rtems_task Init (rtems_task_argument ignored)
rtems_status_code sc;
rtems_interval then, now;
+ puts( "*** SP29 - SIMPLE SEMAPHORE TEST ***" );
+ puts( "This test only prints on errors." );
+
sc = rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
if (sc != RTEMS_SUCCESSFUL) {
printf ("Can't get ticks per second: %s\n", rtems_status_text (sc));
@@ -83,7 +86,7 @@ rtems_task Init (rtems_task_argument ignored)
}
sc = rtems_semaphore_create (rtems_build_name ('S', 'M', 'n', 'c'),
1,
- RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_NO_NESTING_ALLOWED|RTEMS_INHERIT_PRIORITY |RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
+ RTEMS_PRIORITY|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY |RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
0,
&semnorec);
if (sc != RTEMS_SUCCESSFUL) {
@@ -151,8 +154,8 @@ rtems_task Init (rtems_task_argument ignored)
if (sc == RTEMS_SUCCESSFUL) {
printf ("%d: Reobtain non-recursive-lock semaphore -- and should not have.\n", __LINE__);
}
- else if (sc != RTEMS_UNSATISFIED) {
- printf ("%d: Reobtain non-recursive-lock semaphore failed, but error is %d (%s), not RTEMS_UNSATISFIED.\n", __LINE__, sc, rtems_status_text (sc));
+ else if (sc != RTEMS_TIMEOUT) {
+ printf ("%d: Reobtain non-recursive-lock semaphore failed, but error is %d (%s), not RTEMS_TIMEOUT.\n", __LINE__, sc, rtems_status_text (sc));
}
if ((then - now) < 4)
printf ("%d: Reobtain non-recursive-lock semaphore failed without timeout.\n", __LINE__);
@@ -168,9 +171,10 @@ rtems_task Init (rtems_task_argument ignored)
then = now;
if (sc != RTEMS_SUCCESSFUL)
printf ("%d: Failed to obtain non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc));
- else if (diff < (2 * ticksPerSecond + 1))
- printf ("%d: Obtained obtain non-recursive-lock semaphore too quickly -- %d ticks\n", __LINE__, diff);
+ else if (diff < (2 * ticksPerSecond))
+ printf ("%d: Obtained obtain non-recursive-lock semaphore too quickly -- %d ticks not %d ticks\n", __LINE__, diff, (2 * ticksPerSecond) );
}
+ puts( "*** END OF SP29 ***" );
exit (0);
}