1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * Extension create fails |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 1989-2012. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifdef HAVE_CONFIG_H |
---|
17 | #include "config.h" |
---|
18 | #endif |
---|
19 | |
---|
20 | #include <tmacros.h> |
---|
21 | |
---|
22 | const char rtems_test_name[] = "SP 56"; |
---|
23 | |
---|
24 | /* forward declarations to avoid warnings */ |
---|
25 | rtems_task Init(rtems_task_argument argument); |
---|
26 | bool task_create(Thread_Control *executing, Thread_Control *created); |
---|
27 | |
---|
28 | bool task_create( |
---|
29 | Thread_Control *executing, |
---|
30 | Thread_Control *created |
---|
31 | ) |
---|
32 | { |
---|
33 | return false; |
---|
34 | } |
---|
35 | |
---|
36 | rtems_extensions_table Extensions = { |
---|
37 | task_create, /* task create user extension */ |
---|
38 | NULL, /* task start user extension */ |
---|
39 | NULL, /* task restart user extension */ |
---|
40 | NULL, /* task delete user extension */ |
---|
41 | NULL, /* task switch user extension */ |
---|
42 | NULL, /* task begin user extension */ |
---|
43 | NULL, /* task exitted user extension */ |
---|
44 | NULL /* fatal error user extension */ |
---|
45 | }; |
---|
46 | |
---|
47 | rtems_task Init( |
---|
48 | rtems_task_argument ignored |
---|
49 | ) |
---|
50 | { |
---|
51 | rtems_status_code status; |
---|
52 | rtems_id extension; |
---|
53 | rtems_id task_id; |
---|
54 | |
---|
55 | TEST_BEGIN(); |
---|
56 | |
---|
57 | puts( "Init - rtems_extension_create - OK" ); |
---|
58 | status = rtems_extension_create( |
---|
59 | rtems_build_name( 'E', 'X', 'T', ' ' ), |
---|
60 | &Extensions, |
---|
61 | &extension |
---|
62 | ); |
---|
63 | directive_failed( status, "rtems_extension_create" ); |
---|
64 | |
---|
65 | puts( "Init - rtems_task_create - create extension fails - UNSATISFIED" ); |
---|
66 | status = rtems_task_create( |
---|
67 | rtems_build_name( 'T', 'A', '1', ' ' ), |
---|
68 | 1, |
---|
69 | RTEMS_MINIMUM_STACK_SIZE, |
---|
70 | RTEMS_TIMESLICE, |
---|
71 | RTEMS_FLOATING_POINT, |
---|
72 | &task_id |
---|
73 | ); |
---|
74 | fatal_directive_status( status, RTEMS_UNSATISFIED, "rtems_task_create" ); |
---|
75 | |
---|
76 | puts( "Init - rtems_extension_delete - OK" ); |
---|
77 | status = rtems_extension_delete( extension ); |
---|
78 | directive_failed( status, "rtems_extension_delete" ); |
---|
79 | TEST_END(); |
---|
80 | rtems_test_exit(0); |
---|
81 | } |
---|
82 | |
---|
83 | /* configuration information */ |
---|
84 | |
---|
85 | #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER |
---|
86 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
87 | |
---|
88 | #define CONFIGURE_MAXIMUM_TASKS 2 |
---|
89 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 |
---|
90 | #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION |
---|
91 | |
---|
92 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
93 | |
---|
94 | #define CONFIGURE_INIT |
---|
95 | #include <rtems/confdefs.h> |
---|
96 | |
---|
97 | /* global variables */ |
---|