summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuites/sptests/ChangeLog7
-rw-r--r--testsuites/sptests/Makefile.am6
-rw-r--r--testsuites/sptests/configure.ac5
-rw-r--r--testsuites/sptests/spchain/.cvsignore2
-rw-r--r--testsuites/sptests/spchain/Makefile.am29
-rw-r--r--testsuites/sptests/spchain/init.c89
-rw-r--r--testsuites/sptests/spchain/spchain.doc25
-rw-r--r--testsuites/sptests/spchain/spchain.scn4
8 files changed, 162 insertions, 5 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index cd711626fc..90647811e1 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,5 +1,12 @@
2009-07-01 Joel Sherrill <joel.sherrill@OARcorp.com>
+ * Makefile.am, configure.ac: Add new test to cover bodies of some chain
+ routines whose bodies are not used by RTEMS itself.
+ * spchain/.cvsignore, spchain/Makefile.am, spchain/init.c,
+ spchain/spchain.doc, spchain/spchain.scn: New files.
+
+2009-07-01 Joel Sherrill <joel.sherrill@OARcorp.com>
+
* spwatchdog/init.c, spwatchdog/spwatchdog.scn: Add test case of empty
chain for coverage.
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index d35ffa35e1..5319559f42 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -8,10 +8,10 @@ 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 sp51 sp52 sp53 sp54 spsize spwatchdog \
+ sp45 sp46 sp47 sp48 sp49 sp50 sp51 sp52 sp53 sp54 \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
- spfatal08 spfatal09 spfatal10 spfatal11 spobjgetnext \
- spprintk spwkspace
+ spfatal08 spfatal09 spfatal10 spfatal11 spchain spobjgetnext spprintk \
+ spsize spwatchdog spwkspace
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index fc18ceb0a3..f975572621 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -79,8 +79,7 @@ sp51/Makefile
sp52/Makefile
sp53/Makefile
sp54/Makefile
-spwatchdog/Makefile
-spsize/Makefile
+spchain/Makefile
spfatal/Makefile
spfatal01/Makefile
spfatal02/Makefile
@@ -95,6 +94,8 @@ spfatal10/Makefile
spfatal11/Makefile
spobjgetnext/Makefile
spprintk/Makefile
+spsize/Makefile
+spwatchdog/Makefile
spwkspace/Makefile
])
AC_OUTPUT
diff --git a/testsuites/sptests/spchain/.cvsignore b/testsuites/sptests/spchain/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spchain/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spchain/Makefile.am b/testsuites/sptests/spchain/Makefile.am
new file mode 100644
index 0000000000..980744a1f7
--- /dev/null
+++ b/testsuites/sptests/spchain/Makefile.am
@@ -0,0 +1,29 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spchain
+spchain_SOURCES = init.c
+
+dist_rtems_tests_DATA = spchain.scn
+dist_rtems_tests_DATA += spchain.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+spchain_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DUSE_TIMER_SERVER
+
+LINK_OBJS = $(spchain_OBJECTS) $(spchain_LDADD)
+LINK_LIBS = $(spchain_LDLIBS)
+
+spchain$(EXEEXT): $(spchain_OBJECTS) $(spchain_DEPENDENCIES)
+ @rm -f spchain$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c
new file mode 100644
index 0000000000..e8ebfde9dd
--- /dev/null
+++ b/testsuites/sptests/spchain/init.c
@@ -0,0 +1,89 @@
+/*
+ * 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 <rtems/chain.h>
+
+typedef struct {
+ rtems_chain_node Node;
+ int id;
+} test_node;
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ rtems_chain_control chain1;
+ rtems_chain_node *p;
+ test_node node1, node2;
+ int id;
+
+ puts( "\n\n*** TEST OF RTEMS CHAIN API ***" );
+
+ puts( "Init - Initialize chain empty" );
+ rtems_chain_initialize_empty( &chain1 );
+
+ /* verify that the chain append and insert work */
+ puts( "INIT - Verify rtems_chain_insert" );
+ node1.id = 1;
+ node2.id = 2;
+ rtems_chain_append( &chain1, &node1.Node );
+ rtems_chain_insert( &node1.Node, &node2.Node );
+
+ for ( p = chain1.first, id = 1 ;
+ !rtems_chain_is_tail(&chain1, p) ;
+ p = p->next , id++ ) {
+ test_node *t = (test_node *)p;
+ if ( id > 2 ) {
+ puts( "INIT - TOO MANY NODES ON CHAIN" );
+ rtems_test_exit(0);
+ }
+ if ( t->id != id ) {
+ puts( "INIT - ERROR ON CHAIN ID MISMATCH" );
+ rtems_test_exit(0);
+ }
+ }
+
+ puts( "*** TEST OF RTEMS CHAIN API ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+/*
+ * In this application, the initialization task performs the system
+ * initialization and then transforms itself into the idle task.
+ */
+#define CONFIGURE_IDLE_TASK_BODY Init
+#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
+
+/*
+ * Another odd case to hit. Since we use the Init task is Idle task
+ * configuration, we can dummy up the initialization task configuration
+ * to have a non-NULL pointer and 0 tasks.
+ */
+
+#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE 1
+
+rtems_initialization_tasks_table Initialization_tasks[1] =
+{ { 0, }};
+
+#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
+#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
+#define CONFIGURE_INIT_TASK_STACK_SIZE 0
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/spchain/spchain.doc b/testsuites/sptests/spchain/spchain.doc
new file mode 100644
index 0000000000..cbe5f2143b
--- /dev/null
+++ b/testsuites/sptests/spchain/spchain.doc
@@ -0,0 +1,25 @@
+#
+# $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: spchain
+
+directives:
+
+ rtems_chain_initialize_empty
+ rtems_chain_append
+ rtems_chain_insert
+ rtems_chain_is_tail
+
+concepts:
+
++ Ensure that the chain operations listed above behave as defined.
diff --git a/testsuites/sptests/spchain/spchain.scn b/testsuites/sptests/spchain/spchain.scn
new file mode 100644
index 0000000000..89c675f67b
--- /dev/null
+++ b/testsuites/sptests/spchain/spchain.scn
@@ -0,0 +1,4 @@
+*** TEST OF RTEMS CHAIN API ***
+Init - Initialize chain empty
+INIT - Verify rtems_chain_insert
+*** TEST OF RTEMS CHAIN API ***