forked from Imagelibrary/rtems
2009-05-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: New test to exercise rtems_workspace_XXX methods. * spwkspace/.cvsignore, spwkspace/Makefile.am, spwkspace/init.c, spwkspace/spwkspace.scn, spwkspace/system.h: New files.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2009-05-13 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* Makefile.am, configure.ac: New test to exercise rtems_workspace_XXX
|
||||||
|
methods.
|
||||||
|
* spwkspace/.cvsignore, spwkspace/Makefile.am, spwkspace/init.c,
|
||||||
|
spwkspace/spwkspace.scn, spwkspace/system.h: New files.
|
||||||
|
|
||||||
2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* sp04/system.h, sp04/task1.c, sp04/tswitch.c, sp07/init.c,
|
* sp04/system.h, sp04/task1.c, sp04/tswitch.c, sp07/init.c,
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \
|
|||||||
sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
|
sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
|
||||||
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
|
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
|
||||||
sp45 sp46 sp47 sp48 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
|
sp45 sp46 sp47 sp48 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
|
||||||
spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09 spobjgetnext
|
spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09 spobjgetnext \
|
||||||
|
spwkspace
|
||||||
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
|
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
|
||||||
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
|
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
|
||||||
|
|||||||
@@ -86,5 +86,6 @@ spfatal07/Makefile
|
|||||||
spfatal08/Makefile
|
spfatal08/Makefile
|
||||||
spfatal09/Makefile
|
spfatal09/Makefile
|
||||||
spobjgetnext/Makefile
|
spobjgetnext/Makefile
|
||||||
|
spwkspace/Makefile
|
||||||
])
|
])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
2
testsuites/sptests/spwkspace/.cvsignore
Normal file
2
testsuites/sptests/spwkspace/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
27
testsuites/sptests/spwkspace/Makefile.am
Normal file
27
testsuites/sptests/spwkspace/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
##
|
||||||
|
## $Id$
|
||||||
|
##
|
||||||
|
|
||||||
|
MANAGERS = all
|
||||||
|
|
||||||
|
rtems_tests_PROGRAMS = spwkspace
|
||||||
|
spwkspace_SOURCES = init.c system.h
|
||||||
|
|
||||||
|
dist_rtems_tests_DATA = spwkspace.scn
|
||||||
|
|
||||||
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||||
|
include $(top_srcdir)/../automake/compile.am
|
||||||
|
include $(top_srcdir)/../automake/leaf.am
|
||||||
|
|
||||||
|
spwkspace_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||||
|
|
||||||
|
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||||
|
|
||||||
|
LINK_OBJS = $(spwkspace_OBJECTS) $(spwkspace_LDADD)
|
||||||
|
LINK_LIBS = $(spwkspace_LDLIBS)
|
||||||
|
|
||||||
|
spwkspace$(EXEEXT): $(spwkspace_OBJECTS) $(spwkspace_DEPENDENCIES)
|
||||||
|
@rm -f spwkspace$(EXEEXT)
|
||||||
|
$(make-exe)
|
||||||
|
|
||||||
|
include $(top_srcdir)/../automake/local.am
|
||||||
63
testsuites/sptests/spwkspace/init.c
Normal file
63
testsuites/sptests/spwkspace/init.c
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Exercise SuperCore Object Get Next
|
||||||
|
*
|
||||||
|
* 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$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CONFIGURE_INIT
|
||||||
|
#include "system.h"
|
||||||
|
|
||||||
|
rtems_task Init(
|
||||||
|
rtems_task_argument argument
|
||||||
|
)
|
||||||
|
{
|
||||||
|
void *p1;
|
||||||
|
bool retbool;
|
||||||
|
Heap_Information_block info;
|
||||||
|
|
||||||
|
puts( "\n\n*** TEST WORKSPACE CLASSIC API ***" );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_get_information - null pointer" );
|
||||||
|
retbool = rtems_workspace_get_information( NULL );
|
||||||
|
assert( retbool == false );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_get_information - OK" );
|
||||||
|
retbool = rtems_workspace_get_information( &info );
|
||||||
|
assert( retbool == true );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_allocate - null pointer" );
|
||||||
|
retbool = rtems_workspace_allocate( 42, NULL );
|
||||||
|
assert( retbool == false );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_allocate - 0 bytes" );
|
||||||
|
retbool = rtems_workspace_allocate( 0, &p1 );
|
||||||
|
assert( retbool == false );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_allocate - too many bytes" );
|
||||||
|
retbool = rtems_workspace_allocate( info.Free.largest * 2, &p1 );
|
||||||
|
assert( retbool == false );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_allocate - 42 bytes" );
|
||||||
|
retbool = rtems_workspace_allocate( 42, &p1 );
|
||||||
|
assert( retbool == true );
|
||||||
|
assert( p1 != NULL );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_free - NULL" );
|
||||||
|
retbool = rtems_workspace_free( NULL );
|
||||||
|
assert( retbool == false );
|
||||||
|
|
||||||
|
puts( "rtems_workspace_free - previous pointer to 42 bytes" );
|
||||||
|
retbool = rtems_workspace_free( p1 );
|
||||||
|
assert( retbool == true );
|
||||||
|
|
||||||
|
|
||||||
|
puts( "*** END OF TEST WORKSPACE CLASSIC API ***" );
|
||||||
|
rtems_test_exit( 0 );
|
||||||
|
}
|
||||||
10
testsuites/sptests/spwkspace/spwkspace.scn
Normal file
10
testsuites/sptests/spwkspace/spwkspace.scn
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
*** TEST WORKSPACE CLASSIC API ***
|
||||||
|
rtems_workspace_get_information - null pointer
|
||||||
|
rtems_workspace_get_information - OK
|
||||||
|
rtems_workspace_allocate - null pointer
|
||||||
|
rtems_workspace_allocate - 0 bytes
|
||||||
|
rtems_workspace_allocate - too many bytes
|
||||||
|
rtems_workspace_allocate - 42 bytes
|
||||||
|
rtems_workspace_free - NULL
|
||||||
|
rtems_workspace_free - previous pointer to 42 bytes
|
||||||
|
*** END OF TEST WORKSPACE CLASSIC API ***
|
||||||
31
testsuites/sptests/spwkspace/system.h
Normal file
31
testsuites/sptests/spwkspace/system.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* 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 <tmacros.h>
|
||||||
|
|
||||||
|
/* functions */
|
||||||
|
|
||||||
|
rtems_task Init(
|
||||||
|
rtems_task_argument argument
|
||||||
|
);
|
||||||
|
|
||||||
|
/* configuration information */
|
||||||
|
|
||||||
|
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||||
|
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
|
||||||
|
|
||||||
|
#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