summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-06 17:10:39 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-06 17:10:39 +0000
commit630a2a68ead5237cbbf0647bfd3af32437fb9348 (patch)
tree215044fa7985d9a64e5452b5b252ffefddb5bd60
parent2009-07-06 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-630a2a68ead5237cbbf0647bfd3af32437fb9348.tar.bz2
2009-07-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add new test to exercise case when broadcasting to a message queue with a pending message. * sp55/.cvsignore, sp55/Makefile.am, sp55/init.c, sp55/sp55.doc, sp55/sp55.scn: New files.
-rw-r--r--testsuites/sptests/ChangeLog7
-rw-r--r--testsuites/sptests/Makefile.am2
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/sp55/.cvsignore2
-rw-r--r--testsuites/sptests/sp55/Makefile.am29
-rw-r--r--testsuites/sptests/sp55/init.c71
-rw-r--r--testsuites/sptests/sp55/sp55.doc24
-rw-r--r--testsuites/sptests/sp55/sp55.scn6
8 files changed, 141 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 9d847a2c57..66ce86b35c 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-06 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, configure.ac: Add new test to exercise case when
+ broadcasting to a message queue with a pending message.
+ * sp55/.cvsignore, sp55/Makefile.am, sp55/init.c, sp55/sp55.doc,
+ sp55/sp55.scn: New files.
+
2009-07-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Remove obsolete test now that the numbered
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 4572a7f5c7..9cc25e95d4 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -7,7 +7,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 sp51 sp52 sp53 sp54 \
+ sp45 sp46 sp47 sp48 sp49 sp50 sp51 sp52 sp53 sp54 sp55 \
spchain spobjgetnext spprintk spsize spstkalloc 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 4e05dfbd20..a6a7eeea39 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -79,6 +79,7 @@ sp51/Makefile
sp52/Makefile
sp53/Makefile
sp54/Makefile
+sp55/Makefile
spchain/Makefile
spfatal01/Makefile
spfatal02/Makefile
diff --git a/testsuites/sptests/sp55/.cvsignore b/testsuites/sptests/sp55/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/sp55/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/sp55/Makefile.am b/testsuites/sptests/sp55/Makefile.am
new file mode 100644
index 0000000000..16958d1920
--- /dev/null
+++ b/testsuites/sptests/sp55/Makefile.am
@@ -0,0 +1,29 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp55
+sp55_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp55.scn
+dist_rtems_tests_DATA += sp55.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp55_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DUSE_TIMER_SERVER
+
+LINK_OBJS = $(sp55_OBJECTS) $(sp55_LDADD)
+LINK_LIBS = $(sp55_LDLIBS)
+
+sp55$(EXEEXT): $(sp55_OBJECTS) $(sp55_DEPENDENCIES)
+ @rm -f sp55$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/sp55/init.c b/testsuites/sptests/sp55/init.c
new file mode 100644
index 0000000000..4a2b556b24
--- /dev/null
+++ b/testsuites/sptests/sp55/init.c
@@ -0,0 +1,71 @@
+/* Broadcast to a message queue with pending messages
+ *
+ * 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 ignored
+)
+{
+ rtems_status_code status;
+ rtems_id id;
+ int msg = 1;
+ uint32_t count = 20;
+
+ puts( "\n\n*** TEST 55 ***" );
+
+ puts( "Init - rtems_message_queue_create - OK" );
+ status = rtems_message_queue_create(
+ rtems_build_name( 'Q', '1', ' ', ' ' ),
+ 2,
+ sizeof(int),
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "rtems_message_queue_create" );
+
+ puts( "Init - rtems_message_queue_send - make message pending - OK" );
+ status = rtems_message_queue_send( id, &msg, sizeof(msg) );
+ directive_failed( status, "rtems_message_queue_send" );
+
+ puts( "Init - rtems_message_queue_broadcast - with message pending - OK" );
+ status = rtems_message_queue_broadcast( id, &msg, sizeof(msg), &count );
+ directive_failed( status, "rtems_message_queue_broadcast" );
+ if ( count != 0 ) {
+ puts( "broadcast with message pending FAILED" );
+ rtems_test_exit(0);
+ }
+
+ puts( "Init - rtems_message_queue_delete - OK" );
+ status = rtems_message_queue_delete( id );
+ directive_failed( status, "rtems_message_queue_delete" );
+
+ puts( "*** END OF TEST 55 ***" );
+ 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_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
+ CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 2, sizeof(int) )
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/sp55/sp55.doc b/testsuites/sptests/sp55/sp55.doc
new file mode 100644
index 0000000000..a1b06a2178
--- /dev/null
+++ b/testsuites/sptests/sp55/sp55.doc
@@ -0,0 +1,24 @@
+#
+# $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: sp55
+
+directives:
+
+ rtems_message_queue_create
+ rtems_message_queue_send
+ rtems_message_queue_broadcast
+
+concepts:
+
++ Ensure that broadcasting to a queue with pending messages works as expected.
diff --git a/testsuites/sptests/sp55/sp55.scn b/testsuites/sptests/sp55/sp55.scn
new file mode 100644
index 0000000000..858f4cd3d7
--- /dev/null
+++ b/testsuites/sptests/sp55/sp55.scn
@@ -0,0 +1,6 @@
+*** TEST 55 ***
+Init - rtems_message_queue_create - OK
+Init - rtems_message_queue_send - make message pending - OK
+Init - rtems_message_queue_broadcast - with message pending - OK
+Init - rtems_message_queue_delete - OK
+*** END OF TEST 55 ***