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

Last change on this file since 99de42c was c4b8b147, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 3, 2017 at 7:35:38 AM

tests: Use simple console driver

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <tmacros.h>
15
16#include "test_support.h"
17#include <errno.h>
18#include <rtems/error.h>
19
20const char rtems_test_name[] = "SPERROR 2";
21
22/* forward declarations to avoid warnings */
23rtems_task Init(rtems_task_argument argument);
24
25static void fatal_extension(
26  rtems_fatal_source source,
27  bool always_set_to_false,
28  rtems_fatal_code error
29)
30{
31  if (
32    source == RTEMS_FATAL_SOURCE_EXIT
33      && !always_set_to_false
34      && error == 1
35  ) {
36    TEST_END();
37  }
38}
39
40rtems_task Init(
41  rtems_task_argument argument
42)
43{
44  TEST_BEGIN();
45
46  errno = ENOMEM;
47  rtems_error(
48    RTEMS_NO_MEMORY | RTEMS_ERROR_ABORT,
49    "Dummy: Resources unavailable\n"
50  );
51
52  rtems_test_assert(0);
53}
54
55/* configuration information */
56
57#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
58#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
59
60#define CONFIGURE_MAXIMUM_TASKS             1
61#define CONFIGURE_INITIAL_EXTENSIONS \
62  { .fatal = fatal_extension }, RTEMS_TEST_INITIAL_EXTENSION
63
64#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
65
66#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
67
68#define CONFIGURE_INIT
69
70#include <rtems/confdefs.h>
71/* end of file */
Note: See TracBrowser for help on using the repository browser.