diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-21 19:40:07 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-21 19:40:07 +0000 |
commit | e379e962b394a84182c7d3d1669a24c405044ff7 (patch) | |
tree | 3c99b4b8f62c5b47d49404f779a13d261fb35fd0 /testsuites | |
parent | 2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-e379e962b394a84182c7d3d1669a24c405044ff7.tar.bz2 |
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1415/cpukit
* Makefile.am, configure.ac: Add test for very simple priority ceiling
violation.
* sp51/.cvsignore, sp51/Makefile.am, sp51/init.c, sp51/sp51.doc,
sp51/sp51.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/sptests/ChangeLog | 8 | ||||
-rw-r--r-- | testsuites/sptests/Makefile.am | 2 | ||||
-rw-r--r-- | testsuites/sptests/configure.ac | 1 | ||||
-rw-r--r-- | testsuites/sptests/sp51/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/sp51/Makefile.am | 28 | ||||
-rw-r--r-- | testsuites/sptests/sp51/init.c | 60 | ||||
-rw-r--r-- | testsuites/sptests/sp51/sp51.doc | 28 | ||||
-rw-r--r-- | testsuites/sptests/sp51/sp51.scn | 0 |
8 files changed, 128 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index e7241e8a46..12b3aaab1e 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,5 +1,13 @@ 2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com> + PR 1415/cpukit + * Makefile.am, configure.ac: Add test for very simple priority ceiling + violation. + * sp51/.cvsignore, sp51/Makefile.am, sp51/init.c, sp51/sp51.doc, + sp51/sp51.scn: New files. + +2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com> + PR 1413/cpukit * Makefile.am, configure.ac: Add test for case where server based timers which reinitiated themselves did not get reinserted onto timer diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index dd5e5d0615..be5c4edbef 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -8,7 +8,7 @@ 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 sp48 sp49 sp50 spsize spwatchdog \ + sp45 sp46 sp47 sp48 sp49 sp50 sp51 spsize spwatchdog \ spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \ spfatal08 spfatal09 spobjgetnext \ spprintk spwkspace diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac index 939045fe75..9aedce97ae 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -75,6 +75,7 @@ sp47/Makefile sp48/Makefile sp49/Makefile sp50/Makefile +sp51/Makefile spwatchdog/Makefile spsize/Makefile spfatal/Makefile diff --git a/testsuites/sptests/sp51/.cvsignore b/testsuites/sptests/sp51/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/sp51/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/sp51/Makefile.am b/testsuites/sptests/sp51/Makefile.am new file mode 100644 index 0000000000..2c90400dd9 --- /dev/null +++ b/testsuites/sptests/sp51/Makefile.am @@ -0,0 +1,28 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = sp51 +sp51_SOURCES = init.c + +dist_rtems_tests_DATA = sp51.scn +dist_rtems_tests_DATA += sp51.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +sp51_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(sp51_OBJECTS) $(sp51_LDADD) +LINK_LIBS = $(sp51_LDLIBS) + +sp51$(EXEEXT): $(sp51_OBJECTS) $(sp51_DEPENDENCIES) + @rm -f sp51$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/sp51/init.c b/testsuites/sptests/sp51/init.c new file mode 100644 index 0000000000..ecb2779808 --- /dev/null +++ b/testsuites/sptests/sp51/init.c @@ -0,0 +1,60 @@ +/* + * 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> + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code sc; + rtems_id mutex; + + puts( "\n\n*** TEST 51 ***" ); + + puts( "Create semaphore" ); + sc = rtems_semaphore_create( + rtems_build_name( 'S', 'E', 'M', '1' ), + 1, + RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY_CEILING | RTEMS_PRIORITY, + (RTEMS_MAXIMUM_PRIORITY - 4u), + &mutex + ); + directive_failed( sc, "rtems_semaphore_create" ); + + puts( "Obtain semaphore -- violate ceiling" ); + sc = rtems_semaphore_obtain( mutex, RTEMS_DEFAULT_OPTIONS, 0 ); + fatal_directive_status( sc, RTEMS_INTERNAL_ERROR, "rtems_semaphore_obtain" ); + + puts( "Release semaphore we did not obtain-- violate ceiling" ); + sc = rtems_semaphore_release( mutex ); + fatal_directive_status( + sc, RTEMS_NOT_OWNER_OF_RESOURCE, "rtems_semaphore_release" ); + + puts( "*** END OF TEST 51 ***" ); + rtems_test_exit( 0 ); +} + + +/**************** START OF CONFIGURATION INFORMATION ****************/ + +#define CONFIGURE_INIT +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#include <rtems/confdefs.h> + +/**************** END OF CONFIGURATION INFORMATION ****************/ diff --git a/testsuites/sptests/sp51/sp51.doc b/testsuites/sptests/sp51/sp51.doc new file mode 100644 index 0000000000..bbf162a7b9 --- /dev/null +++ b/testsuites/sptests/sp51/sp51.doc @@ -0,0 +1,28 @@ +# +# $Id$ +# +# 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. +# + +This file describes the directives and concepts tested by this test set. + +test set name: sp51 + +directives: + + rtems_semaphore_create + rtems_semaphore_obtain + rtems_semaphore_mutex + +concepts: + ++ Ensure that obtaining a binary semaphore with priority ceiling enabled + properly detects a ceiling violation when there is no conflict. + ++ Ensure the when the binary semaphore lock fails to acquire the mutex, + it is an error to release it since the lock failed. diff --git a/testsuites/sptests/sp51/sp51.scn b/testsuites/sptests/sp51/sp51.scn new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/testsuites/sptests/sp51/sp51.scn |