Index: testsuites/sptests/ChangeLog
===================================================================
--- testsuites/sptests/ChangeLog	(revision eecb54552d93d0a2791811cac96a34e9efad5311)
+++ testsuites/sptests/ChangeLog	(revision 96b87626103fccf3dc8e3281146d29f7e23079c3)
@@ -1,2 +1,8 @@
+2009-07-24	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* sp40/Makefile.am, sp40/init.c, sp40/sp40.scn: Attempt to write test
+	to catch two remaining uncovered cases in rtems_io_register_driver.
+	* sp40/system.h: Removed.
+
 2009-07-24	Joel Sherrill <joel.sherrill@OARcorp.com>
 
Index: testsuites/sptests/sp40/Makefile.am
===================================================================
--- testsuites/sptests/sp40/Makefile.am	(revision eecb54552d93d0a2791811cac96a34e9efad5311)
+++ testsuites/sptests/sp40/Makefile.am	(revision 96b87626103fccf3dc8e3281146d29f7e23079c3)
@@ -6,5 +6,5 @@
 
 rtems_tests_PROGRAMS = sp40
-sp40_SOURCES = init.c system.h
+sp40_SOURCES = init.c
 
 dist_rtems_tests_DATA = sp40.scn
Index: testsuites/sptests/sp40/init.c
===================================================================
--- testsuites/sptests/sp40/init.c	(revision eecb54552d93d0a2791811cac96a34e9efad5311)
+++ testsuites/sptests/sp40/init.c	(revision 96b87626103fccf3dc8e3281146d29f7e23079c3)
@@ -12,29 +12,72 @@
  */
 
-#define CONFIGURE_INIT
-#include "system.h"
+#include <tmacros.h>
 
+rtems_device_driver test_open(
+     rtems_device_major_number  minor,
+     rtems_device_minor_number  major,
+     void                      *ignored
+)
+{
+}
+
+rtems_driver_address_table test_driver = {
+  NULL,                               /* initialization procedure */
+  test_open,                          /* open request procedure */
+  NULL,                               /* close request procedure */
+  NULL,                               /* read request procedure */
+  NULL,                               /* write request procedure */
+  NULL,                               /* special functions procedure */
+};
 rtems_task Init(
   rtems_task_argument argument
 )
 {
+  rtems_status_code         sc;
+  rtems_device_major_number registered;
+
   puts( "\n\n*** TEST 40 ***" );
 
-  puts( "TBD - Write test case matching this description" );
-
   /*
-   *  Register two drivers to fill up the table
+   *  Register a driver with init == NULL and open != NULL
    */
 
-  /* add major = 4 */
+  puts( "Init - rtems_io_register_driver - init == NULL, open != NULL OK" );
+  sc = rtems_io_register_driver( 0, &test_driver, &registered );
+  printf( "Init - Major slot returned = %d\n", (int) registered );
+  directive_failed( sc, "rtems_io_register_driver" );
 
-  /* add major = 3 */
-
-  /*
-   *  Unregister major = 3 to leave slot which is not at
-   *  the end of the Driver Table.
-   */
+  puts( "Init - rtems_io_register_driver - used slot" );
+  sc = rtems_io_register_driver( 1, &test_driver, &registered );
+  fatal_directive_status(
+    sc,
+    RTEMS_RESOURCE_IN_USE,
+    "rtems_io_register_driver slot in use"
+  );
 
   puts( "*** END OF TEST 40 ***" );
   rtems_test_exit( 0 );
 }
+
+
+/* functions */
+
+rtems_task Init(
+  rtems_task_argument argument
+);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+/* more one more driver slot than are statically configured */
+#define CONFIGURE_MAXIMUM_DRIVERS 4
+
+#define CONFIGURE_MAXIMUM_TASKS  1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* end of include file */
Index: testsuites/sptests/sp40/sp40.scn
===================================================================
--- testsuites/sptests/sp40/sp40.scn	(revision eecb54552d93d0a2791811cac96a34e9efad5311)
+++ testsuites/sptests/sp40/sp40.scn	(revision 96b87626103fccf3dc8e3281146d29f7e23079c3)
@@ -1,3 +1,5 @@
 *** TEST 40 ***
-TBD - Write test case matching this description
+Init - rtems_io_register_driver - init == NULL, open != NULL OK
+Init - Major slot returned = 3
+Init - rtems_io_register_driver - used slot
 *** END OF TEST 40 ***
Index: stsuites/sptests/sp40/system.h
===================================================================
--- testsuites/sptests/sp40/system.h	(revision eecb54552d93d0a2791811cac96a34e9efad5311)
+++ 	(revision )
@@ -1,38 +1,0 @@
-/*  system.h
- *
- *  This include file contains information that is included in every
- *  function in the test set.
- *
- *  COPYRIGHT (c) 1989-2007.
- *  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 <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
-  rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-
-/* more driver slots than are statically configured */
-#define CONFIGURE_MAXIMUM_DRIVERS 4
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_MAXIMUM_TASKS  1
-
-#include <rtems/confdefs.h>
-
-/* end of include file */
