source: rtems/testsuites/sptests/spsignal_err01/init.c @ 34244b7a

4.115
Last change on this file since 34244b7a was 34244b7a, checked in by Bjorn Larsson <bjornlarsson@…>, on 03/25/14 at 14:58:04

spsignal_err01: New test split from sp09.

This test moves rtems_signal_send error testing from sp09
screen 9 into its own test.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 2014.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#define CONFIGURE_INIT
15#include "system.h"
16
17const char rtems_test_name[] = "SP SIGNAL ERROR 01";
18
19rtems_task Init(
20  rtems_task_argument argument
21)
22{
23  rtems_status_code status;
24
25  TEST_BEGIN();
26  /* send invalid id */
27  status = rtems_signal_send( 100, RTEMS_SIGNAL_1 );
28  fatal_directive_status(
29    status,
30    RTEMS_INVALID_ID,
31    "rtems_signal_send with illegal id"
32  );
33  puts( "TA1 - rtems_signal_send - RTEMS_INVALID_ID" );
34
35  /* no signal in set */
36  status = rtems_signal_send( RTEMS_SELF, 0 );
37  fatal_directive_status(
38    status,
39    RTEMS_INVALID_NUMBER,
40    "rtems_signal_send with no signals"
41  );
42  puts( "TA1 - rtems_signal_send - RTEMS_INVALID_NUMBER" );
43
44  /* no signal handler */
45  status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 );
46  fatal_directive_status(
47    status,
48    RTEMS_NOT_DEFINED,
49    "rtems_signal_send with no handler"
50  );
51  puts( "TA1 - rtems_signal_send - RTEMS_NOT_DEFINED" );
52
53  TEST_END();
54}
Note: See TracBrowser for help on using the repository browser.