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 | |
---|
23 | const char rtems_test_name[] = "SP 54"; |
---|
24 | |
---|
25 | static void *Init( uintptr_t ignored ) |
---|
26 | { |
---|
27 | rtems_status_code status; |
---|
28 | rtems_task_priority pri; |
---|
29 | rtems_id id; |
---|
30 | const rtems_api_configuration_table *config; |
---|
31 | |
---|
32 | /* |
---|
33 | * It is possible that since this thread prints and there is no idle |
---|
34 | * task, that the system could fail miserably. :( |
---|
35 | */ |
---|
36 | TEST_BEGIN(); |
---|
37 | |
---|
38 | puts( "Init - use valid id of API class with no objects" ); |
---|
39 | status = rtems_task_set_priority( |
---|
40 | rtems_build_id(0x2,0x1,0x01,0x0001) /* 0xa010001 */, |
---|
41 | RTEMS_CURRENT_PRIORITY, |
---|
42 | &pri |
---|
43 | ); |
---|
44 | fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_set_priority" ); |
---|
45 | |
---|
46 | puts( "Init - lookup name within API class with no objects" ); |
---|
47 | status = rtems_task_ident( |
---|
48 | rtems_build_id( 0, 0, 0x12, 0x3456) /* 0x123456 */, |
---|
49 | RTEMS_SEARCH_ALL_NODES, |
---|
50 | &id |
---|
51 | ); |
---|
52 | fatal_directive_status( status, RTEMS_INVALID_NAME, "rtems_task_ident" ); |
---|
53 | |
---|
54 | rtems_test_assert( rtems_configuration_get_do_zero_of_workspace() ); |
---|
55 | |
---|
56 | config = rtems_configuration_get_rtems_api_configuration(); |
---|
57 | rtems_test_assert( config->number_of_initialization_tasks == 0 ); |
---|
58 | rtems_test_assert( config->User_initialization_tasks_table == NULL ); |
---|
59 | |
---|
60 | TEST_END(); |
---|
61 | rtems_test_exit(0); |
---|
62 | } |
---|
63 | |
---|
64 | /* configuration information */ |
---|
65 | |
---|
66 | #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER |
---|
67 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
68 | |
---|
69 | /* |
---|
70 | * In this application, the initialization task performs the system |
---|
71 | * initialization and then transforms itself into the idle task. |
---|
72 | */ |
---|
73 | #define CONFIGURE_IDLE_TASK_BODY Init |
---|
74 | #define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION |
---|
75 | |
---|
76 | #define CONFIGURE_DIRTY_MEMORY |
---|
77 | |
---|
78 | /* |
---|
79 | * Ensure we test the case where memory is zero. |
---|
80 | */ |
---|
81 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
82 | |
---|
83 | #define CONFIGURE_INIT |
---|
84 | #include <rtems/confdefs.h> |
---|
85 | |
---|
86 | /* global variables */ |
---|