From 330e858cc23e3ef43836a5015ce64fd9d42db3b1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 29 Jul 2009 20:15:33 +0000 Subject: 2009-07-29 Joel Sherrill * 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. --- testsuites/psxtests/psxmsgq04/.cvsignore | 2 + testsuites/psxtests/psxmsgq04/Makefile.am | 30 +++++++++++++ testsuites/psxtests/psxmsgq04/init.c | 68 +++++++++++++++++++++++++++++ testsuites/psxtests/psxmsgq04/psxmsgq04.doc | 26 +++++++++++ testsuites/psxtests/psxmsgq04/psxmsgq04.scn | 0 5 files changed, 126 insertions(+) create mode 100644 testsuites/psxtests/psxmsgq04/.cvsignore create mode 100644 testsuites/psxtests/psxmsgq04/Makefile.am create mode 100644 testsuites/psxtests/psxmsgq04/init.c create mode 100644 testsuites/psxtests/psxmsgq04/psxmsgq04.doc create mode 100644 testsuites/psxtests/psxmsgq04/psxmsgq04.scn (limited to 'testsuites/psxtests/psxmsgq04') 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 +#include +#include +#include + +#include /* For O_* constants */ +#include /* For mode constants */ +#include + +#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 +/* 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 -- cgit v1.2.3