source: rtems/testsuites/sptests/spintr_err01/init.c @ 0cf41e5

4.11
Last change on this file since 0cf41e5 was 0cf41e5, checked in by Bjorn Larsson <bjornlarsson@…>, on Mar 25, 2014 at 2:43:09 PM

spintr_err01: New test split from sp09.

This test contains the interrupt catch error tests from sp09
screen 9.

  • Property mode set to 100644
File size: 1.7 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 INTERRUPT ERROR 1";
18
19rtems_task Init(
20  rtems_task_argument argument
21)
22{
23  rtems_status_code status;
24
25  TEST_BEGIN();
26  #if ((CPU_SIMPLE_VECTORED_INTERRUPTS == FALSE) || \
27       defined(_C3x) || defined(_C4x))
28    puts(
29      "TA1 - rtems_interrupt_catch - "
30      "bad handler RTEMS_INVALID_ADDRESS -- SKIPPED"
31    );
32    puts(
33      "TA1 - rtems_interrupt_catch - "
34      "old isr RTEMS_INVALID_ADDRESS - SKIPPED" );
35#else
36  rtems_isr_entry   old_service_routine;
37    status = rtems_interrupt_catch(
38      Service_routine,
39      ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER + 10,
40      &old_service_routine
41    );
42    fatal_directive_status(
43      status,
44      RTEMS_INVALID_NUMBER,
45      "rtems_interrupt_catch with invalid vector"
46    );
47    puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" );
48
49    status = rtems_interrupt_catch( NULL, 3, &old_service_routine );
50    fatal_directive_status(
51      status,
52      RTEMS_INVALID_ADDRESS,
53      "rtems_interrupt_catch with invalid handler"
54    );
55    puts( "TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS" );
56
57    status = rtems_interrupt_catch( Service_routine, 3, NULL );
58    fatal_directive_status(
59      status,
60      RTEMS_INVALID_ADDRESS,
61      "rtems_interrupt_catch with invalid old isr pointer"
62    );
63    puts( "TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS" );
64#endif
65 
66  TEST_END();
67}
Note: See TracBrowser for help on using the repository browser.