summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spsignal_err01/init.c
diff options
context:
space:
mode:
authorBjorn Larsson <bjornlarsson@oarcorp.com>2014-03-25 09:58:04 -0500
committerJennifer Averett <jennifer.averett@oarcorp.com>2014-03-28 12:32:29 -0500
commit34244b7a7469a42d768e459c9c46bcee2fbe89c6 (patch)
tree7e9196d935cc895dd5cf0c3c6887b00d03e130b7 /testsuites/sptests/spsignal_err01/init.c
parentspintr_err01: New test split from sp09. (diff)
downloadrtems-34244b7a7469a42d768e459c9c46bcee2fbe89c6.tar.bz2
spsignal_err01: New test split from sp09.
This test moves rtems_signal_send error testing from sp09 screen 9 into its own test.
Diffstat (limited to 'testsuites/sptests/spsignal_err01/init.c')
-rw-r--r--testsuites/sptests/spsignal_err01/init.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/testsuites/sptests/spsignal_err01/init.c b/testsuites/sptests/spsignal_err01/init.c
new file mode 100644
index 0000000000..23b771b2fa
--- /dev/null
+++ b/testsuites/sptests/spsignal_err01/init.c
@@ -0,0 +1,54 @@
+/*
+ * COPYRIGHT (c) 2014.
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+const char rtems_test_name[] = "SP SIGNAL ERROR 01";
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ TEST_BEGIN();
+ /* send invalid id */
+ status = rtems_signal_send( 100, RTEMS_SIGNAL_1 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_signal_send with illegal id"
+ );
+ puts( "TA1 - rtems_signal_send - RTEMS_INVALID_ID" );
+
+ /* no signal in set */
+ status = rtems_signal_send( RTEMS_SELF, 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_signal_send with no signals"
+ );
+ puts( "TA1 - rtems_signal_send - RTEMS_INVALID_NUMBER" );
+
+ /* no signal handler */
+ status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_signal_send with no handler"
+ );
+ puts( "TA1 - rtems_signal_send - RTEMS_NOT_DEFINED" );
+
+ TEST_END();
+}