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

5
Last change on this file since 99de42c was c4b8b147, checked in by Sebastian Huber <sebastian.huber@…>, on 11/03/17 at 07:35:38

tests: Use simple console driver

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/**
2 *  @@file
3 *
4 *  Odd Id Cases where API configured but No Threads
5 *    + Possibly Valid Id passed to directive
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2012.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <tmacros.h>
22
23const char rtems_test_name[] = "SP 54";
24
25static void *Init( uintptr_t ignored )
26{
27  rtems_status_code    status;
28  rtems_task_priority  pri;
29  rtems_id             id;
30
31  /*
32   *  It is possible that since this thread prints and there is no idle
33   *  task, that the system could fail miserably. :(
34   */
35  TEST_BEGIN();
36
37  puts( "Init - use valid id of API class with no objects" );
38  status = rtems_task_set_priority(
39    rtems_build_id(0x2,0x1,0x01,0x0001) /* 0xa010001 */,
40    RTEMS_CURRENT_PRIORITY,
41    &pri
42  );
43  fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_set_priority" );
44
45  puts( "Init - lookup name within API class with no objects" );
46  status = rtems_task_ident(
47    rtems_build_id( 0, 0, 0x12, 0x3456) /* 0x123456 */,
48    RTEMS_SEARCH_ALL_NODES,
49    &id
50  );
51  fatal_directive_status( status, RTEMS_INVALID_NAME, "rtems_task_ident" );
52
53  TEST_END();
54  rtems_test_exit(0);
55}
56
57/* configuration information */
58
59#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
60#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
61
62/*
63 *  In this application, the initialization task performs the system
64 *  initialization and then transforms itself into the idle task.
65 */
66#define CONFIGURE_IDLE_TASK_BODY Init
67#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
68
69/*
70 *  Another odd case to hit.  Since we use the Init task is Idle task
71 *  configuration, we can dummy up the initialization task configuration
72 *  to have a non-NULL pointer and 0 tasks.
73 */
74
75#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE 1
76
77rtems_initialization_tasks_table Initialization_tasks[1] =
78  { { 0, }};
79
80#define CONFIGURE_INIT_TASK_TABLE      Initialization_tasks
81#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
82#define CONFIGURE_INIT_TASK_STACK_SIZE 0
83
84/*
85 *  Ensure we test the case where memory is zero.  Not
86 *  all BSPs will set this to TRUE by default.
87 */
88#define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY TRUE
89
90#define CONFIGURE_INIT
91#include <rtems/confdefs.h>
92
93/* global variables */
Note: See TracBrowser for help on using the repository browser.