Index: testsuites/sptests/ChangeLog
===================================================================
--- testsuites/sptests/ChangeLog	(revision eb37f9dc5d00c381717376d0dfd00ce86107b3a0)
+++ testsuites/sptests/ChangeLog	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
@@ -1,2 +1,8 @@
+2009-12-08	Glenn Humphrey <glenn.humphrey@OARcorp.com>
+
+	* Makefile.am, configure.ac: Added a test for rate_monotonic_get_status
+	to ensure that all paths are tested.
+	* sp69/Makefile.am, sp69/init.c, sp69/sp69.doc, sp69/sp69.scn: New files.
+
 2009-12-08	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: testsuites/sptests/Makefile.am
===================================================================
--- testsuites/sptests/Makefile.am	(revision eb37f9dc5d00c381717376d0dfd00ce86107b3a0)
+++ testsuites/sptests/Makefile.am	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
@@ -14,5 +14,5 @@
     sp40 sp41 sp42 sp43 sp44 sp45 sp46 sp47 sp48 sp49 \
     sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 sp58 sp59 \
-    sp60 sp61 sp62 sp63 sp64 sp65 sp66 sp67 sp68 \
+    sp60 sp61 sp62 sp63 sp64 sp65 sp66 sp67 sp68 sp69 \
     spchain spclockget spcoverage spobjgetnext spnotepad01 spprintk spsize \
     spstkalloc spthreadq01 spwatchdog spwkspace \
Index: testsuites/sptests/configure.ac
===================================================================
--- testsuites/sptests/configure.ac	(revision eb37f9dc5d00c381717376d0dfd00ce86107b3a0)
+++ testsuites/sptests/configure.ac	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
@@ -95,4 +95,5 @@
 sp67/Makefile
 sp68/Makefile
+sp69/Makefile
 spchain/Makefile
 spclockget/Makefile
