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.com/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifdef HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <tmacros.h> |
---|
22 | |
---|
23 | /* forward declarations to avoid warnings */ |
---|
24 | rtems_task Init(rtems_task_argument argument); |
---|
25 | |
---|
26 | rtems_task Init( |
---|
27 | rtems_task_argument ignored |
---|
28 | ) |
---|
29 | { |
---|
30 | rtems_status_code status; |
---|
31 | rtems_task_priority pri; |
---|
32 | rtems_id id; |
---|
33 | |
---|
34 | /* |
---|
35 | * It is possible that since this thread prints and there is no idle |
---|
36 | * task, that the system could fail miserably. :( |
---|
37 | */ |
---|
38 | puts( "\n\n*** TEST 54 ***" ); |
---|
39 | |
---|
40 | puts( "Init - use valid id of API class with no objects" ); |
---|
41 | status = rtems_task_set_priority( |
---|
42 | rtems_build_id(0x2,0x1,0x01,0x0001) /* 0xa010001 */, |
---|
43 | RTEMS_CURRENT_PRIORITY, |
---|
44 | &pri |
---|
45 | ); |
---|
46 | fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_set_priority" ); |
---|
47 | |
---|
48 | puts( "Init - lookup name within API class with no objects" ); |
---|
49 | status = rtems_task_ident( |
---|
50 | rtems_build_id( 0, 0, 0x12, 0x3456) /* 0x123456 */, |
---|
51 | RTEMS_SEARCH_ALL_NODES, |
---|
52 | &id |
---|
53 | ); |
---|
54 | fatal_directive_status( status, RTEMS_INVALID_NAME, "rtems_task_ident" ); |
---|
55 | |
---|
56 | puts( "*** END OF TEST 54 ***" ); |
---|
57 | rtems_test_exit(0); |
---|
58 | } |
---|
59 | |
---|
60 | /* configuration information */ |
---|
61 | |
---|
62 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
63 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
64 | |
---|
65 | /* |
---|
66 | * In this application, the initialization task performs the system |
---|
67 | * initialization and then transforms itself into the idle task. |
---|
68 | */ |
---|
69 | #define CONFIGURE_IDLE_TASK_BODY Init |
---|
70 | #define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION |
---|
71 | |
---|
72 | /* |
---|
73 | * Another odd case to hit. Since we use the Init task is Idle task |
---|
74 | * configuration, we can dummy up the initialization task configuration |
---|
75 | * to have a non-NULL pointer and 0 tasks. |
---|
76 | */ |
---|
77 | |
---|
78 | #define CONFIGURE_HAS_OWN_INIT_TASK_TABLE 1 |
---|
79 | |
---|
80 | rtems_initialization_tasks_table Initialization_tasks[1] = |
---|
81 | { { 0, }}; |
---|
82 | |
---|
83 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
84 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
85 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
86 | |
---|
87 | /* |
---|
88 | * Ensure we test the case where memory is zero. Not |
---|
89 | * all BSPs will set this to TRUE by default. |
---|
90 | */ |
---|
91 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY TRUE |
---|
92 | |
---|
93 | #define CONFIGURE_INIT |
---|
94 | #include <rtems/confdefs.h> |
---|
95 | |
---|
96 | /* global variables */ |
---|