source: rtems/testsuites/sptests/spfatal30/init.c @ 99de42c

5
Last change on this file since 99de42c was af43554, checked in by Sebastian Huber <sebastian.huber@…>, on 10/26/17 at 11:59:11

tests: Remove TEST_INIT

The TEST_EXTERN is a used only by the system.h style tests and they use
CONFIGURE_INIT appropriately.

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include "tmacros.h"
20
21#include <rtems.h>
22
23const char rtems_test_name[] = "SPFATAL 30";
24
25#if (CPU_HARDWARE_FP == TRUE && CPU_ALL_TASKS_ARE_FP == FALSE) \
26  || SPARC_HAS_FPU == 1
27#define EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
28#endif
29
30static volatile double f = 1.0;
31
32static void Init(rtems_task_argument arg)
33{
34  TEST_BEGIN();
35
36  f *= 123.456;
37
38#ifdef EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
39  rtems_test_assert(0);
40#else
41  TEST_END();
42  rtems_test_exit(0);
43#endif
44}
45
46#ifdef EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
47static void fatal_extension(
48  rtems_fatal_source source,
49  bool always_set_to_false,
50  rtems_fatal_code code
51)
52{
53  if (
54    source == INTERNAL_ERROR_CORE
55      && !always_set_to_false
56      && code == INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
57  ) {
58    TEST_END();
59  }
60}
61
62#define CONFIGURE_INITIAL_EXTENSIONS \
63  { .fatal = fatal_extension }, \
64  RTEMS_TEST_INITIAL_EXTENSION
65
66#else /* EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT */
67
68#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
69
70#endif /* EXPECT_ILLEGAL_USE_OF_FLOATING_POINT_UNIT */
71
72#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
73
74#define CONFIGURE_MAXIMUM_TASKS 1
75
76#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
77
78#define CONFIGURE_INIT
79
80#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.