summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxmsgq04
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-29 20:15:33 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-29 20:15:33 +0000
commit330e858cc23e3ef43836a5015ce64fd9d42db3b1 (patch)
treea8beb7273ea08163455b0756438609429ec4daa7 /testsuites/psxtests/psxmsgq04
parent2009-07-29 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-330e858cc23e3ef43836a5015ce64fd9d42db3b1.tar.bz2
2009-07-29 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add shell of new test. * psxmsgq04/.cvsignore, psxmsgq04/Makefile.am, psxmsgq04/init.c, psxmsgq04/psxmsgq04.doc, psxmsgq04/psxmsgq04.scn: New files.
Diffstat (limited to 'testsuites/psxtests/psxmsgq04')
-rw-r--r--testsuites/psxtests/psxmsgq04/.cvsignore2
-rw-r--r--testsuites/psxtests/psxmsgq04/Makefile.am30
-rw-r--r--testsuites/psxtests/psxmsgq04/init.c68
-rw-r--r--testsuites/psxtests/psxmsgq04/psxmsgq04.doc26
-rw-r--r--testsuites/psxtests/psxmsgq04/psxmsgq04.scn0
5 files changed, 126 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxmsgq04/.cvsignore b/testsuites/psxtests/psxmsgq04/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/psxtests/psxmsgq04/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/psxtests/psxmsgq04/Makefile.am b/testsuites/psxtests/psxmsgq04/Makefile.am
new file mode 100644
index 0000000000..ada73d494b
--- /dev/null
+++ b/testsuites/psxtests/psxmsgq04/Makefile.am
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxmsgq04
+psxmsgq04_SOURCES = init.c ../include/pmacros.h \
+ ../../support/src/test_support.c
+
+dist_rtems_tests_DATA = psxmsgq04.scn
+dist_rtems_tests_DATA += psxmsgq04.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+psxmsgq04_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxmsgq04_OBJECTS) $(psxmsgq04_LDADD)
+LINK_LIBS = $(psxmsgq04_LDLIBS)
+
+psxmsgq04$(EXEEXT): $(psxmsgq04_OBJECTS) $(psxmsgq04_DEPENDENCIES)
+ @rm -f psxmsgq04$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/psxtests/psxmsgq04/init.c b/testsuites/psxtests/psxmsgq04/init.c
new file mode 100644
index 0000000000..a4f3bacd4a
--- /dev/null
+++ b/testsuites/psxtests/psxmsgq04/init.c
@@ -0,0 +1,68 @@
+/*
+ * 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 <pmacros.h>
+#include <unistd.h>
+#include <errno.h>
+#include <tmacros.h>
+
+#include <fcntl.h> /* For O_* constants */
+#include <sys/stat.h> /* For mode constants */
+#include <mqueue.h>
+
+#include "test_support.h"
+
+void *POSIX_Init(
+ void *argument
+)
+{
+ struct mq_attr attr;
+ mqd_t Queue;
+ int sc;
+
+ puts( "\n\n*** POSIX MESSAGE QUEUE TEST 4 ***" );
+
+ attr.mq_maxmsg = 1;
+ attr.mq_msgsize = sizeof(int);
+
+ puts( "Init - Open message queue" );
+ Queue = mq_open( "Queue", O_CREAT | O_RDWR, 0x777, &attr );
+ if ( Queue == (-1) )
+ perror( "mq_open failed" );
+ assert( Queue != (-1) );
+
+ puts( "Init - Close message queue" );
+ sc = mq_close( Queue );
+ if ( sc != 0 )
+ perror( "mq_close failed" );
+ assert( sc == 0 );
+
+ puts( "*** END OF POSIX MESSAGE QUEUE TEST 4 ***" );
+ rtems_test_exit( 0 );
+
+ return NULL; /* just so the compiler thinks we returned something */
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of include file */
diff --git a/testsuites/psxtests/psxmsgq04/psxmsgq04.doc b/testsuites/psxtests/psxmsgq04/psxmsgq04.doc
new file mode 100644
index 0000000000..9fed044849
--- /dev/null
+++ b/testsuites/psxtests/psxmsgq04/psxmsgq04.doc
@@ -0,0 +1,26 @@
+#
+# $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: psxmsgq04
+
+directives:
+
+ mq_open
+ mq_send
+
+concepts:
+
++ Ensure that an error is returned when performing a blocking mq_send
+ from an Interrupt Service Routine. This condition is beyond the
+ POSIX Standard because they do not discuss interrupt processing and
+ what operations are allowed.
diff --git a/testsuites/psxtests/psxmsgq04/psxmsgq04.scn b/testsuites/psxtests/psxmsgq04/psxmsgq04.scn
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuites/psxtests/psxmsgq04/psxmsgq04.scn