Index: testsuites/sptests/sp69/Makefile.am
===================================================================
--- testsuites/sptests/sp69/Makefile.am	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
+++ testsuites/sptests/sp69/Makefile.am	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp69
+sp69_SOURCES = init.c ../../support/src/spin.c
+
+dist_rtems_tests_DATA = sp69.scn
+dist_rtems_tests_DATA += sp69.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp69_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(sp69_OBJECTS) $(sp69_LDADD)
+LINK_LIBS = $(sp69_LDLIBS)
+
+sp69$(EXEEXT): $(sp69_OBJECTS) $(sp69_DEPENDENCIES)
+	@rm -f sp69$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/sptests/sp69/init.c
===================================================================
--- testsuites/sptests/sp69/init.c	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
+++ testsuites/sptests/sp69/init.c	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
@@ -0,0 +1,164 @@
+/*
+ *  COPYRIGHT (c) 1989-2009.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <rtems/cpuuse.h>
+#include <tmacros.h>
+#include "test_support.h"
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  rtems_id                            period_id;
+  rtems_name                          period_name;
+  rtems_rate_monotonic_period_status  period_status;
+  rtems_status_code                   status;
+
+  period_name = rtems_build_name('P','E','R','1');
+
+  puts( "\n\n*** TEST 69 ***" );
+
+  /* create period */
+  status = rtems_rate_monotonic_create(
+      period_name,
+      &period_id
+  );
+  directive_failed( status, "rate_monotonic_create" );
+
+  /*
+   * Check get_status on an inactive period.
+   */
+  puts(
+    "rtems_rate_monotonic_get_status - verify values of an inactive period"
+  );
+
+  status = rtems_rate_monotonic_get_status( period_id, &period_status );
+  directive_failed( status, "rate_monotonic_get_status" );
+
+  /* Check status values. */
+  rtems_test_assert( period_status.owner == rtems_task_self() );
+  rtems_test_assert( period_status.state == RATE_MONOTONIC_INACTIVE );
+  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
+    rtems_test_assert( period_status.since_last_period.tv_sec == 0 );
+    rtems_test_assert( period_status.since_last_period.tv_nsec == 0 );
+    rtems_test_assert( period_status.executed_since_last_period.tv_sec == 0 );
+    rtems_test_assert( period_status.executed_since_last_period.tv_nsec == 0 );
+  #else
+    rtems_test_assert( period_status.since_last_period == 0 );
+    rtems_test_assert( period_status.executed_since_last_period == 0 );
+  #endif
+
+  /*
+   * Check get_status error cases.
+   */
+  puts( "rtems_rate_monotonic_get_status - check RTEMS_NOT_DEFINED" );
+
+  /* Do some work to get a non-zero cpu usage */
+  rtems_test_spin_for_ticks( 10 );
+
+  status = rtems_rate_monotonic_period( period_id, 100 );
+  directive_failed( status, "rate_monotonic_period" );
+
+  /* Do some more work */
+  rtems_test_spin_for_ticks( 10 );
+
+  /* Reset the cpu usage statistics. */
+  rtems_cpu_usage_reset();
+
+  /* Status should be undefined. */
+  status = rtems_rate_monotonic_get_status( period_id, &period_status );
+  fatal_directive_status(
+    status,
+    RTEMS_NOT_DEFINED,
+    "rtems_rate_monotonic_get_status after cpu usage reset"
+  );
+
+  /* Clean up. */
+  status = rtems_rate_monotonic_cancel( period_id );
+  directive_failed( status, "rate_monotonic_cancel" );
+
+  /*
+   * Check normal get_status results.
+   */
+  puts(
+    "rtems_rate_monotonic_get_status - verify values of an active period"
+  );
+  rtems_test_spin_until_next_tick();
+  status = rtems_rate_monotonic_period( period_id, 100 );
+  directive_failed( status, "rate_monotonic_period" );
+
+  /* Do some work */
+  rtems_test_spin_for_ticks( 10 );
+
+  /* Block a little */
+  status = rtems_task_wake_after( 50 );
+
+  /* Check the status */
+  status = rtems_rate_monotonic_get_status( period_id, &period_status );
+  directive_failed( status, "rate_monotonic_get_status" );
+
+  /* Check status values. */
+  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
+    printf(
+      "wall time should be ~600000000 is %d\n",
+      period_status.since_last_period.tv_nsec
+    );
+    printf(
+      "cpu time should be ~100000000 is %d\n",
+      period_status.executed_since_last_period.tv_nsec
+    );
+    rtems_test_assert( period_status.since_last_period.tv_sec == 0 );
+    rtems_test_assert( period_status.since_last_period.tv_nsec >= 600000000 );
+    rtems_test_assert( period_status.since_last_period.tv_nsec <= 610000000 );
+    rtems_test_assert( period_status.executed_since_last_period.tv_sec == 0 );
+    rtems_test_assert(
+      period_status.executed_since_last_period.tv_nsec >= 100000000
+    );
+    rtems_test_assert(
+      period_status.executed_since_last_period.tv_nsec <= 110000000
+    );
+  #else
+    printf(
+      "wall time should be ~60 is %d\n",
+      (int) period_status.since_last_period
+    );
+    printf(
+      "cpu time should be ~10 is %d\n",
+      (int) period_status.executed_since_last_period
+    );
+    rtems_test_assert( period_status.since_last_period >= 60 );
+    rtems_test_assert( period_status.since_last_period <= 61 );
+    rtems_test_assert( period_status.executed_since_last_period >= 10 );
+    rtems_test_assert( period_status.executed_since_last_period <= 12 );
+  #endif
+
+  puts("*** END OF TEST 69 ***");
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MILLISECONDS_PER_TICK 1
+
+#define CONFIGURE_MAXIMUM_TASKS             1
+#define CONFIGURE_MAXIMUM_PERIODS           1
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
Index: testsuites/sptests/sp69/sp69.scn
===================================================================
--- testsuites/sptests/sp69/sp69.scn	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
+++ testsuites/sptests/sp69/sp69.scn	(revision 7199b1d0dcd4d56ffd7c21091a1e62c6a799cf06)
@@ -0,0 +1,7 @@
+*** TEST 69 ***
+rtems_rate_monotonic_get_status - verify values of an inactive period
+rtems_rate_monotonic_get_status - check RTEMS_NOT_DEFINED
+rtems_rate_monotonic_get_status - verify values of an active period
+wall time should be ~600000000 is 609216000
+cpu time should be ~100000000 is 109217000
+*** END OF TEST 69 ***
