summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp49
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-21 14:34:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-21 14:34:15 +0000
commit1dc1da58a17a35e648038d53d33a306fdd2ca940 (patch)
tree2cbfd6d0c7671a1b630b0f5e26ebee4bd80e5f5a /testsuites/sptests/sp49
parent2009-05-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-1dc1da58a17a35e648038d53d33a306fdd2ca940.tar.bz2
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1414/cpukit * Makefile.am, configure.ac: Tighten math on extraction of index so it is harder to trick by passing in a valid id of an incorrect object class. * sp49/.cvsignore, sp49/Makefile.am, sp49/init.c, sp49/sp49.doc, sp49/sp49.scn: New files.
Diffstat (limited to 'testsuites/sptests/sp49')
-rw-r--r--testsuites/sptests/sp49/.cvsignore2
-rw-r--r--testsuites/sptests/sp49/Makefile.am28
-rw-r--r--testsuites/sptests/sp49/init.c54
-rw-r--r--testsuites/sptests/sp49/sp49.doc25
-rw-r--r--testsuites/sptests/sp49/sp49.scn5
5 files changed, 114 insertions, 0 deletions
diff --git a/testsuites/sptests/sp49/.cvsignore b/testsuites/sptests/sp49/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/sp49/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/sp49/Makefile.am b/testsuites/sptests/sp49/Makefile.am
new file mode 100644
index 0000000000..e4c08da6f5
--- /dev/null
+++ b/testsuites/sptests/sp49/Makefile.am
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp49
+sp49_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp49.scn
+dist_rtems_tests_DATA += sp49.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp49_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(sp49_OBJECTS) $(sp49_LDADD)
+LINK_LIBS = $(sp49_LDLIBS)
+
+sp49$(EXEEXT): $(sp49_OBJECTS) $(sp49_DEPENDENCIES)
+ @rm -f sp49$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/sp49/init.c b/testsuites/sptests/sp49/init.c
new file mode 100644
index 0000000000..52b58a4ab8
--- /dev/null
+++ b/testsuites/sptests/sp49/init.c
@@ -0,0 +1,54 @@
+/*
+ * 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 sc;
+ rtems_id q;
+ uint32_t flushed;
+
+ puts( "\n\n*** TEST 49 ***" );
+
+ puts( "Create Message Queue" );
+ sc = rtems_message_queue_create(
+ rtems_build_name('m', 's', 'g', ' '),
+ 1,
+ sizeof(uint32_t),
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &q
+ );
+ directive_failed( sc, "rtems_message_queue_create" );
+
+ puts( "Flush Message Queue using Task Self ID" );
+ sc = rtems_message_queue_flush( rtems_task_self(), &flushed );
+ fatal_directive_status( sc, RTEMS_INVALID_ID, "flush" );
+
+ puts( "Flush returned INVALID_ID as expected" );
+
+ puts( "*** END OF TEST 49 ***" );
+ rtems_test_exit( 0 );
+}
+
+/* configuration stuff */
+
+#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_MESSAGE_BUFFER_MEMORY 256 /* overkill */
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/sp49/sp49.doc b/testsuites/sptests/sp49/sp49.doc
new file mode 100644
index 0000000000..b8679752f1
--- /dev/null
+++ b/testsuites/sptests/sp49/sp49.doc
@@ -0,0 +1,25 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2008.
+# 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: sp49
+
+directives:
+
+ rtems_task_self
+ rtems_message_queue_create
+ rtems_message_queue_flush
+
+concepts:
+
++ Ensure that the id for a task cannot be used to operate upon
+ another object.
diff --git a/testsuites/sptests/sp49/sp49.scn b/testsuites/sptests/sp49/sp49.scn
new file mode 100644
index 0000000000..1cf9145153
--- /dev/null
+++ b/testsuites/sptests/sp49/sp49.scn
@@ -0,0 +1,5 @@
+*** TEST 49 ***
+Create Message Queue
+Flush Message Queue using Task Self ID
+Flush returned INVALID_ID as expected
+*** END OF TEST 49 ***