summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spsignal_err01/init.c
blob: 6a8e6d0692f91af4a526d032b8a82a77c6c9ec61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 *  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.org/license/LICENSE.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#define TEST_INIT

#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();
}