diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-09 19:02:41 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-09 19:02:41 +0000 |
commit | ab8c4ee27f3e455c4f573c7b6be9be45e6c50912 (patch) | |
tree | f73bcf0bd86d14cb6d3e900cc501db5b241690d8 /testsuites/sptests/spthreadq01 | |
parent | 2009-07-09 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-ab8c4ee27f3e455c4f573c7b6be9be45e6c50912.tar.bz2 |
2009-07-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add test for Thread Queue extract a thread
not blocked on a thread queue.
* spthreadq01/.cvsignore, spthreadq01/Makefile.am, spthreadq01/init.c,
spthreadq01/spthreadq01.doc, spthreadq01/spthreadq01.scn: New files.
Diffstat (limited to 'testsuites/sptests/spthreadq01')
-rw-r--r-- | testsuites/sptests/spthreadq01/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/spthreadq01/Makefile.am | 28 | ||||
-rw-r--r-- | testsuites/sptests/spthreadq01/init.c | 56 | ||||
-rw-r--r-- | testsuites/sptests/spthreadq01/spthreadq01.doc | 23 | ||||
-rw-r--r-- | testsuites/sptests/spthreadq01/spthreadq01.scn | 6 |
5 files changed, 115 insertions, 0 deletions
diff --git a/testsuites/sptests/spthreadq01/.cvsignore b/testsuites/sptests/spthreadq01/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/spthreadq01/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/spthreadq01/Makefile.am b/testsuites/sptests/spthreadq01/Makefile.am new file mode 100644 index 0000000000..2cb7182546 --- /dev/null +++ b/testsuites/sptests/spthreadq01/Makefile.am @@ -0,0 +1,28 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = spthreadq01 +spthreadq01_SOURCES = init.c + +dist_rtems_tests_DATA = spthreadq01.scn +dist_rtems_tests_DATA += spthreadq01.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +spthreadq01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(spthreadq01_OBJECTS) $(spthreadq01_LDADD) +LINK_LIBS = $(spthreadq01_LDLIBS) + +spthreadq01$(EXEEXT): $(spthreadq01_OBJECTS) $(spthreadq01_DEPENDENCIES) + @rm -f spthreadq01$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c new file mode 100644 index 0000000000..1d725af0d9 --- /dev/null +++ b/testsuites/sptests/spthreadq01/init.c @@ -0,0 +1,56 @@ +/* + * 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> + +#include <sys/types.h> +#include <rtems/score/threadq.h> + +void threadq_first_empty( + const char *discipline_string, + Thread_queue_Disciplines discipline +) +{ + Thread_queue_Control tq; + + printf( "Init - initialize thread queue for %s\n", discipline_string ); + _Thread_queue_Initialize( &tq, discipline, 0x01, 3 ); + + puts( "Init - _Thread_queue_Extract - thread not blocked on a thread queue" ); + _Thread_queue_Extract( &tq, _Thread_Executing ); + /* is there anything to check? */ +} + +rtems_task Init( + rtems_task_argument ignored +) +{ + puts( "\n\n*** TEST THREAD QUEUE TEST 01 ***" ); + + threadq_first_empty( "FIFO", THREAD_QUEUE_DISCIPLINE_FIFO ); + threadq_first_empty( "Priority", THREAD_QUEUE_DISCIPLINE_PRIORITY ); + + puts( "*** END OF TEST THREAD QUEUE TEST 01 ***" ); + rtems_test_exit(0); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> + +/* global variables */ diff --git a/testsuites/sptests/spthreadq01/spthreadq01.doc b/testsuites/sptests/spthreadq01/spthreadq01.doc new file mode 100644 index 0000000000..6094c836aa --- /dev/null +++ b/testsuites/sptests/spthreadq01/spthreadq01.doc @@ -0,0 +1,23 @@ +# +# $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: spthreadq01 + +directives: + + _Threadq_Extract + +concepts: + ++ Ensure that when an attempt is made to extract a thread which is not blocked + on a thread queue, that the behavior is as expected. diff --git a/testsuites/sptests/spthreadq01/spthreadq01.scn b/testsuites/sptests/spthreadq01/spthreadq01.scn new file mode 100644 index 0000000000..6269660fde --- /dev/null +++ b/testsuites/sptests/spthreadq01/spthreadq01.scn @@ -0,0 +1,6 @@ +*** TEST THREAD QUEUE TEST 01 *** +Init - initialize thread queue for FIFO +Init - _Thread_queue_Extract - thread not blocked on a thread queue +Init - initialize thread queue for Priority +Init - _Thread_queue_Extract - thread not blocked on a thread queue +*** END OF TEST THREAD QUEUE TEST 01 *** |