2009-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>

* Makefile.am, configure.ac: Add a test to exercise an odd case in
	_POSIX_signals_Clear_signals.
	* psxsignal05/.cvsignore, psxsignal05/Makefile.am, psxsignal05/init.c,
	psxsignal05/psxsignal05.doc, psxsignal05/psxsignal05.scn: New files.
This commit is contained in:
Joel Sherrill
2009-08-05 18:13:29 +00:00
parent 7d89924051
commit b053cab093
8 changed files with 170 additions and 2 deletions
+7
View File
@@ -1,3 +1,10 @@
2009-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add a test to exercise an odd case in
_POSIX_signals_Clear_signals.
* psxsignal05/.cvsignore, psxsignal05/Makefile.am, psxsignal05/init.c,
psxsignal05/psxsignal05.doc, psxsignal05/psxsignal05.scn: New files.
2009-08-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxmsgq04/init.c: Correct typo in configuration so test does as
+2 -2
View File
@@ -9,8 +9,8 @@ SUBDIRS = psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
psxcancel psxcleanup psxcond01 psxenosys psxkey01 psxkey02 psxkey03 \
psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 psxmutexattr01 psxobj01 \
psxrwlock01 psxsem01 psxsignal01 psxsignal02 psxsignal03 psxsignal04 \
psxspin01 psxspin02 psxsysconf psxtime psxtimer01 psxtimer02 psxualarm \
psxfatal01 psxfatal02 \
psxsignal05 psxspin01 psxspin02 psxsysconf psxtime psxtimer01 psxtimer02 \
psxualarm psxfatal01 psxfatal02 \
psxintrcritical01
## File IO tests
+1
View File
@@ -72,6 +72,7 @@ psxsignal01/Makefile
psxsignal02/Makefile
psxsignal03/Makefile
psxsignal04/Makefile
psxsignal05/Makefile
psxspin01/Makefile
psxspin02/Makefile
psxstat/Makefile
@@ -0,0 +1,2 @@
Makefile
Makefile.in
@@ -0,0 +1,29 @@
##
## $Id$
##
MANAGERS = all
rtems_tests_PROGRAMS = psxsignal05
psxsignal05_SOURCES = init.c ../include/pmacros.h
dist_rtems_tests_DATA = psxsignal05.scn
dist_rtems_tests_DATA += psxsignal05.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
psxsignal05_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(psxsignal05_OBJECTS) $(psxsignal05_LDADD)
LINK_LIBS = $(psxsignal05_LDLIBS)
psxsignal05$(EXEEXT): $(psxsignal05_OBJECTS) $(psxsignal05_DEPENDENCIES)
@rm -f psxsignal05$(EXEEXT)
$(make-exe)
include $(top_srcdir)/../automake/local.am
+95
View File
@@ -0,0 +1,95 @@
/*
* 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$
*/
#define TEST_NAME "05"
#define TEST_STRING "User Signals"
#define SIGNAL_ONE SIGUSR1
#define SIGNAL_TWO SIGUSR2
#include <pmacros.h>
#include <signal.h>
#include <errno.h>
#include <errno.h>
#include <rtems/posix/psignal.h>
void Signal_handler(
int signo,
siginfo_t *info,
void *arg
)
{
puts( "Signal handler hit" );
rtems_test_exit(0);
}
const char *signal_name(int signo)
{
if (signo == SIGUSR1)
return "SIGUSR1";
if (signo == SIGUSR2)
return "SIGUSR2";
if (signo == SIGRTMIN)
return "SIGRTMIN";
if (signo == SIGRTMAX)
return "SIGRTMAX";
return "unknown-signal";
}
void *POSIX_Init(
void *argument
)
{
struct sigaction act;
siginfo_t info;
bool bc;
puts( "\n\n*** POSIX TEST SIGNAL " TEST_NAME " ***" );
act.sa_handler = NULL;
act.sa_sigaction = Signal_handler;
act.sa_flags = SA_SIGINFO;
sigaction( SIGNAL_ONE, &act, NULL );
sigaction( SIGNAL_TWO, &act, NULL );
printf(
"Init - _POSIX_signals_Clear_signals when signals pending but\n"
"Init - not queued on SA_SIGINFO configured signal.\n"
);
/* cheat and put signal directly in */
_POSIX_signals_Pending |= signo_to_mask( SIGUSR1 );
bc = _POSIX_signals_Clear_signals(
_Thread_Executing->API_Extensions[ THREAD_API_POSIX ],
SIGNAL_ONE,
&info,
true, /* is_global */
false /* check_blocked */
);
assert( bc );
puts( "*** END OF POSIX TEST SIGNAL " TEST_NAME " ***" );
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_MAXIMUM_POSIX_THREADS 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
@@ -0,0 +1,30 @@
#
# $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: psxsignal05
directives:
sigemptyset
sigaddset
sigwaitinfo
concepts:
+ Ensure if _POSIX_signals_Clear_signals is called to clear a process wide
SA_SIGINFO signal which is pending but there is not a queued SA_SIGINFO
structure, then things happen correctly.
NOTE: This case may be impossible to hit in real code but until that is
proven we need to be defensive and protect against it.
@@ -0,0 +1,4 @@
*** POSIX TEST SIGNAL 05 ***
Init - _POSIX_signals_Clear_signals when signals pending but
Init - not queued on SA_SIGINFO configured signal.
*** END OF POSIX TEST SIGNAL 05 ***