summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp55
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 /testsuites/sptests/sp55
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.
Diffstat (limited to 'testsuites/sptests/sp55')
-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
5 files changed, 132 insertions, 0 deletions
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 ***