forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
* Makefile.am, configure.ac: Add new test to exercise odd case in
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = sp40
|
||||
sp40_SOURCES = init.c system.h
|
||||
sp40_SOURCES = init.c
|
||||
|
||||
dist_rtems_tests_DATA = sp40.scn
|
||||
|
||||
|
||||
@@ -11,30 +11,73 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#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, ®istered );
|
||||
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, ®istered );
|
||||
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 */
|
||||
|
||||
@@ -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 ***
|
||||
|
||||
@@ -1,38 +0,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 */
|
||||
Reference in New Issue
Block a user