summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-09 19:02:41 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-09 19:02:41 +0000
commitab8c4ee27f3e455c4f573c7b6be9be45e6c50912 (patch)
treef73bcf0bd86d14cb6d3e900cc501db5b241690d8 /testsuites
parent2009-07-09 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-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')
-rw-r--r--testsuites/sptests/ChangeLog7
-rw-r--r--testsuites/sptests/Makefile.am3
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/spthreadq01/.cvsignore2
-rw-r--r--testsuites/sptests/spthreadq01/Makefile.am28
-rw-r--r--testsuites/sptests/spthreadq01/init.c56
-rw-r--r--testsuites/sptests/spthreadq01/spthreadq01.doc23
-rw-r--r--testsuites/sptests/spthreadq01/spthreadq01.scn6
8 files changed, 125 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 3468dd2a37..6af0c6a73d 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,5 +1,12 @@
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.
+
+2009-07-09 Joel Sherrill <joel.sherrill@OARcorp.com>
+
* Makefile.am, configure.ac: Add test for timespec divide by zero.
* sp58/.cvsignore, sp58/Makefile.am, sp58/init.c, sp58/sp58.doc,
sp58/sp58.scn: New files.
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 95d47295cd..9bdb291ec6 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -9,7 +9,8 @@ SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \
sp29 sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 \
sp44 sp45 sp46 sp47 sp48 sp49 sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 \
sp58 \
- spchain spobjgetnext spprintk spsize spstkalloc spwatchdog spwkspace \
+ spchain spobjgetnext spprintk spsize spstkalloc spthreadq01 \
+ spwatchdog spwkspace \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
spfatal08 spfatal09 spfatal10 spfatal11 spfatal12
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index c48c878ec6..c3507c955c 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -101,6 +101,7 @@ spobjgetnext/Makefile
spprintk/Makefile
spsize/Makefile
spstkalloc/Makefile
+spthreadq01/Makefile
spwatchdog/Makefile
spwkspace/Makefile
])
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 ***