forked from Imagelibrary/rtems
2009-01-30 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add sp48 which tests that configuring for unlimited objects when configured for a unified workspace works as expected. * sp48/.cvsignore, sp48/Makefile.am, sp48/init.c, sp48/sp48.doc, sp48/sp48.scn: New files.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2009-01-30 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* Makefile.am, configure.ac: Add sp48 which tests that configuring for
|
||||
unlimited objects when configured for a unified workspace works as
|
||||
expected.
|
||||
* sp48/.cvsignore, sp48/Makefile.am, sp48/init.c, sp48/sp48.doc,
|
||||
sp48/sp48.scn: New files.
|
||||
|
||||
2009-01-21 Nickolay Kolchin <nbkolchin@gmail.com>
|
||||
Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ ACLOCAL_AMFLAGS = -I ../aclocal
|
||||
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 \
|
||||
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
|
||||
sp45 sp46 sp47 spsize spwatchdog spfatal01 spfatal02 spfatal03 spfatal04 \
|
||||
spfatal05 spfatal06 spfatal07 spfatal08 spfatal09
|
||||
sp45 sp46 sp47 sp48 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
|
||||
spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09
|
||||
|
||||
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
|
||||
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
|
||||
|
||||
@@ -72,6 +72,7 @@ sp44/Makefile
|
||||
sp45/Makefile
|
||||
sp46/Makefile
|
||||
sp47/Makefile
|
||||
sp48/Makefile
|
||||
spwatchdog/Makefile
|
||||
spsize/Makefile
|
||||
spfatal/Makefile
|
||||
|
||||
2
testsuites/sptests/sp48/.cvsignore
Normal file
2
testsuites/sptests/sp48/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
28
testsuites/sptests/sp48/Makefile.am
Normal file
28
testsuites/sptests/sp48/Makefile.am
Normal file
@@ -0,0 +1,28 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = sp48.exe
|
||||
sp48_exe_SOURCES = init.c
|
||||
|
||||
dist_rtems_tests_DATA = sp48.scn
|
||||
dist_rtems_tests_DATA += sp48.doc
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
sp48_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(sp48_exe_OBJECTS) $(sp48_exe_LDADD)
|
||||
LINK_LIBS = $(sp48_exe_LDLIBS)
|
||||
|
||||
sp48.exe$(EXEEXT): $(sp48_exe_OBJECTS) $(sp48_exe_DEPENDENCIES)
|
||||
@rm -f sp48.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
84
testsuites/sptests/sp48/init.c
Normal file
84
testsuites/sptests/sp48/init.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Verify creation of semaphores with unlimited attribute works.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <tmacros.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
#define MAX 5000
|
||||
rtems_id Semaphores[MAX];
|
||||
|
||||
rtems_task Init(rtems_task_argument ignored)
|
||||
{
|
||||
rtems_status_code sc;
|
||||
int i;
|
||||
int created;
|
||||
|
||||
puts( "\n\n*** TEST 48 ***" );
|
||||
|
||||
printf( "Largest C program heap block available: %d\n", malloc_free_space() );
|
||||
for (i=0 ; i<MAX ; i++ ) {
|
||||
sc = rtems_semaphore_create(
|
||||
rtems_build_name('s', 'e', 'm', ' '),
|
||||
1,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
0,
|
||||
&Semaphores[i]
|
||||
);
|
||||
/* printf("Creating %i id=0x%08x\n", i, Semaphores[i]); */
|
||||
|
||||
if (sc == RTEMS_TOO_MANY) {
|
||||
printf("We run out at %i!\n", i);
|
||||
break;
|
||||
}
|
||||
if (sc != RTEMS_SUCCESSFUL) {
|
||||
printf("FAILED creating at %i\n", i);
|
||||
directive_failed( sc, "rtems_semaphore_create " );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
created = i;
|
||||
if ( created == MAX )
|
||||
puts( "Created all semaphores allowed in this test" );
|
||||
|
||||
printf( "%d semaphores created\n", i );
|
||||
printf( "Largest C program heap block available: %d\n", malloc_free_space() );
|
||||
|
||||
for ( i-- ; i ; i-- ) {
|
||||
sc = rtems_semaphore_delete( Semaphores[i] );
|
||||
if (sc != RTEMS_SUCCESSFUL) {
|
||||
printf("FAILED deleting at %i\n", i);
|
||||
directive_failed( sc, "rtems_semaphore_delete " );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
printf( "%d semaphores successfully deleted\n", created );
|
||||
printf( "Largest C program heap block available: %d\n", malloc_free_space() );
|
||||
|
||||
puts( "*** END OF TEST 48 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
/* configuration stuff */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES rtems_resource_unlimited(5)
|
||||
#if 1
|
||||
#define CONFIGURE_UNIFIED_WORK_AREAS
|
||||
#else
|
||||
#define CONFIGURE_MEMORY_OVERHEAD 1024
|
||||
#endif
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include <rtems/confdefs.h>
|
||||
24
testsuites/sptests/sp48/sp48.doc
Normal file
24
testsuites/sptests/sp48/sp48.doc
Normal file
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# COPYRIGHT (c) 1989-2008.
|
||||
# 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.
|
||||
#
|
||||
|
||||
This file describes the directives and concepts tested by this test set.
|
||||
|
||||
test set name: sp48
|
||||
|
||||
directives:
|
||||
|
||||
rtems_semaphore_create
|
||||
rtems_semaphore_delete
|
||||
|
||||
concepts:
|
||||
|
||||
+ Ensure that unlimited object configuration works properly when
|
||||
configured for unified C program heap and Executive Workspace.
|
||||
11
testsuites/sptests/sp48/sp48.scn
Normal file
11
testsuites/sptests/sp48/sp48.scn
Normal file
@@ -0,0 +1,11 @@
|
||||
*** TEST 48 ***
|
||||
Largest C program heap block available: 4006096
|
||||
Created all semaphores allowed in this test
|
||||
5000 semaphores created
|
||||
Largest C program heap block available: 2376296
|
||||
5000 semaphores successfully deleted
|
||||
Largest C program heap block available: 2376296
|
||||
*** END OF TEST 48 ***
|
||||
|
||||
NOTE: Heap block size and maximum objects created vary based upon target.
|
||||
The maximum semaphores that will be created is 5000.
|
||||
Reference in New Issue
Block a user