1 /* This is the test control routine for the FileX FAT file system.  All tests are dispatched from this routine.  */
2 
3 #ifndef FX_STANDALONE_ENABLE
4 #include "tx_api.h"
5 #else
6 #include   <pthread.h>
7 #endif
8 #include "fx_api.h"
9 #include "fx_file.h"
10 #include "fx_directory.h"
11 #include "fx_fault_tolerant.h"
12 #include "fx_media.h"
13 #include "fx_system.h"
14 #include "fx_unicode.h"
15 #include <stdio.h>
16 #include <stdlib.h>
17 
18 #if defined(EXPECTED_MAJOR_VERSION) && (!defined(FILEX_MAJOR_VERSION) || FILEX_MAJOR_VERSION != EXPECTED_MAJOR_VERSION)
19 #error "FILEX_MAJOR_VERSION"
20 #endif /* Check FILEX_MAJOR_VERSION */
21 
22 #if defined(EXPECTED_MINOR_VERSION) && (!defined(FILEX_MINOR_VERSION) || FILEX_MINOR_VERSION != EXPECTED_MINOR_VERSION)
23 #error "FILEX_MINOR_VERSION"
24 #endif /* Check FILEX_MINOR_VERSION */
25 
26 #define TEST_STACK_SIZE         8192 * 2
27 
28 #ifndef TEST_TIMEOUT_BASE
29 #define TEST_TIMEOUT_BASE       1
30 #endif
31 
32 /* 1 minute. */
33 #define TEST_TIMEOUT_LOW        (6000 * TEST_TIMEOUT_BASE)
34 /* 15 minutes. */
35 #define TEST_TIMEOUT_MID        (90000 * TEST_TIMEOUT_BASE)
36 /* 60 minutes. */
37 #define TEST_TIMEOUT_HIGH       (360000 * TEST_TIMEOUT_BASE * 12)
38 #ifdef FX_ENABLE_FAULT_TOLERANT
39 /* buffer for fault tolerant */
40 #define FAULT_TOLERANT_SIZE     FX_FAULT_TOLERANT_MINIMAL_BUFFER_SIZE
41 #else
42 #define     FAULT_TOLERANT_SIZE     0
43 #endif
44 
45 /* Define the test control ThreadX objects...  */
46 #ifndef FX_STANDALONE_ENABLE
47 TX_THREAD       test_control_thread;
48 #ifndef TEST_TIMEOUT_DISABLE
49 TX_SEMAPHORE    test_control_sema;
50 UCHAR           test_control_thread_stack[TEST_STACK_SIZE];
51 #endif
52 #endif
53 
54 #ifdef FX_STANDALONE_ENABLE
55 void    tx_application_define(void *first_unused_memory);
56 #define tx_kernel_enter()       tx_application_define(0);
57 #endif
58 /* Define the test control global variables.   */
59 
60 ULONG           test_control_return_status;
61 ULONG           test_control_successful_tests;
62 ULONG           test_control_failed_tests;
63 ULONG           test_control_na_tests;
64 
65 /* Remember the start of free memory.  */
66 
67 //static ULONG    test_memory_space[1024 * 1024];
68 ULONG            test_memory_space[10000000];
69 UCHAR           *test_free_memory_ptr = (UCHAR*)test_memory_space;
70 
71 #ifndef FX_STANDALONE_ENABLE
72 extern volatile UINT       _tx_thread_preempt_disable;
73 extern volatile ULONG      _tx_thread_system_state;
74 extern TX_THREAD          *_tx_thread_current_ptr;
75 extern TX_THREAD           _tx_timer_thread;
76 #endif
77 
78 /* Define test entry pointer type.  */
79 
80 typedef  struct TEST_ENTRY_STRUCT
81 {
82 VOID        (*test_entry)(void *);
83 UINT        timeout;
84 } TEST_ENTRY;
85 
86 /* Define the prototypes for the test entry points.  */
87 void    filex_fault_tolerant_corrupted_log_file_test_application_define(void *);
88 void    filex_fault_tolerant_enable_test_application_define(void *);
89 void    filex_fault_tolerant_enable_1_test_application_define(void *first_unused_memory);
90 void    filex_fault_tolerant_enable_2_test_application_define(void *first_unused_memory);
91 void    filex_fault_tolerant_enable_3_test_application_define(void *first_unused_memory);
92 void    filex_fault_tolerant_enable_4_test_application_define(void *first_unused_memory);
93 void    filex_fault_tolerant_media_check_application_define(void *);
94 void    filex_fault_tolerant_media_full_test_application_define(void *);
95 void    filex_fault_tolerant_loop_write_data_test_application_define(void *);
96 void    filex_fault_tolerant_file_seek_test_application_define(void *);
97 void    filex_fault_tolerant_file_random_seek_test_application_define(void *);
98 void    filex_fault_tolerant_file_write_available_test_application_define(void *);
99 void    filex_fault_tolerant_file_write_data_interrupt_test_application_define(void *);
100 void    filex_fault_tolerant_file_write_fat_interrupt_test_application_define(void *);
101 void    filex_fault_tolerant_file_write_directory_interrupt_test_application_define(void *);
102 void    filex_fault_tolerant_file_write_undo_log_interrupt_test_application_define(void *);
103 void    filex_fault_tolerant_file_write_redo_log_interrupt_test_application_define(void *);
104 void    filex_fault_tolerant_file_write_fat_crossover_test_application_define(void *);
105 void    filex_fault_tolerant_file_write_fat_crossover_2_test_application_define(void *first_unused_memory);
106 void    filex_fault_tolerant_file_create_directory_interrupt_test_application_define(void *);
107 void    filex_fault_tolerant_file_create_redo_log_interrupt_test_application_define(void *);
108 void    filex_fault_tolerant_file_delete_fat_interrupt_test_application_define(void *);
109 void    filex_fault_tolerant_file_delete_fat_multple_sectors_test_application_define(void *);
110 void    filex_fault_tolerant_file_delete_directory_interrupt_test_application_define(void *);
111 void    filex_fault_tolerant_file_delete_test_application_define(void *);
112 void    filex_fault_tolerant_file_delete_undo_log_interrupt_test_application_define(void *);
113 void    filex_fault_tolerant_file_delete_redo_log_interrupt_test_application_define(void *);
114 void    filex_fault_tolerant_file_rename_directory_interrupt_test_application_define(void *);
115 void    filex_fault_tolerant_file_rename_redo_log_interrupt_test_application_define(void *);
116 void    filex_fault_tolerant_file_allocate_fat_crossover_test_application_define(void *first_unused_memory);
117 void    filex_fault_tolerant_file_best_effort_allocate_fat_crossover_test_application_define(void *first_unused_memory);
118 void    filex_fault_tolerant_file_allocate_fat_interrupt_test_application_define(void *);
119 void    filex_fault_tolerant_file_allocate_directory_interrupt_test_application_define(void *);
120 void    filex_fault_tolerant_file_allocate_undo_log_interrupt_test_application_define(void *);
121 void    filex_fault_tolerant_file_allocate_redo_log_interrupt_test_application_define(void *);
122 void    filex_fault_tolerant_file_allocate_test_application_define(void *);
123 void    filex_fault_tolerant_file_best_allocate_fat_interrupt_test_application_define(void *);
124 void    filex_fault_tolerant_file_best_allocate_directory_interrupt_test_application_define(void *);
125 void    filex_fault_tolerant_file_best_allocate_undo_log_interrupt_test_application_define(void *);
126 void    filex_fault_tolerant_file_best_allocate_redo_log_interrupt_test_application_define(void *);
127 void    filex_fault_tolerant_file_truncate_release_available_test_application_define(void *first_unused_memory);
128 void    filex_fault_tolerant_file_truncate_directory_interrupt_test_application_define(void *);
129 void    filex_fault_tolerant_file_truncate_redo_log_interrupt_test_application_define(void *);
130 void    filex_fault_tolerant_file_truncate_release_fat_interrupt_test_application_define(void *);
131 void    filex_fault_tolerant_file_truncate_release_directory_interrupt_test_application_define(void *);
132 void    filex_fault_tolerant_file_truncate_release_undo_log_interrupt_test_application_define(void *);
133 void    filex_fault_tolerant_file_truncate_release_redo_log_interrupt_test_application_define(void *);
134 void    filex_fault_tolerant_file_attributes_set_directory_interrupt_test_application_define(void *);
135 void    filex_fault_tolerant_file_attributes_set_redo_log_interrupt_test_application_define(void *);
136 void    filex_fault_tolerant_file_corruption_test_application_define(void *first_unused_memory);
137 void    filex_fault_tolerant_directory_create_directory_interrupt_test_application_define(void *);
138 void    filex_fault_tolerant_directory_create_redo_log_interrupt_test_application_define(void *);
139 void    filex_fault_tolerant_directory_delete_directory_interrupt_test_application_define(void *);
140 void    filex_fault_tolerant_directory_delete_redo_log_interrupt_test_application_define(void *);
141 void    filex_fault_tolerant_directory_rename_directory_interrupt_test_application_define(void *);
142 void    filex_fault_tolerant_directory_rename_redo_log_interrupt_test_application_define(void *);
143 void    filex_fault_tolerant_directory_attributes_set_directory_interrupt_test_application_define(void *);
144 void    filex_fault_tolerant_directory_attributes_set_redo_log_interrupt_test_application_define(void *);
145 void    filex_fault_tolerant_log_recover_fat_test_application_define(void *);
146 void    filex_fault_tolerant_log_recover_directory_test_application_define(void *);
147 void    filex_fault_tolerant_log_full_test_application_define(void *);
148 void    filex_fault_tolerant_log_expand_test_application_define(void *);
149 void    filex_fault_tolerant_log_expand_interrupt_test_application_define(void *);
150 void    filex_fault_tolerant_long_directory_create_directory_interrupt_test_application_define(void *first_unused_memory);
151 void    filex_fault_tolerant_long_directory_create_redo_log_interrupt_test_application_define(void *first_unused_memory);
152 void    filex_fault_tolerant_long_directory_rename_directory_interrupt_test_application_define(void *first_unused_memory);
153 void    filex_fault_tolerant_long_directory_rename_redo_log_interrupt_test_application_define(void *first_unused_memory);
154 void    filex_fault_tolerant_long_file_create_directory_interrupt_test_application_define(void *first_unused_memory);
155 void    filex_fault_tolerant_long_file_create_redo_log_interrupt_test_application_define(void *first_unused_memory);
156 void    filex_fault_tolerant_long_directory_rename_io_error_test_application_define(void *first_unused_memory);
157 void    filex_fault_tolerant_write_large_data_test_application_define(void *);
158 void    filex_fault_tolerant_write_large_data_interrupt_test_application_define(void *);
159 void    filex_fault_tolerant_write_large_data_fat_chain_cleanup_interrupt_test_application_define(void *);
160 void    filex_fault_tolerant_write_large_data_fat_interrupt_test_application_define(void *);
161 void    filex_fault_tolerant_write_large_data_directory_interrupt_test_application_define(void *);
162 void    filex_fault_tolerant_write_large_data_undo_log_interrupt_test_application_define(void *);
163 void    filex_fault_tolerant_write_large_data_redo_log_interrupt_test_application_define(void *);
164 void    filex_fault_tolerant_delete_large_data_test_application_define(void *);
165 void    filex_fault_tolerant_recover_fail_test_application_define(void *first_unused_memory);
166 void    filex_fault_tolerant_unicode_directory_create_directory_interrupt_test_application_define(void *);
167 void    filex_fault_tolerant_unicode_directory_create_redo_log_interrupt_test_application_define(void *);
168 void    filex_fault_tolerant_unicode_directory_rename_directory_interrupt_test_application_define(void *);
169 void    filex_fault_tolerant_unicode_directory_rename_redo_log_interrupt_test_application_define(void *);
170 void    filex_fault_tolerant_unicode_file_create_directory_interrupt_test_application_define(void *);
171 void    filex_fault_tolerant_unicode_file_create_redo_log_interrupt_test_application_define(void *);
172 void    filex_fault_tolerant_unicode_file_rename_directory_interrupt_test_application_define(void *);
173 void    filex_fault_tolerant_unicode_file_rename_redo_log_interrupt_test_application_define(void *);
174 void    filex_media_format_open_close_application_define(void *);
175 void    filex_media_multiple_format_open_close_application_define(void *first_unused_memory);
176 void    filex_media_flush_application_define(void *first_unused_memory);
177 void    filex_media_abort_application_define(void *first_unused_memory);
178 void    filex_media_cache_invalidate_application_define(void *first_unused_memory);
179 void    filex_media_volume_get_set_application_define(void *first_unused_memory);
180 void    filex_media_read_write_sector_application_define(void *first_unused_memory);
181 void    filex_media_check_application_define(void *first_unused_memory);
182 void    filex_media_hidden_sectors_test_application_define(void *first_unused_memory);
183 void    filex_system_date_time_application_define(void *first_unused_memory);
184 void    filex_directory_create_delete_application_define(void *first_unused_memory);
185 void    filex_directory_default_get_set_application_define(void *first_unused_memory);
186 void    filex_directory_duplicate_entries_application_define(void *first_unused_memory);
187 void    filex_directory_naming_application_define(void *first_unused_memory);
188 void    filex_directory_first_next_find_application_define(void *first_unused_memory);
189 void    filex_directory_local_path_application_define(void *first_unused_memory);
190 void    filex_directory_rename_application_define(void *first_unused_memory);
191 void    filex_directory_long_short_get_application_define(void *first_unused_memory);
192 void    filex_directory_attributes_read_set_application_define(void *first_unused_memory);
193 void    filex_file_create_delete_application_define(void *first_unused_memory);
194 void    filex_file_naming_application_define(void *first_unused_memory);
195 void    filex_file_read_write_application_define(void *first_unused_memory);
196 void    filex_file_write_seek_application_define(void *first_unused_memory);
197 void    filex_file_name_application_define(void *first_unused_memory);
198 void    filex_file_write_notify_application_define(void *first_unused_memory);
199 void    filex_file_write_available_cluster_application_define(void *first_unused_memory);
200 void    filex_file_seek_application_define(void *first_unused_memory);
201 void    filex_file_allocate_truncate_application_define(void *first_unused_memory);
202 void    filex_file_allocate_application_define(void *first_unused_memory);
203 void    filex_file_attributes_read_set_application_define(void *first_unused_memory);
204 void    filex_file_date_time_set_application_define(void *first_unused_memory);
205 void    filex_file_rename_application_define(void *first_unused_memory);
206 void    filex_unicode_application_define(void *first_unused_memory);
207 void    filex_unicode_2_application_define(void *first_unused_memory);
208 void    filex_unicode_3_application_define(void *first_unused_memory);
209 void    filex_unicode_4_application_define(void *first_unused_memory);
210 void    filex_unicode_directory_rename_application_define(void *first_unused_memory);
211 void    filex_unicode_file_directory_rename_extra_test_application_define(void *first_unused_memory);
212 void    filex_unicode_file_directory_rename_extra_2_test_application_define(void *first_unused_memory);
213 void    filex_unicode_file_rename_application_define(void *first_unused_memory);
214 void    filex_unicode_name_string_application_define(void *first_ununsed_memory);
215 void    filex_unicode_directory_entry_test_application_define(void *first_unused_memory);
216 void    filex_unicode_directory_entry_2_test_application_define(void *first_unused_memory);
217 void    filex_unicode_directory_entry_change_test_application_define(void *first_unused_memory);
218 void    filex_unicode_fat_entry_test_application_define(void *first_unused_memory);
219 void    filex_unicode_fat_entry_1_test_application_define(void *first_unused_memory);
220 void    filex_unicode_fat_entry_2_test_application_define(void *first_unused_memory);
221 void    filex_unicode_fat_entry_3_test_application_define(void *first_unused_memory);
222 void    filex_utility_application_define(void *first_unused_memory);
223 void    filex_utility_fat_flush_application_define(void *first_unused_memory);
224 void    test_application_define(void *first_unused_memory);
225 
226 
227 /* Define the array of test entry points.  */
228 
229 TEST_ENTRY  test_control_tests[] =
230 {
231 
232 #ifdef CTEST
233     {test_application_define, TEST_TIMEOUT_HIGH},
234 #else /* CTEST */
235     {filex_fault_tolerant_corrupted_log_file_test_application_define, TEST_TIMEOUT_LOW},
236     {filex_fault_tolerant_enable_test_application_define, TEST_TIMEOUT_LOW},
237     {filex_fault_tolerant_enable_1_test_application_define, TEST_TIMEOUT_LOW},
238     {filex_fault_tolerant_enable_2_test_application_define, TEST_TIMEOUT_LOW},
239     {filex_fault_tolerant_enable_3_test_application_define, TEST_TIMEOUT_LOW},
240     {filex_fault_tolerant_enable_4_test_application_define, TEST_TIMEOUT_LOW},
241     {filex_fault_tolerant_media_check_application_define, TEST_TIMEOUT_LOW},
242     //{filex_fault_tolerant_media_full_test_application_define, TEST_TIMEOUT_HIGH},
243     {filex_fault_tolerant_loop_write_data_test_application_define, TEST_TIMEOUT_HIGH},
244     {filex_fault_tolerant_file_seek_test_application_define, TEST_TIMEOUT_LOW},
245     {filex_fault_tolerant_file_random_seek_test_application_define, TEST_TIMEOUT_MID},
246     {filex_fault_tolerant_file_write_data_interrupt_test_application_define, TEST_TIMEOUT_LOW},
247     {filex_fault_tolerant_file_write_available_test_application_define, TEST_TIMEOUT_LOW},
248     {filex_fault_tolerant_file_write_fat_interrupt_test_application_define, TEST_TIMEOUT_LOW},
249     {filex_fault_tolerant_file_write_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
250     {filex_fault_tolerant_file_write_undo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
251     {filex_fault_tolerant_file_write_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
252     {filex_fault_tolerant_file_write_fat_crossover_test_application_define, TEST_TIMEOUT_LOW},
253     {filex_fault_tolerant_file_write_fat_crossover_2_test_application_define, TEST_TIMEOUT_LOW},
254     {filex_fault_tolerant_file_allocate_fat_crossover_test_application_define, TEST_TIMEOUT_LOW},
255     {filex_fault_tolerant_file_best_effort_allocate_fat_crossover_test_application_define, TEST_TIMEOUT_LOW},
256     {filex_fault_tolerant_file_create_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
257     {filex_fault_tolerant_file_create_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
258     {filex_fault_tolerant_file_delete_fat_interrupt_test_application_define, TEST_TIMEOUT_LOW},
259     {filex_fault_tolerant_file_delete_fat_multple_sectors_test_application_define, TEST_TIMEOUT_LOW},
260     {filex_fault_tolerant_file_delete_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
261     {filex_fault_tolerant_file_delete_test_application_define,TEST_TIMEOUT_LOW },
262     {filex_fault_tolerant_file_delete_undo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
263     {filex_fault_tolerant_file_delete_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
264     {filex_fault_tolerant_file_rename_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
265     {filex_fault_tolerant_file_rename_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
266     {filex_fault_tolerant_file_allocate_fat_interrupt_test_application_define, TEST_TIMEOUT_LOW},
267     {filex_fault_tolerant_file_allocate_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
268     {filex_fault_tolerant_file_allocate_undo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
269     {filex_fault_tolerant_file_allocate_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
270     {filex_fault_tolerant_file_allocate_test_application_define, TEST_TIMEOUT_LOW},
271     {filex_fault_tolerant_file_best_allocate_fat_interrupt_test_application_define, TEST_TIMEOUT_LOW},
272     {filex_fault_tolerant_file_best_allocate_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
273     {filex_fault_tolerant_file_best_allocate_undo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
274     {filex_fault_tolerant_file_best_allocate_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
275     {filex_fault_tolerant_file_truncate_release_available_test_application_define, TEST_TIMEOUT_LOW},
276     {filex_fault_tolerant_file_truncate_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
277     {filex_fault_tolerant_file_truncate_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
278     {filex_fault_tolerant_file_truncate_release_fat_interrupt_test_application_define, TEST_TIMEOUT_LOW},
279     {filex_fault_tolerant_file_truncate_release_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
280     {filex_fault_tolerant_file_truncate_release_undo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
281     {filex_fault_tolerant_file_truncate_release_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
282     {filex_fault_tolerant_file_attributes_set_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
283     {filex_fault_tolerant_file_attributes_set_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
284     {filex_fault_tolerant_file_corruption_test_application_define, TEST_TIMEOUT_HIGH},
285     {filex_fault_tolerant_directory_create_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
286     {filex_fault_tolerant_directory_create_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
287     {filex_fault_tolerant_directory_delete_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
288     {filex_fault_tolerant_directory_delete_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
289     {filex_fault_tolerant_directory_rename_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
290     {filex_fault_tolerant_directory_rename_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
291     {filex_fault_tolerant_directory_attributes_set_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
292     {filex_fault_tolerant_directory_attributes_set_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
293     {filex_fault_tolerant_log_recover_fat_test_application_define, TEST_TIMEOUT_LOW},
294     {filex_fault_tolerant_log_recover_directory_test_application_define, TEST_TIMEOUT_LOW},
295     {filex_fault_tolerant_log_full_test_application_define, TEST_TIMEOUT_LOW},
296     {filex_fault_tolerant_long_directory_create_directory_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
297     {filex_fault_tolerant_long_directory_create_redo_log_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
298 #if 1
299     {filex_fault_tolerant_long_directory_rename_directory_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
300     {filex_fault_tolerant_long_directory_rename_redo_log_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
301 #endif
302     {filex_fault_tolerant_long_file_create_directory_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
303     {filex_fault_tolerant_long_file_create_redo_log_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
304     {filex_fault_tolerant_long_directory_rename_io_error_test_application_define, TEST_TIMEOUT_HIGH},
305     {filex_fault_tolerant_recover_fail_test_application_define, TEST_TIMEOUT_LOW},
306     {filex_fault_tolerant_write_large_data_test_application_define, TEST_TIMEOUT_HIGH},
307     {filex_fault_tolerant_write_large_data_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
308     {filex_fault_tolerant_write_large_data_fat_chain_cleanup_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
309     {filex_fault_tolerant_write_large_data_fat_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
310     {filex_fault_tolerant_write_large_data_directory_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
311     {filex_fault_tolerant_write_large_data_undo_log_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
312     {filex_fault_tolerant_write_large_data_redo_log_interrupt_test_application_define, TEST_TIMEOUT_HIGH},
313     {filex_fault_tolerant_delete_large_data_test_application_define, TEST_TIMEOUT_HIGH},
314     {filex_fault_tolerant_unicode_directory_create_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
315     {filex_fault_tolerant_unicode_directory_create_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
316     {filex_fault_tolerant_unicode_directory_rename_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
317     {filex_fault_tolerant_unicode_directory_rename_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
318     {filex_fault_tolerant_unicode_file_create_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
319     {filex_fault_tolerant_unicode_file_create_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
320     {filex_fault_tolerant_unicode_file_rename_directory_interrupt_test_application_define, TEST_TIMEOUT_LOW},
321     {filex_fault_tolerant_unicode_file_rename_redo_log_interrupt_test_application_define, TEST_TIMEOUT_LOW},
322     {filex_media_format_open_close_application_define, TEST_TIMEOUT_LOW},
323     {filex_media_multiple_format_open_close_application_define, TEST_TIMEOUT_LOW},
324     {filex_media_flush_application_define, TEST_TIMEOUT_LOW},
325     {filex_media_abort_application_define, TEST_TIMEOUT_LOW},
326     {filex_media_cache_invalidate_application_define, TEST_TIMEOUT_LOW},
327     {filex_media_volume_directory_entry_application_define, TEST_TIMEOUT_LOW},
328     {filex_media_volume_get_set_application_define, TEST_TIMEOUT_LOW},
329     {filex_media_read_write_sector_application_define, TEST_TIMEOUT_LOW},
330     {filex_media_check_application_define, TEST_TIMEOUT_LOW},
331     {filex_media_hidden_sectors_test_application_define, TEST_TIMEOUT_LOW},
332     {filex_system_date_time_application_define, TEST_TIMEOUT_LOW},
333     {filex_directory_create_delete_application_define, TEST_TIMEOUT_LOW},
334     {filex_directory_default_get_set_application_define, TEST_TIMEOUT_LOW},
335     {filex_directory_duplicate_entries_application_define, TEST_TIMEOUT_LOW},
336     {filex_directory_naming_application_define, TEST_TIMEOUT_LOW},
337     {filex_directory_first_next_find_application_define, TEST_TIMEOUT_LOW},
338 #if 1
339     {filex_directory_local_path_application_define, TEST_TIMEOUT_LOW},
340 #endif
341     {filex_directory_rename_application_define, TEST_TIMEOUT_LOW},
342     {filex_directory_long_short_get_application_define, TEST_TIMEOUT_LOW},
343     {filex_directory_attributes_read_set_application_define, TEST_TIMEOUT_LOW},
344     {filex_file_create_delete_application_define, TEST_TIMEOUT_LOW},
345     {filex_file_naming_application_define, TEST_TIMEOUT_LOW},
346 #if 1
347     {filex_file_read_write_application_define, TEST_TIMEOUT_LOW},
348     {filex_file_write_seek_application_define, TEST_TIMEOUT_LOW},
349     {filex_file_name_application_define, TEST_TIMEOUT_LOW},
350     {filex_file_write_notify_application_define, TEST_TIMEOUT_LOW},
351     {filex_file_write_available_cluster_application_define, TEST_TIMEOUT_LOW},
352     {filex_file_seek_application_define, TEST_TIMEOUT_LOW},
353     {filex_file_allocate_truncate_application_define, TEST_TIMEOUT_LOW},
354     {filex_file_allocate_application_define, TEST_TIMEOUT_LOW},
355 #endif
356     {filex_file_attributes_read_set_application_define, TEST_TIMEOUT_LOW},
357     {filex_file_date_time_set_application_define, TEST_TIMEOUT_LOW},
358     {filex_file_rename_application_define, TEST_TIMEOUT_LOW},
359     {filex_unicode_application_define, TEST_TIMEOUT_LOW},
360     {filex_unicode_2_application_define, TEST_TIMEOUT_LOW},
361     {filex_unicode_3_application_define, TEST_TIMEOUT_LOW},
362     {filex_unicode_4_application_define, TEST_TIMEOUT_LOW},
363     {filex_unicode_directory_entry_test_application_define, TEST_TIMEOUT_LOW},
364     {filex_unicode_directory_entry_2_test_application_define, TEST_TIMEOUT_LOW},
365     {filex_unicode_directory_entry_change_test_application_define,TEST_TIMEOUT_LOW },
366     {filex_unicode_directory_rename_application_define, TEST_TIMEOUT_LOW},
367     {filex_unicode_fat_entry_test_application_define, TEST_TIMEOUT_LOW},
368     {filex_unicode_fat_entry_1_test_application_define, TEST_TIMEOUT_LOW},
369     {filex_unicode_fat_entry_2_test_application_define, TEST_TIMEOUT_LOW},
370     {filex_unicode_fat_entry_3_test_application_define, TEST_TIMEOUT_LOW},
371     {filex_unicode_file_directory_rename_extra_test_application_define, TEST_TIMEOUT_LOW},
372     {filex_unicode_file_directory_rename_extra_2_test_application_define, TEST_TIMEOUT_LOW},
373     {filex_unicode_file_rename_application_define, TEST_TIMEOUT_LOW},
374     {filex_unicode_name_string_application_define, TEST_TIMEOUT_LOW},
375     {filex_utility_application_define, TEST_TIMEOUT_LOW},
376     {filex_utility_fat_flush_application_define, TEST_TIMEOUT_LOW},
377 
378 #endif /* CTEST */
379     {FX_NULL, TEST_TIMEOUT_LOW}
380 };
381 /* Define thread prototypes.  */
382 
383 void  test_control_thread_entry(ULONG thread_input);
384 void  test_control_return(UINT status);
385 void  test_control_cleanup(void);
386 
387 
388 /* Define necessary exernal references.  */
389 #ifndef FX_STANDALONE_ENABLE
390 #ifdef __ghs
391 extern TX_MUTEX                 __ghLockMutex;
392 #endif
393 
394 extern TX_TIMER                 *_tx_timer_created_ptr;
395 extern ULONG                    _tx_timer_created_count;
396 #ifndef TX_TIMER_PROCESS_IN_ISR
397 extern TX_THREAD                _tx_timer_thread;
398 #endif
399 extern TX_THREAD                *_tx_thread_created_ptr;
400 extern ULONG                    _tx_thread_created_count;
401 extern TX_SEMAPHORE             *_tx_semaphore_created_ptr;
402 extern ULONG                    _tx_semaphore_created_count;
403 extern TX_QUEUE                 *_tx_queue_created_ptr;
404 extern ULONG                    _tx_queue_created_count;
405 extern TX_MUTEX                 *_tx_mutex_created_ptr;
406 extern ULONG                    _tx_mutex_created_count;
407 extern TX_EVENT_FLAGS_GROUP     *_tx_event_flags_created_ptr;
408 extern ULONG                    _tx_event_flags_created_count;
409 extern TX_BYTE_POOL             *_tx_byte_pool_created_ptr;
410 extern ULONG                    _tx_byte_pool_created_count;
411 extern TX_BLOCK_POOL            *_tx_block_pool_created_ptr;
412 extern ULONG                    _tx_block_pool_created_count;
413 #endif
414 
415 extern FX_MEDIA *               _fx_system_media_opened_ptr;
416 extern ULONG                    _fx_system_media_opened_count;
417 
418 
419 static FX_MEDIA                 media_instance;
420 static FX_FILE                  file_instance;
421 static FX_LOCAL_PATH            local_path_instance;
422 
423 
fake_driver(FX_MEDIA * media_ptr)424 static void fake_driver(FX_MEDIA *media_ptr)
425 {
426     FX_PARAMETER_NOT_USED(media_ptr);
427 }
428 
429 /* Define main entry point.  */
430 
main()431 int main()
432 {
433 ULONG       actual;
434 
435     /* Print out some test information banners.  */
436     printf("%s\n", _fx_version_id);
437     actual =  FX_MAX_LONG_NAME_LEN;
438     if (actual < 256)
439         printf("**** ERROR *****  FileX and tests must be built with FX_MAX_LONG_NAME_LEN=256\n");
440     actual =  FX_MAX_LAST_NAME_LEN;
441     if (actual < 256)
442         printf("**** ERROR *****  FileX and tests must be built with FX_MAX_LAST_NAME_LEN=256\n");
443 
444 #ifdef FX_FAULT_TOLERANT
445     printf("Immediately write feature is built-in.\n");
446 #else
447     printf("immediately write feature is not built-in.\n");
448 #endif
449 
450 #ifdef FX_ENABLE_FAULT_TOLERANT
451     printf("Fault tolerant feature is built-in.\n");
452 #else
453     printf("Fault tolerant feature is not built-in.\n");
454 #endif
455 
456     printf("\n");
457 
458     /* Enter the ThreadX kernel.  */
459     tx_kernel_enter();
460 }
461 
462 
463 /* Define what the initial system looks like.  */
464 
tx_application_define(void * first_unused_memory)465 void    tx_application_define(void *first_unused_memory)
466 {
467 
468 #ifndef FX_STANDALONE_ENABLE
469 ULONG   saved_system_state;
470 UINT    status;
471 ULONG64 available_bytes;
472 ULONG   temp;
473 CHAR    *string_ptr;
474 UINT    attributes;
475 UCHAR   buffer[100];
476 UCHAR   unicode_name[] = { 1,0,2,0,3,0,4,0,5,0,6,0,0,0};
477 #ifdef FX_ENABLE_FAULT_TOLERANT
478 UCHAR   fault_tolerant_buffer[FAULT_TOLERANT_SIZE];
479 #endif /* FX_ENABLE_FAULT_TOLERANT */
480 
481     FX_PARAMETER_NOT_USED(first_unused_memory);
482 
483 #ifdef FX_ENABLE_FAULT_TOLERANT
484     /* Perform initialization, NULL thread, and time thread tests against the error checking shell.  */
485 
486     /* Check caller error checking for fx_fault_tolerant_enable.  */
487 
488     /* Save the system state.  */
489     saved_system_state =  _tx_thread_system_state;
490 
491     /* Setup the fake media structure.  */
492     media_instance.fx_media_id =  FX_MEDIA_ID;
493 
494     /* Call the _fxe_media_abort to cause and error.  */
495     status =  _fxe_fault_tolerant_enable(&media_instance, fault_tolerant_buffer, FAULT_TOLERANT_SIZE);
496 
497     /* Check for the error.  */
498     if (status != FX_CALLER_ERROR)
499     {
500 
501         /* Increment the failed tests counter.  */
502         test_control_failed_tests++;
503 
504         /* Print error message.  */
505         printf("Error in checking of fxe_fault_tolerant_enable!\n");
506     }
507 
508     /* Clear the system state to simulate an ISR caller.  */
509     _tx_thread_system_state =  0;
510 
511     /* Call the _fxe_media_abort to cause and error.  */
512     status =  _fxe_fault_tolerant_enable(&media_instance, fault_tolerant_buffer, FAULT_TOLERANT_SIZE);
513 
514     /* Check for the error.  */
515     if (status != FX_CALLER_ERROR)
516     {
517 
518         /* Increment the failed tests counter.  */
519         test_control_failed_tests++;
520 
521         /* Print error message.  */
522         printf("Error in checking of fxe_fault_tolerant_enable!\n");
523     }
524 
525 #ifndef TX_TIMER_PROCESS_IN_ISR
526 
527     /* Set the current thread to the timer thread, for caller checking.  */
528     _tx_thread_current_ptr =  &_tx_timer_thread;
529 
530     /* Call the _fxe_media_abort to cause and error.  */
531     status =  _fxe_fault_tolerant_enable(&media_instance, fault_tolerant_buffer, FAULT_TOLERANT_SIZE);
532 
533     /* Set the current thread back to NULL.  */
534     _tx_thread_current_ptr =  FX_NULL;
535 
536     /* Check for the error.  */
537     if (status != FX_CALLER_ERROR)
538     {
539 
540         /* Increment the failed tests counter.  */
541         test_control_failed_tests++;
542 
543         /* Print error message.  */
544         printf("Error in checking of fxe_fault_tolerant_enable!\n");
545     }
546 #endif
547 
548     /* Restore the system state.  */
549     _tx_thread_system_state =  saved_system_state;
550 #endif /* FX_ENABLE_FAULT_TOLERANT */
551 
552     /* Perform initialization, NULL thread, and time thread tests against the error checking shell.  */
553 
554     /* Check caller error checking for fx_media_abort.  */
555 
556     /* Save the system state.  */
557 #ifndef FX_STANDALONE_ENABLE
558     saved_system_state =  _tx_thread_system_state;
559 #endif
560 
561     /* Setup the fake media structure.  */
562     media_instance.fx_media_id =  FX_MEDIA_ID;
563 
564     /* Call the _fxe_media_abort to cause and error.  */
565     status =  _fxe_media_abort(&media_instance);
566 
567     /* Check for the error.  */
568     if (status != FX_CALLER_ERROR)
569     {
570 
571         /* Increment the failed tests counter.  */
572         test_control_failed_tests++;
573 
574         /* Print error message.  */
575         printf("Error in checking of fxe_media_abort!\n");
576     }
577 
578     /* Clear the system state to simulate an ISR caller.  */
579     _tx_thread_system_state =  0;
580 
581     /* Call the _fxe_media_abort to cause and error.  */
582     status =  _fxe_media_abort(&media_instance);
583 
584     /* Check for the error.  */
585     if (status != FX_CALLER_ERROR)
586     {
587 
588         /* Increment the failed tests counter.  */
589         test_control_failed_tests++;
590 
591         /* Print error message.  */
592         printf("Error in checking of fxe_media_abort!\n");
593     }
594 
595 #ifndef TX_TIMER_PROCESS_IN_ISR
596 
597     /* Set the current thread to the timer thread, for caller checking.  */
598     _tx_thread_current_ptr =  &_tx_timer_thread;
599 
600     /* Call the _fxe_media_abort to cause and error.  */
601     status =  _fxe_media_abort(&media_instance);
602 
603     /* Set the current thread back to NULL.  */
604 
605     _tx_thread_current_ptr =  FX_NULL;
606 
607     /* Check for the error.  */
608     if (status != FX_CALLER_ERROR)
609     {
610 
611         /* Increment the failed tests counter.  */
612         test_control_failed_tests++;
613 
614         /* Print error message.  */
615         printf("Error in checking of fxe_media_abort!\n");
616     }
617 #endif
618 
619     /* Restore the system state.  */
620     _tx_thread_system_state =  saved_system_state;
621 
622     /* Check caller error checking for fx_media_invalidate.  */
623 
624     /* Save the system state.  */
625     saved_system_state =  _tx_thread_system_state;
626 
627     /* Setup the fake media structure.  */
628     media_instance.fx_media_id =  FX_MEDIA_ID;
629 
630     /* Call the _fxe_media_cache_invalidate to cause and error.  */
631     status =  _fxe_media_cache_invalidate(&media_instance);
632 
633     /* Check for the error.  */
634     if (status != FX_CALLER_ERROR)
635     {
636 
637         /* Increment the failed tests counter.  */
638         test_control_failed_tests++;
639 
640         /* Print error message.  */
641         printf("Error in checking of fxe_media_invalidate!\n");
642     }
643 
644     /* Clear the system state to simulate an ISR caller.  */
645     _tx_thread_system_state =  0;
646 
647     /* Call the _fxe_media_cache_invalidate to cause and error.  */
648     status =  _fxe_media_cache_invalidate(&media_instance);
649 
650     /* Check for the error.  */
651     if (status != FX_CALLER_ERROR)
652     {
653 
654         /* Increment the failed tests counter.  */
655         test_control_failed_tests++;
656 
657         /* Print error message.  */
658         printf("Error in checking of fxe_media_invalidate!\n");
659     }
660 
661 #ifndef TX_TIMER_PROCESS_IN_ISR
662 
663     /* Set the current thread to the timer thread, for caller checking.  */
664     _tx_thread_current_ptr =  &_tx_timer_thread;
665 
666     /* Call the _fxe_media_cache_invalidate to cause and error.  */
667     status =  _fxe_media_cache_invalidate(&media_instance);
668 
669     /* Set the current thread back to NULL.  */
670     _tx_thread_current_ptr =  FX_NULL;
671 
672     /* Check for the error.  */
673     if (status != FX_CALLER_ERROR)
674     {
675 
676         /* Increment the failed tests counter.  */
677         test_control_failed_tests++;
678 
679         /* Print error message.  */
680         printf("Error in checking of fxe_media_cache_invalidate!\n");
681     }
682 #endif
683 
684     /* Restore the system state.  */
685     _tx_thread_system_state =  saved_system_state;
686 
687 
688     /* Check caller error checking for fx_media_check.  */
689 
690     /* Save the system state.  */
691     saved_system_state =  _tx_thread_system_state;
692 
693     /* Setup the fake media structure.  */
694     media_instance.fx_media_id =  FX_MEDIA_ID;
695 
696     /* Call the _fxe_media_check to cause and error.  */
697     status =  _fxe_media_check(&media_instance, (UCHAR *) &media_instance, 0, 0, FX_NULL);
698 
699     /* Check for the error.  */
700     if (status != FX_CALLER_ERROR)
701     {
702 
703         /* Increment the failed tests counter.  */
704         test_control_failed_tests++;
705 
706         /* Print error message.  */
707         printf("Error in checking of fxe_media_check!\n");
708     }
709 
710     /* Clear the system state to simulate an ISR caller.  */
711     _tx_thread_system_state =  0;
712 
713     /* Call the _fxe_media_check to cause and error.  */
714     status =  _fxe_media_check(&media_instance, (UCHAR *) &media_instance, 0, 0, FX_NULL);
715 
716     /* Check for the error.  */
717     if (status != FX_CALLER_ERROR)
718     {
719 
720         /* Increment the failed tests counter.  */
721         test_control_failed_tests++;
722 
723         /* Print error message.  */
724         printf("Error in checking of fxe_media_check!\n");
725     }
726 
727 #ifndef TX_TIMER_PROCESS_IN_ISR
728 
729     /* Set the current thread to the timer thread, for caller checking.  */
730     _tx_thread_current_ptr =  &_tx_timer_thread;
731 
732     /* Call the _fxe_media_check to cause and error.  */
733     status =  _fxe_media_check(&media_instance, (UCHAR *) &media_instance, 0, 0, FX_NULL);
734 
735     /* Set the current thread back to NULL.  */
736     _tx_thread_current_ptr =  FX_NULL;
737 
738     /* Check for the error.  */
739     if (status != FX_CALLER_ERROR)
740     {
741 
742         /* Increment the failed tests counter.  */
743         test_control_failed_tests++;
744 
745         /* Print error message.  */
746         printf("Error in checking of fxe_media_check!\n");
747     }
748 #endif
749 
750     /* Restore the system state.  */
751     _tx_thread_system_state =  saved_system_state;
752 
753     /* Check caller error checking for fx_media_close.  */
754 
755     /* Save the system state.  */
756     saved_system_state =  _tx_thread_system_state;
757 
758     /* Setup the fake media structure.  */
759     media_instance.fx_media_id =  FX_MEDIA_ID;
760 
761     /* Call the _fxe_media_close to cause and error.  */
762     status =  _fxe_media_close(&media_instance);
763 
764     /* Check for the error.  */
765     if (status != FX_CALLER_ERROR)
766     {
767 
768         /* Increment the failed tests counter.  */
769         test_control_failed_tests++;
770 
771         /* Print error message.  */
772         printf("Error in checking of fxe_media_close!\n");
773     }
774 
775     /* Call the _fxe_media_close to cause and error.  */
776     status =  _fxe_media_close(&media_instance);
777 
778     /* Check for the error.  */
779     if (status != FX_CALLER_ERROR)
780     {
781 
782         /* Increment the failed tests counter.  */
783         test_control_failed_tests++;
784 
785         /* Print error message.  */
786         printf("Error in checking of fxe_media_close!\n");
787     }
788 
789     /* Clear the system state to simulate an ISR caller.  */
790     _tx_thread_system_state =  0;
791 
792     /* Call the _fxe_media_close to cause and error.  */
793     status =  _fxe_media_close(&media_instance);
794 
795     /* Check for the error.  */
796     if (status != FX_CALLER_ERROR)
797     {
798 
799         /* Increment the failed tests counter.  */
800         test_control_failed_tests++;
801 
802         /* Print error message.  */
803         printf("Error in checking of fxe_media_close!\n");
804     }
805 
806 #ifndef TX_TIMER_PROCESS_IN_ISR
807 
808     /* Set the current thread to the timer thread, for caller checking.  */
809     _tx_thread_current_ptr =  &_tx_timer_thread;
810 
811     /* Call the _fxe_media_close to cause and error.  */
812     status =  _fxe_media_close(&media_instance);
813 
814     /* Set the current thread back to NULL.  */
815     _tx_thread_current_ptr =  FX_NULL;
816 
817     /* Check for the error.  */
818     if (status != FX_CALLER_ERROR)
819     {
820 
821         /* Increment the failed tests counter.  */
822         test_control_failed_tests++;
823 
824         /* Print error message.  */
825         printf("Error in checking of fxe_media_close!\n");
826     }
827 #endif
828 
829     /* Restore the system state.  */
830     _tx_thread_system_state =  saved_system_state;
831 
832     /* Check caller error checking for fx_media_close_notify_set.  */
833 
834     /* Save the system state.  */
835     saved_system_state =  _tx_thread_system_state;
836 
837     /* Call the _fxe_media_close_notify_set to cause and error.  */
838     status =  _fxe_media_close_notify_set(FX_NULL, FX_NULL);
839 
840     /* Check for the error.  */
841     if (status != FX_PTR_ERROR)
842     {
843 
844         /* Increment the failed tests counter.  */
845         test_control_failed_tests++;
846 
847         /* Print error message.  */
848         printf("Error in checking of fxe_media_close_notify_set!\n");
849     }
850 
851     /* Call the _fxe_media_close_notify_set to cause and error.  */
852     status =  _fxe_media_close_notify_set(&media_instance, FX_NULL);
853 
854     /* Check for the error.  */
855     if (status != FX_CALLER_ERROR)
856     {
857 
858         /* Increment the failed tests counter.  */
859         test_control_failed_tests++;
860 
861         /* Print error message.  */
862         printf("Error in checking of fxe_media_close_notify_set!\n");
863     }
864 
865     /* Clear the system state to simulate an ISR caller.  */
866     _tx_thread_system_state =  0;
867 
868     /* Call the _fxe_media_close_notify_set to cause and error.  */
869     status =  _fxe_media_close_notify_set(&media_instance, FX_NULL);
870 
871     /* Check for the error.  */
872     if (status != FX_CALLER_ERROR)
873     {
874 
875         /* Increment the failed tests counter.  */
876         test_control_failed_tests++;
877 
878         /* Print error message.  */
879         printf("Error in checking of fxe_media_close_notify_set!\n");
880     }
881 
882 #ifndef TX_TIMER_PROCESS_IN_ISR
883 
884     /* Set the current thread to the timer thread, for caller checking.  */
885     _tx_thread_current_ptr =  &_tx_timer_thread;
886 
887     /* Call the _fxe_media_close_notify_set to cause and error.  */
888     status =  _fxe_media_close_notify_set(&media_instance, FX_NULL);
889 
890     /* Set the current thread back to NULL.  */
891     _tx_thread_current_ptr =  FX_NULL;
892 
893     /* Check for the error.  */
894     if (status != FX_CALLER_ERROR)
895     {
896 
897         /* Increment the failed tests counter.  */
898         test_control_failed_tests++;
899 
900         /* Print error message.  */
901         printf("Error in checking of fxe_media_close_notify_set!\n");
902     }
903 #endif
904 
905     /* Restore the system state.  */
906     _tx_thread_system_state =  saved_system_state;
907 
908 
909     /* Check caller error checking for fx_media_extended_space_available.  */
910 
911     /* Save the system state.  */
912     saved_system_state =  _tx_thread_system_state;
913 
914     /* Setup the fake media structure.  */
915     media_instance.fx_media_id =  0;
916 
917     /* Fake test control thread running.  */
918     _tx_thread_system_state =  0;
919     _tx_thread_current_ptr =  &test_control_thread;
920 
921     /* Call the _fxe_media_extended_space_available to cause and error.  */
922     status =  _fxe_media_extended_space_available(&media_instance, &available_bytes);
923 
924     _tx_thread_system_state =  saved_system_state;
925     _tx_thread_current_ptr =  FX_NULL;
926 
927     /* Check for the error.  */
928     if (status != FX_MEDIA_NOT_OPEN)
929     {
930 
931         /* Increment the failed tests counter.  */
932         test_control_failed_tests++;
933 
934         /* Print error message.  */
935         printf("Error in checking of fxe_media_extended_space_available!\n");
936     }
937 
938     /* Setup the fake media structure.  */
939     media_instance.fx_media_id =  FX_MEDIA_ID;
940 
941     /* Call the _fxe_media_extended_space_available to cause and error.  */
942     status =  _fxe_media_extended_space_available(FX_NULL, &available_bytes);
943 
944     /* Check for the error.  */
945     if (status != FX_PTR_ERROR)
946     {
947 
948         /* Increment the failed tests counter.  */
949         test_control_failed_tests++;
950 
951         /* Print error message.  */
952         printf("Error in checking of fxe_media_extended_space_available!\n");
953     }
954 
955     /* Call the _fxe_media_extended_space_available to cause and error.  */
956     status =  _fxe_media_extended_space_available(&media_instance, FX_NULL);
957 
958     /* Check for the error.  */
959     if (status != FX_PTR_ERROR)
960     {
961 
962         /* Increment the failed tests counter.  */
963         test_control_failed_tests++;
964 
965         /* Print error message.  */
966         printf("Error in checking of fxe_media_extended_space_available!\n");
967     }
968 
969     /* Call the _fxe_media_extended_space_available to cause and error.  */
970     status =  _fxe_media_extended_space_available(&media_instance, &available_bytes);
971 
972     /* Check for the error.  */
973     if (status != FX_CALLER_ERROR)
974     {
975 
976         /* Increment the failed tests counter.  */
977         test_control_failed_tests++;
978 
979         /* Print error message.  */
980         printf("Error in checking of fxe_media_extended_space_available!\n");
981     }
982 
983     /* Clear the system state to simulate an ISR caller.  */
984     _tx_thread_system_state =  0;
985 
986     /* Call the _fxe_media_extended_space_available to cause and error.  */
987     status =  _fxe_media_extended_space_available(&media_instance, &available_bytes);
988 
989     /* Check for the error.  */
990     if (status != FX_CALLER_ERROR)
991     {
992 
993         /* Increment the failed tests counter.  */
994         test_control_failed_tests++;
995 
996         /* Print error message.  */
997         printf("Error in checking of fxe_media_extended_space_available!\n");
998     }
999 
1000 #ifndef TX_TIMER_PROCESS_IN_ISR
1001 
1002     /* Set the current thread to the timer thread, for caller checking.  */
1003     _tx_thread_current_ptr =  &_tx_timer_thread;
1004 
1005     /* Call the _fxe_media_extended_space_available to cause and error.  */
1006     status =  _fxe_media_extended_space_available(&media_instance, &available_bytes);
1007 
1008     /* Set the current thread back to NULL.  */
1009     _tx_thread_current_ptr =  FX_NULL;
1010 
1011     /* Check for the error.  */
1012     if (status != FX_CALLER_ERROR)
1013     {
1014 
1015         /* Increment the failed tests counter.  */
1016         test_control_failed_tests++;
1017 
1018         /* Print error message.  */
1019         printf("Error in checking of fxe_media_extended_space_available!\n");
1020     }
1021 #endif
1022 
1023     /* Restore the system state.  */
1024     _tx_thread_system_state =  saved_system_state;
1025 
1026 
1027     /* Check caller error checking for fx_media_flush.  */
1028 
1029     /* Save the system state.  */
1030     saved_system_state =  _tx_thread_system_state;
1031 
1032     /* Setup the fake media structure.  */
1033     media_instance.fx_media_id =  FX_MEDIA_ID;
1034 
1035     /* Call the _fxe_media_flush to cause and error.  */
1036     status =  _fxe_media_flush(&media_instance);
1037 
1038     /* Check for the error.  */
1039     if (status != FX_CALLER_ERROR)
1040     {
1041 
1042         /* Increment the failed tests counter.  */
1043         test_control_failed_tests++;
1044 
1045         /* Print error message.  */
1046         printf("Error in checking of fxe_media_flush!\n");
1047     }
1048 
1049     /* Clear the system state to simulate an ISR caller.  */
1050     _tx_thread_system_state =  0;
1051 
1052     /* Call the _fxe_media_flush to cause and error.  */
1053     status =  _fxe_media_flush(&media_instance);
1054 
1055     /* Check for the error.  */
1056     if (status != FX_CALLER_ERROR)
1057     {
1058 
1059         /* Increment the failed tests counter.  */
1060         test_control_failed_tests++;
1061 
1062         /* Print error message.  */
1063         printf("Error in checking of fxe_media_flush!\n");
1064     }
1065 
1066 #ifndef TX_TIMER_PROCESS_IN_ISR
1067 
1068     /* Set the current thread to the timer thread, for caller checking.  */
1069     _tx_thread_current_ptr =  &_tx_timer_thread;
1070 
1071     /* Call the _fxe_media_flush to cause and error.  */
1072     status =  _fxe_media_flush(&media_instance);
1073 
1074     /* Set the current thread back to NULL.  */
1075     _tx_thread_current_ptr =  FX_NULL;
1076 
1077     /* Check for the error.  */
1078     if (status != FX_CALLER_ERROR)
1079     {
1080 
1081         /* Increment the failed tests counter.  */
1082         test_control_failed_tests++;
1083 
1084         /* Print error message.  */
1085         printf("Error in checking of fxe_media_flush!\n");
1086     }
1087 #endif
1088 
1089     /* Restore the system state.  */
1090     _tx_thread_system_state =  saved_system_state;
1091 
1092 
1093     /* Check caller error checking for fx_media_format.  */
1094 
1095     /* Save the system state.  */
1096     saved_system_state =  _tx_thread_system_state;
1097 
1098     /* Call the _fxe_media_format to cause an error.  */
1099     status =  _fxe_media_format(&media_instance, FX_NULL, FX_NULL, FX_NULL, 0,
1100                     FX_NULL, 0, 0, 0, 0, 0, 0, 0, 0);
1101 
1102     /* Check for the error.  */
1103     if (status != FX_PTR_ERROR)
1104     {
1105 
1106         /* Increment the failed tests counter.  */
1107         test_control_failed_tests++;
1108 
1109         /* Print error message.  */
1110         printf("Error in checking of fxe_media_format!\n");
1111     }
1112 
1113     /* Call the _fxe_media_format to cause an error.  */
1114     status =  _fxe_media_format(&media_instance, fake_driver, FX_NULL, FX_NULL, 0,
1115                     FX_NULL, 0, 0, 0, 0, 0, 0, 0, 0);
1116 
1117     /* Check for the error.  */
1118     if (status != FX_PTR_ERROR)
1119     {
1120 
1121         /* Increment the failed tests counter.  */
1122         test_control_failed_tests++;
1123 
1124         /* Print error message.  */
1125         printf("Error in checking of fxe_media_format!\n");
1126     }
1127 
1128     /* Setup the fake media structure.  */
1129     media_instance.fx_media_id =  FX_MEDIA_ID;
1130 
1131     /* Call the _fxe_media_format to cause an error.  */
1132     status =  _fxe_media_format(&media_instance, fake_driver, FX_NULL, buffer, 0,
1133                     FX_NULL, 0, 0, 0, 0, 0, 0, 0, 0);
1134 
1135     /* Check for the error.  */
1136     if (status != FX_CALLER_ERROR)
1137     {
1138 
1139         /* Increment the failed tests counter.  */
1140         test_control_failed_tests++;
1141 
1142         /* Print error message.  */
1143         printf("Error in checking of fxe_media_format!\n");
1144     }
1145 
1146     /* Clear the system state to simulate an ISR caller.  */
1147     _tx_thread_system_state =  0;
1148 
1149     /* Call the _fxe_media_format to cause an error.  */
1150     status =  _fxe_media_format(&media_instance, fake_driver, FX_NULL, buffer, 0,
1151                     FX_NULL, 0, 0, 0, 0, 0, 0, 0, 0);
1152 
1153     /* Check for the error.  */
1154     if (status != FX_CALLER_ERROR)
1155     {
1156 
1157         /* Increment the failed tests counter.  */
1158         test_control_failed_tests++;
1159 
1160         /* Print error message.  */
1161         printf("Error in checking of fxe_media_format!\n");
1162     }
1163 
1164 #ifndef TX_TIMER_PROCESS_IN_ISR
1165 
1166     /* Set the current thread to the timer thread, for caller checking.  */
1167     _tx_thread_current_ptr =  &_tx_timer_thread;
1168 
1169     /* Call the _fxe_media_format to cause an error.  */
1170     status =  _fxe_media_format(&media_instance, fake_driver, FX_NULL, buffer, 0,
1171                     FX_NULL, 0, 0, 0, 0, 0, 0, 0, 0);
1172 
1173     /* Set the current thread back to NULL.  */
1174     _tx_thread_current_ptr =  FX_NULL;
1175 
1176     /* Check for the error.  */
1177     if (status != FX_CALLER_ERROR)
1178     {
1179 
1180         /* Increment the failed tests counter.  */
1181         test_control_failed_tests++;
1182 
1183         /* Print error message.  */
1184         printf("Error in checking of fxe_media_format!\n");
1185     }
1186 #endif
1187 
1188     /* Restore the system state.  */
1189     _tx_thread_system_state =  saved_system_state;
1190 
1191     /* Check caller error checking for fx_media_open.  */
1192 
1193     /* Save the system state.  */
1194     saved_system_state =  _tx_thread_system_state;
1195 
1196     /* Call the _fxe_media_open to cause an error.  */
1197     status =  _fxe_media_open(&media_instance, FX_NULL, FX_NULL, FX_NULL,
1198                       FX_NULL, 0, 0);
1199 
1200     /* Check for the error.  */
1201     if (status != FX_PTR_ERROR)
1202     {
1203 
1204         /* Increment the failed tests counter.  */
1205         test_control_failed_tests++;
1206 
1207         /* Print error message.  */
1208         printf("Error in checking of fxe_media_open!\n");
1209     }
1210 
1211 
1212     /* Call the _fxe_media_open to cause an error.  */
1213     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1214                       FX_NULL, 0, 0);
1215 
1216     /* Check for the error.  */
1217     if (status != FX_PTR_ERROR)
1218     {
1219 
1220         /* Increment the failed tests counter.  */
1221         test_control_failed_tests++;
1222 
1223         /* Print error message.  */
1224         printf("Error in checking of fxe_media_open!\n");
1225     }
1226 
1227 
1228     /* Call the _fxe_media_open to cause an error.  */
1229     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1230                       buffer, 0, 0);
1231 
1232     /* Check for the error.  */
1233     if (status != FX_PTR_ERROR)
1234     {
1235 
1236         /* Increment the failed tests counter.  */
1237         test_control_failed_tests++;
1238 
1239         /* Print error message.  */
1240         printf("Error in checking of fxe_media_open!\n");
1241     }
1242 
1243 
1244     /* Setup the fake media structure.  */
1245     media_instance.fx_media_id =  FX_MEDIA_ID;
1246 
1247     /* Call the _fxe_media_format to cause an error.  */
1248     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1249                       buffer, 0, sizeof(FX_MEDIA));
1250 
1251     /* Check for the error.  */
1252     if (status != FX_CALLER_ERROR)
1253     {
1254 
1255         /* Increment the failed tests counter.  */
1256         test_control_failed_tests++;
1257 
1258         /* Print error message.  */
1259         printf("Error in checking of fxe_media_open!\n");
1260     }
1261 
1262     /* Clear the system state to simulate an ISR caller.  */
1263     _tx_thread_system_state =  0;
1264 
1265     /* Call the _fxe_media_open to cause an error.  */
1266     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1267                       buffer, 0, sizeof(FX_MEDIA));
1268 
1269     /* Check for the error.  */
1270     if (status != FX_CALLER_ERROR)
1271     {
1272 
1273         /* Increment the failed tests counter.  */
1274         test_control_failed_tests++;
1275 
1276         /* Print error message.  */
1277         printf("Error in checking of fxe_media_open!\n");
1278     }
1279 
1280 #ifndef TX_TIMER_PROCESS_IN_ISR
1281 
1282     /* Set the current thread to the timer thread, for caller checking.  */
1283     _tx_thread_current_ptr =  &_tx_timer_thread;
1284 
1285     /* Call the _fxe_media_open to cause an error.  */
1286     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1287                       buffer, 0, sizeof(FX_MEDIA));
1288 
1289     /* Set the current thread back to NULL.  */
1290     _tx_thread_current_ptr =  FX_NULL;
1291 
1292     /* Check for the error.  */
1293     if (status != FX_CALLER_ERROR)
1294     {
1295 
1296         /* Increment the failed tests counter.  */
1297         test_control_failed_tests++;
1298 
1299         /* Print error message.  */
1300         printf("Error in checking of fxe_media_open!\n");
1301     }
1302 #endif
1303 
1304     /* Set the current thread to the test control thread, for error checking on the sector cache size.  */
1305     _tx_thread_current_ptr =  &test_control_thread;
1306 
1307     /* Save the actual sector cache size.  */
1308     temp =  _fx_system_media_max_sector_cache;
1309     _fx_system_media_max_sector_cache =  3;
1310 
1311     /* Call the _fxe_media_open to cause an error.  */
1312     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1313                       buffer, 0, sizeof(FX_MEDIA));
1314 
1315     /* Restore the max sector cache size.  */
1316     _fx_system_media_max_sector_cache =  temp;
1317 
1318     /* Set the current thread back to NULL.  */
1319     _tx_thread_current_ptr =  FX_NULL;
1320 
1321     /* Check for the error.  */
1322     if (status != FX_MEDIA_INVALID)
1323     {
1324 
1325         /* Increment the failed tests counter.  */
1326         test_control_failed_tests++;
1327 
1328         /* Print error message.  */
1329         printf("Error in checking of fxe_media_open!\n");
1330     }
1331 
1332     /* Set the current thread to the test control thread, for error checking on the sector cache size.  */
1333     _tx_thread_current_ptr =  &test_control_thread;
1334 
1335     /* Save the actual sector cache size.  */
1336     temp =  _fx_system_media_max_sector_cache;
1337     _fx_system_media_max_sector_cache =  6;
1338 
1339     /* Call the _fxe_media_open to cause an error.  */
1340     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1341                       buffer, 0, sizeof(FX_MEDIA));
1342 
1343     /* Restore the max sector cache size.  */
1344     _fx_system_media_max_sector_cache =  temp;
1345 
1346     /* Set the current thread back to NULL.  */
1347     _tx_thread_current_ptr =  FX_NULL;
1348 
1349     /* Check for the error.  */
1350     if (status != FX_MEDIA_INVALID)
1351     {
1352 
1353         /* Increment the failed tests counter.  */
1354         test_control_failed_tests++;
1355 
1356         /* Print error message.  */
1357         printf("Error in checking of fxe_media_open!\n");
1358     }
1359 
1360     /* Set the current thread to the test control thread, for error checking on the sector cache size.  */
1361     _tx_thread_current_ptr =  &test_control_thread;
1362 
1363     /* Save the actual FAT cache size.  */
1364     temp =  _fx_system_media_max_fat_cache;
1365     _fx_system_media_max_fat_cache =  3;
1366 
1367     /* Call the _fxe_media_open to cause an error.  */
1368     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1369                       buffer, 0, sizeof(FX_MEDIA));
1370 
1371     /* Restore the max FAT cache size.  */
1372     _fx_system_media_max_fat_cache =  temp;
1373 
1374     /* Set the current thread back to NULL.  */
1375     _tx_thread_current_ptr =  FX_NULL;
1376 
1377     /* Check for the error.  */
1378     if (status != FX_MEDIA_INVALID)
1379     {
1380 
1381         /* Increment the failed tests counter.  */
1382         test_control_failed_tests++;
1383 
1384         /* Print error message.  */
1385         printf("Error in checking of fxe_media_open!\n");
1386     }
1387 
1388     /* Set the current thread to the test control thread, for error checking on the sector cache size.  */
1389     _tx_thread_current_ptr =  &test_control_thread;
1390 
1391     /* Save the actual FAT cache size.  */
1392     temp =  _fx_system_media_max_fat_cache;
1393     _fx_system_media_max_fat_cache =  6;
1394 
1395     /* Call the _fxe_media_open to cause an error.  */
1396     status =  _fxe_media_open(&media_instance, FX_NULL, fake_driver, FX_NULL,
1397                       buffer, 0, sizeof(FX_MEDIA));
1398 
1399     /* Restore the max FAT cache size.  */
1400     _fx_system_media_max_fat_cache =  temp;
1401 
1402     /* Set the current thread back to NULL.  */
1403     _tx_thread_current_ptr =  FX_NULL;
1404 
1405     /* Check for the error.  */
1406     if (status != FX_MEDIA_INVALID)
1407     {
1408 
1409         /* Increment the failed tests counter.  */
1410         test_control_failed_tests++;
1411 
1412         /* Print error message.  */
1413         printf("Error in checking of fxe_media_open!\n");
1414     }
1415 
1416     /* Restore the system state.  */
1417     _tx_thread_system_state =  saved_system_state;
1418 
1419 
1420     /* Check caller error checking for fx_media_open_notify_set.  */
1421 
1422     /* Save the system state.  */
1423     saved_system_state =  _tx_thread_system_state;
1424 
1425     /* Call the _fxe_media_open_notify_set to cause an error.  */
1426     status =  _fxe_media_open_notify_set(FX_NULL, FX_NULL);
1427 
1428     /* Check for the error.  */
1429     if (status != FX_PTR_ERROR)
1430     {
1431 
1432         /* Increment the failed tests counter.  */
1433         test_control_failed_tests++;
1434 
1435         /* Print error message.  */
1436         printf("Error in checking of fxe_media_open_notify_set!\n");
1437     }
1438 
1439     /* Setup the fake media structure.  */
1440     media_instance.fx_media_id =  FX_MEDIA_ID;
1441 
1442     /* Call the _fxe_media_open_notify_set to cause an error.  */
1443     status =  _fxe_media_open_notify_set(&media_instance, FX_NULL);
1444 
1445     /* Check for the error.  */
1446     if (status != FX_CALLER_ERROR)
1447     {
1448 
1449         /* Increment the failed tests counter.  */
1450         test_control_failed_tests++;
1451 
1452         /* Print error message.  */
1453         printf("Error in checking of fxe_media_open_notify_set!\n");
1454     }
1455 
1456     /* Clear the system state to simulate an ISR caller.  */
1457     _tx_thread_system_state =  0;
1458 
1459     /* Call the _fxe_media_open_notify_set to cause an error.  */
1460     status =  _fxe_media_open_notify_set(&media_instance, FX_NULL);
1461 
1462     /* Check for the error.  */
1463     if (status != FX_CALLER_ERROR)
1464     {
1465 
1466         /* Increment the failed tests counter.  */
1467         test_control_failed_tests++;
1468 
1469         /* Print error message.  */
1470         printf("Error in checking of fxe_media_open_notify_set!\n");
1471     }
1472 
1473 #ifndef TX_TIMER_PROCESS_IN_ISR
1474 
1475     /* Set the current thread to the timer thread, for caller checking.  */
1476     _tx_thread_current_ptr =  &_tx_timer_thread;
1477 
1478     /* Call the _fxe_media_open_notify_set to cause an error.  */
1479     status =  _fxe_media_open_notify_set(&media_instance, FX_NULL);
1480 
1481     /* Set the current thread back to NULL.  */
1482     _tx_thread_current_ptr =  FX_NULL;
1483 
1484     /* Check for the error.  */
1485     if (status != FX_CALLER_ERROR)
1486     {
1487 
1488         /* Increment the failed tests counter.  */
1489         test_control_failed_tests++;
1490 
1491         /* Print error message.  */
1492         printf("Error in checking of fxe_media_open_notify_set!\n");
1493     }
1494 #endif
1495 
1496     /* Restore the system state.  */
1497     _tx_thread_system_state =  saved_system_state;
1498 
1499 
1500     /* Check caller error checking for fx_media_read.  */
1501 
1502     /* Save the system state.  */
1503     saved_system_state =  _tx_thread_system_state;
1504 
1505     /* Call the _fxe_media_read to cause an error.  */
1506     status =  _fxe_media_read(&media_instance, 0, FX_NULL);
1507 
1508     /* Check for the error.  */
1509     if (status != FX_PTR_ERROR)
1510     {
1511 
1512         /* Increment the failed tests counter.  */
1513         test_control_failed_tests++;
1514 
1515         /* Print error message.  */
1516         printf("Error in checking of fxe_media_read!\n");
1517     }
1518 
1519     /* Setup the fake media structure.  */
1520     media_instance.fx_media_id =  FX_MEDIA_ID;
1521 
1522     /* Call the _fxe_media_read to cause an error.  */
1523     status =  _fxe_media_read(&media_instance, 0, buffer);
1524 
1525     /* Check for the error.  */
1526     if (status != FX_CALLER_ERROR)
1527     {
1528 
1529         /* Increment the failed tests counter.  */
1530         test_control_failed_tests++;
1531 
1532         /* Print error message.  */
1533         printf("Error in checking of fxe_media_read!\n");
1534     }
1535 
1536     /* Clear the system state to simulate an ISR caller.  */
1537     _tx_thread_system_state =  0;
1538 
1539     /* Call the _fxe_media_read to cause an error.  */
1540     status =  _fxe_media_read(&media_instance, 0, buffer);
1541 
1542     /* Check for the error.  */
1543     if (status != FX_CALLER_ERROR)
1544     {
1545 
1546         /* Increment the failed tests counter.  */
1547         test_control_failed_tests++;
1548 
1549         /* Print error message.  */
1550         printf("Error in checking of fxe_media_read!\n");
1551     }
1552 
1553 #ifndef TX_TIMER_PROCESS_IN_ISR
1554 
1555     /* Set the current thread to the timer thread, for caller checking.  */
1556     _tx_thread_current_ptr =  &_tx_timer_thread;
1557 
1558     /* Call the _fxe_media_read to cause an error.  */
1559     status =  _fxe_media_read(&media_instance, 0, buffer);
1560 
1561     /* Set the current thread back to NULL.  */
1562     _tx_thread_current_ptr =  FX_NULL;
1563 
1564     /* Check for the error.  */
1565     if (status != FX_CALLER_ERROR)
1566     {
1567 
1568         /* Increment the failed tests counter.  */
1569         test_control_failed_tests++;
1570 
1571         /* Print error message.  */
1572         printf("Error in checking of fxe_media_read!\n");
1573     }
1574 #endif
1575 
1576     /* Restore the system state.  */
1577     _tx_thread_system_state =  saved_system_state;
1578 
1579 
1580     /* Check caller error checking for fx_media_space_available.  */
1581 
1582     /* Save the system state.  */
1583     saved_system_state =  _tx_thread_system_state;
1584 
1585     /* Setup the fake media structure.  */
1586     media_instance.fx_media_id =  0;
1587 
1588     /* Fake test control thread running.  */
1589     _tx_thread_system_state =  0;
1590     _tx_thread_current_ptr =  &test_control_thread;
1591 
1592     /* Call the _fxe_media_space_available to cause and error.  */
1593     status =  _fxe_media_space_available(&media_instance, &temp);
1594 
1595     _tx_thread_system_state =  saved_system_state;
1596     _tx_thread_current_ptr =  FX_NULL;
1597 
1598     /* Check for the error.  */
1599     if (status != FX_MEDIA_NOT_OPEN)
1600     {
1601 
1602         /* Increment the failed tests counter.  */
1603         test_control_failed_tests++;
1604 
1605         /* Print error message.  */
1606         printf("Error in checking of fxe_media_space_available!\n");
1607     }
1608 
1609     /* Call the _fxe_media_space_available to cause an error.  */
1610     status =  _fxe_media_space_available(&media_instance, FX_NULL);
1611 
1612     /* Check for the error.  */
1613     if (status != FX_PTR_ERROR)
1614     {
1615 
1616         /* Increment the failed tests counter.  */
1617         test_control_failed_tests++;
1618 
1619         /* Print error message.  */
1620         printf("Error in checking of fxe_media_space_available!\n");
1621     }
1622 
1623     /* Setup the fake media structure.  */
1624     media_instance.fx_media_id =  FX_MEDIA_ID;
1625 
1626     /* Call the _fxe_media_space_available to cause an error.  */
1627     status =  _fxe_media_space_available(&media_instance, &temp);
1628 
1629     /* Check for the error.  */
1630     if (status != FX_CALLER_ERROR)
1631     {
1632 
1633         /* Increment the failed tests counter.  */
1634         test_control_failed_tests++;
1635 
1636         /* Print error message.  */
1637         printf("Error in checking of fxe_media_space_available!\n");
1638     }
1639 
1640     /* Clear the system state to simulate an ISR caller.  */
1641     _tx_thread_system_state =  0;
1642 
1643     /* Call the _fxe_media_space_available to cause an error.  */
1644     status =  _fxe_media_space_available(&media_instance, &temp);
1645 
1646     /* Check for the error.  */
1647     if (status != FX_CALLER_ERROR)
1648     {
1649 
1650         /* Increment the failed tests counter.  */
1651         test_control_failed_tests++;
1652 
1653         /* Print error message.  */
1654         printf("Error in checking of fxe_media_space_available!\n");
1655     }
1656 
1657 #ifndef TX_TIMER_PROCESS_IN_ISR
1658 
1659     /* Set the current thread to the timer thread, for caller checking.  */
1660     _tx_thread_current_ptr =  &_tx_timer_thread;
1661 
1662     /* Call the _fxe_media_space_available to cause an error.  */
1663     status =  _fxe_media_space_available(&media_instance, &temp);
1664 
1665     /* Set the current thread back to NULL.  */
1666     _tx_thread_current_ptr =  FX_NULL;
1667 
1668     /* Check for the error.  */
1669     if (status != FX_CALLER_ERROR)
1670     {
1671 
1672         /* Increment the failed tests counter.  */
1673         test_control_failed_tests++;
1674 
1675         /* Print error message.  */
1676         printf("Error in checking of fxe_media_space_available!\n");
1677     }
1678 #endif
1679 
1680     /* Restore the system state.  */
1681     _tx_thread_system_state =  saved_system_state;
1682 
1683 
1684     /* Check caller error checking for fx_media_volume_get.  */
1685 
1686     /* Save the system state.  */
1687     saved_system_state =  _tx_thread_system_state;
1688 
1689     /* Call the _fxe_media_volume_get to cause an error.  */
1690     status =  _fxe_media_volume_get(&media_instance, FX_NULL, 0);
1691 
1692     /* Check for the error.  */
1693     if (status != FX_PTR_ERROR)
1694     {
1695 
1696         /* Increment the failed tests counter.  */
1697         test_control_failed_tests++;
1698 
1699         /* Print error message.  */
1700         printf("Error in checking of fxe_media_volume_get!\n");
1701     }
1702 
1703     /* Call the _fxe_media_volume_get_extended to cause an error.  */
1704     status = _fxe_media_volume_get_extended(&media_instance, FX_NULL, 1, 0);
1705 
1706     /* Check for the error.  */
1707     if (status != FX_PTR_ERROR)
1708     {
1709 
1710         /* Increment the failed tests counter.  */
1711         test_control_failed_tests++;
1712 
1713         /* Print error message.  */
1714         printf("Error in checking of fxe_media_volume_get_extended!\n");
1715     }
1716 
1717     /* Call the _fxe_media_volume_get_extended to cause an error.  */
1718     status = _fxe_media_volume_get_extended(&media_instance, (CHAR*)buffer, 0, 0);
1719 
1720     /* Check for the error.  */
1721     if (status != FX_BUFFER_ERROR)
1722     {
1723 
1724         /* Increment the failed tests counter.  */
1725         test_control_failed_tests++;
1726 
1727         /* Print error message.  */
1728         printf("Error in checking of fxe_media_volume_get_extended!\n");
1729     }
1730 
1731     /* Setup the fake media structure.  */
1732     media_instance.fx_media_id =  FX_MEDIA_ID;
1733 
1734     /* Call the _fxe_media_volume_get to cause an error.  */
1735     status =  _fxe_media_volume_get(&media_instance, (CHAR *)buffer, 0);
1736 
1737     /* Check for the error.  */
1738     if (status != FX_CALLER_ERROR)
1739     {
1740 
1741         /* Increment the failed tests counter.  */
1742         test_control_failed_tests++;
1743 
1744         /* Print error message.  */
1745         printf("Error in checking of fxe_media_volume_get!\n");
1746     }
1747 
1748     /* Call the _fxe_media_volume_get_extended to cause an error.  */
1749     status = _fxe_media_volume_get_extended(&media_instance, (CHAR*)buffer, sizeof(buffer), 0);
1750 
1751     /* Check for the error.  */
1752     if (status != FX_CALLER_ERROR)
1753     {
1754 
1755         /* Increment the failed tests counter.  */
1756         test_control_failed_tests++;
1757 
1758         /* Print error message.  */
1759         printf("Error in checking of fxe_media_volume_get_extended!\n");
1760     }
1761 
1762     /* Clear the system state to simulate an ISR caller.  */
1763     _tx_thread_system_state =  0;
1764 
1765     /* Call the _fxe_media_volume_get to cause an error.  */
1766     status =  _fxe_media_volume_get(&media_instance, (CHAR *)buffer, 0);
1767 
1768     /* Check for the error.  */
1769     if (status != FX_CALLER_ERROR)
1770     {
1771 
1772         /* Increment the failed tests counter.  */
1773         test_control_failed_tests++;
1774 
1775         /* Print error message.  */
1776         printf("Error in checking of fxe_media_volume_get!\n");
1777     }
1778 
1779     /* Call the _fxe_media_volume_get_extended to cause an error.  */
1780     status = _fxe_media_volume_get_extended(&media_instance, (CHAR*)buffer, sizeof(buffer), 0);
1781 
1782     /* Check for the error.  */
1783     if (status != FX_CALLER_ERROR)
1784     {
1785 
1786         /* Increment the failed tests counter.  */
1787         test_control_failed_tests++;
1788 
1789         /* Print error message.  */
1790         printf("Error in checking of fxe_media_volume_get_extended!\n");
1791     }
1792 
1793 #ifndef TX_TIMER_PROCESS_IN_ISR
1794 
1795     /* Set the current thread to the timer thread, for caller checking.  */
1796     _tx_thread_current_ptr =  &_tx_timer_thread;
1797 
1798     /* Call the _fxe_media_volume_get to cause an error.  */
1799     status =  _fxe_media_volume_get(&media_instance, (CHAR *)buffer, 0);
1800 
1801     /* Set the current thread back to NULL.  */
1802     _tx_thread_current_ptr =  FX_NULL;
1803 
1804     /* Check for the error.  */
1805     if (status != FX_CALLER_ERROR)
1806     {
1807 
1808         /* Increment the failed tests counter.  */
1809         test_control_failed_tests++;
1810 
1811         /* Print error message.  */
1812         printf("Error in checking of fxe_media_volume_get!\n");
1813     }
1814 
1815     /* Set the current thread to the timer thread, for caller checking.  */
1816     _tx_thread_current_ptr = &_tx_timer_thread;
1817 
1818     /* Call the _fxe_media_volume_get_extended to cause an error.  */
1819     status = _fxe_media_volume_get_extended(&media_instance, (CHAR*)buffer, 1, 0);
1820 
1821     /* Set the current thread back to NULL.  */
1822     _tx_thread_current_ptr = FX_NULL;
1823 
1824     /* Check for the error.  */
1825     if (status != FX_CALLER_ERROR)
1826     {
1827 
1828         /* Increment the failed tests counter.  */
1829         test_control_failed_tests++;
1830 
1831         /* Print error message.  */
1832         printf("Error in checking of fxe_media_volume_get_extended!\n");
1833     }
1834 #endif
1835 
1836     /* Restore the system state.  */
1837     _tx_thread_system_state =  saved_system_state;
1838 
1839 
1840     /* Check caller error checking for fx_media_volume_set.  */
1841 
1842     /* Save the system state.  */
1843     saved_system_state =  _tx_thread_system_state;
1844 
1845     /* Call the _fxe_media_volume_set to cause an error.  */
1846     status =  _fxe_media_volume_set(&media_instance, FX_NULL);
1847 
1848     /* Check for the error.  */
1849     if (status != FX_PTR_ERROR)
1850     {
1851 
1852         /* Increment the failed tests counter.  */
1853         test_control_failed_tests++;
1854 
1855         /* Print error message.  */
1856         printf("Error in checking of fxe_media_volume_set!\n");
1857     }
1858 
1859     /* Call the _fxe_media_volume_set to cause an error.  */
1860     buffer[0] =  0;
1861     status =  _fxe_media_volume_set(&media_instance, (CHAR *)buffer);
1862 
1863     /* Check for the error.  */
1864     if (status != FX_PTR_ERROR)
1865     {
1866 
1867         /* Increment the failed tests counter.  */
1868         test_control_failed_tests++;
1869 
1870         /* Print error message.  */
1871         printf("Error in checking of fxe_media_volume_set!\n");
1872     }
1873 
1874     /* Setup the fake media structure.  */
1875     media_instance.fx_media_id =  FX_MEDIA_ID;
1876 
1877     /* Call the _fxe_media_volume_set to cause an error.  */
1878     status =  _fxe_media_volume_set(&media_instance, "MYVOL");
1879 
1880     /* Check for the error.  */
1881     if (status != FX_CALLER_ERROR)
1882     {
1883 
1884         /* Increment the failed tests counter.  */
1885         test_control_failed_tests++;
1886 
1887         /* Print error message.  */
1888         printf("Error in checking of fxe_media_volume_set!\n");
1889     }
1890 
1891     /* Clear the system state to simulate an ISR caller.  */
1892     _tx_thread_system_state =  0;
1893 
1894     /* Call the _fxe_media_volume_set to cause an error.  */
1895     status =  _fxe_media_volume_set(&media_instance, "MYVOL");
1896 
1897     /* Check for the error.  */
1898     if (status != FX_CALLER_ERROR)
1899     {
1900 
1901         /* Increment the failed tests counter.  */
1902         test_control_failed_tests++;
1903 
1904         /* Print error message.  */
1905         printf("Error in checking of fxe_media_volume_set!\n");
1906     }
1907 
1908 #ifndef TX_TIMER_PROCESS_IN_ISR
1909 
1910     /* Set the current thread to the timer thread, for caller checking.  */
1911     _tx_thread_current_ptr =  &_tx_timer_thread;
1912 
1913     /* Call the _fxe_media_volume_set to cause an error.  */
1914     status =  _fxe_media_volume_set(&media_instance, "MYVOL");
1915 
1916     /* Set the current thread back to NULL.  */
1917     _tx_thread_current_ptr =  FX_NULL;
1918 
1919     /* Check for the error.  */
1920     if (status != FX_CALLER_ERROR)
1921     {
1922 
1923         /* Increment the failed tests counter.  */
1924         test_control_failed_tests++;
1925 
1926         /* Print error message.  */
1927         printf("Error in checking of fxe_media_volume_set!\n");
1928     }
1929 #endif
1930 
1931     /* Restore the system state.  */
1932     _tx_thread_system_state =  saved_system_state;
1933 
1934 
1935     /* Check caller error checking for fx_media_volume_set.  */
1936 
1937     /* Save the system state.  */
1938     saved_system_state =  _tx_thread_system_state;
1939 
1940     /* Setup the fake media structure.  */
1941     media_instance.fx_media_id =  FX_MEDIA_ID;
1942 
1943     /* Call the _fxe_media_write to cause an error.  */
1944     status =  _fxe_media_write(&media_instance, 0, buffer);
1945 
1946     /* Check for the error.  */
1947     if (status != FX_CALLER_ERROR)
1948     {
1949 
1950         /* Increment the failed tests counter.  */
1951         test_control_failed_tests++;
1952 
1953         /* Print error message.  */
1954         printf("Error in checking of fxe_media_write!\n");
1955     }
1956 
1957     /* Clear the system state to simulate an ISR caller.  */
1958     _tx_thread_system_state =  0;
1959 
1960     /* Call the _fxe_media_write to cause an error.  */
1961     status =  _fxe_media_write(&media_instance, 0, buffer);
1962 
1963     /* Check for the error.  */
1964     if (status != FX_CALLER_ERROR)
1965     {
1966 
1967         /* Increment the failed tests counter.  */
1968         test_control_failed_tests++;
1969 
1970         /* Print error message.  */
1971         printf("Error in checking of fxe_media_write!\n");
1972     }
1973 
1974 #ifndef TX_TIMER_PROCESS_IN_ISR
1975 
1976     /* Set the current thread to the timer thread, for caller checking.  */
1977     _tx_thread_current_ptr =  &_tx_timer_thread;
1978 
1979     /* Call the _fxe_media_write to cause an error.  */
1980     status =  _fxe_media_write(&media_instance, 0, buffer);
1981 
1982     /* Set the current thread back to NULL.  */
1983     _tx_thread_current_ptr =  FX_NULL;
1984 
1985     /* Check for the error.  */
1986     if (status != FX_CALLER_ERROR)
1987     {
1988 
1989         /* Increment the failed tests counter.  */
1990         test_control_failed_tests++;
1991 
1992         /* Print error message.  */
1993         printf("Error in checking of fxe_media_write!\n");
1994     }
1995 #endif
1996 
1997     /* Restore the system state.  */
1998     _tx_thread_system_state =  saved_system_state;
1999 
2000 
2001     /* Check caller error checking for fx_unicode_directory_create.  */
2002 
2003     /* Save the system state.  */
2004     saved_system_state =  _tx_thread_system_state;
2005 
2006     /* Setup the fake media structure.  */
2007     media_instance.fx_media_id =  FX_MEDIA_ID;
2008 
2009     /* Call the _fxe_unicode_directory_create with a NULL source name to cause an error.  */
2010     status =  _fxe_unicode_directory_create(&media_instance, FX_NULL, 0, "SHORT");
2011 
2012     /* Check for the error.  */
2013     if (status != FX_PTR_ERROR)
2014     {
2015 
2016         /* Increment the failed tests counter.  */
2017         test_control_failed_tests++;
2018 
2019         /* Print error message.  */
2020         printf("Error in checking of fxe_unicode_directory_create!\n");
2021     }
2022 
2023     /* Call the _fxe_unicode_directory_create with a zero source name lenght to cause an error.  */
2024     status =  _fxe_unicode_directory_create(&media_instance, unicode_name, 0, "SHORT");
2025 
2026     /* Check for the error.  */
2027     if (status != FX_PTR_ERROR)
2028     {
2029 
2030         /* Increment the failed tests counter.  */
2031         test_control_failed_tests++;
2032 
2033         /* Print error message.  */
2034         printf("Error in checking of fxe_unicode_directory_create!\n");
2035     }
2036 
2037     /* Call the _fxe_unicode_directory_create with a NULL source short name to cause an error.  */
2038     status =  _fxe_unicode_directory_create(&media_instance, unicode_name, 8, FX_NULL);
2039 
2040     /* Check for the error.  */
2041     if (status != FX_PTR_ERROR)
2042     {
2043 
2044         /* Increment the failed tests counter.  */
2045         test_control_failed_tests++;
2046 
2047         /* Print error message.  */
2048         printf("Error in checking of fxe_unicode_directory_create!\n");
2049     }
2050 
2051     /* Call the _fxe_unicode_directory_create to cause an FX_CALLER_ERROR error.  */
2052     status =  _fxe_unicode_directory_create(&media_instance, unicode_name, 6,"SHORT");
2053 
2054     /* Check for the error.  */
2055     if (status != FX_CALLER_ERROR)
2056     {
2057 
2058         /* Increment the failed tests counter.  */
2059         test_control_failed_tests++;
2060 
2061         /* Print error message.  */
2062         printf("Error in checking of fxe_unicode_directory_create!\n");
2063     }
2064 
2065     /* Call the _fxe_unicode_directory_create to cause an error.  */
2066     status = _fxe_unicode_directory_create(&media_instance, unicode_name, 6, "SHORT");
2067 
2068     /* Check for the error.  */
2069     if (status != FX_CALLER_ERROR)
2070     {
2071 
2072         /* Increment the failed tests counter.  */
2073         test_control_failed_tests++;
2074 
2075         /* Print error message.  */
2076         printf("Error in checking of fxe_unicode_directory_create!\n");
2077     }
2078 
2079     /* Clear the system state to simulate an ISR caller.  */
2080     _tx_thread_system_state =  0;
2081 
2082     /* Call the _fxe_unicode_directory_create to cause an error.  */
2083     status =  _fxe_unicode_directory_create(&media_instance, unicode_name, 6, "SHORT");
2084 
2085     /* Check for the error.  */
2086     if (status != FX_CALLER_ERROR)
2087     {
2088 
2089         /* Increment the failed tests counter.  */
2090         test_control_failed_tests++;
2091 
2092         /* Print error message.  */
2093         printf("Error in checking of fxe_unicode_directory_create!\n");
2094     }
2095 
2096 #ifndef TX_TIMER_PROCESS_IN_ISR
2097 
2098     /* Set the current thread to the timer thread, for caller checking.  */
2099     _tx_thread_current_ptr =  &_tx_timer_thread;
2100 
2101     /* Call the _fxe_unicode_directory_create to cause an error.  */
2102     status =  _fxe_unicode_directory_create(&media_instance, (UCHAR *)"UNICODE NAME'\0''\0'", 6, "SHORT");
2103 
2104     /* Set the current thread back to NULL.  */
2105     _tx_thread_current_ptr =  FX_NULL;
2106 
2107     /* Check for the error.  */
2108     if (status != FX_CALLER_ERROR)
2109     {
2110 
2111         /* Increment the failed tests counter.  */
2112         test_control_failed_tests++;
2113 
2114         /* Print error message.  */
2115         printf("Error in checking of fxe_unicode_directory_create!\n");
2116     }
2117 #endif
2118 
2119     /* Restore the system state.  */
2120     _tx_thread_system_state =  saved_system_state;
2121 
2122 
2123     /* Check caller error checking for fx_unicode_directory_rename.  */
2124 
2125     /* Save the system state.  */
2126     saved_system_state =  _tx_thread_system_state;
2127 
2128     /* Setup the fake media structure.  */
2129     media_instance.fx_media_id =  FX_MEDIA_ID;
2130 
2131     /* Call the _fxe_unicode_directory_rename with a NULL old unicode name to cause an error.  */
2132     status =  _fxe_unicode_directory_rename(&media_instance, FX_NULL, 0, FX_NULL, 0, FX_NULL);
2133 
2134     /* Check for the error.  */
2135     if (status != FX_PTR_ERROR)
2136     {
2137 
2138         /* Increment the failed tests counter.  */
2139         test_control_failed_tests++;
2140 
2141         /* Print error message.  */
2142         printf("Error in checking of fxe_unicode_directory_rename!\n");
2143     }
2144 
2145     /* Call the _fxe_unicode_directory_rename with a zero length old unicode name to cause an error.  */
2146     status =  _fxe_unicode_directory_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 0, FX_NULL, 0, FX_NULL);
2147 
2148     /* Check for the error.  */
2149     if (status != FX_PTR_ERROR)
2150     {
2151 
2152         /* Increment the failed tests counter.  */
2153         test_control_failed_tests++;
2154 
2155         /* Print error message.  */
2156         printf("Error in checking of fxe_unicode_directory_rename!\n");
2157     }
2158 
2159     /* Call the _fxe_unicode_directory_rename with a NULL new unicode name to cause an error.  */
2160     status =  _fxe_unicode_directory_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, FX_NULL, 0, FX_NULL);
2161 
2162     /* Check for the error.  */
2163     if (status != FX_PTR_ERROR)
2164     {
2165 
2166         /* Increment the failed tests counter.  */
2167         test_control_failed_tests++;
2168 
2169         /* Print error message.  */
2170         printf("Error in checking of fxe_unicode_directory_rename!\n");
2171     }
2172 
2173     /* Call the _fxe_unicode_directory_rename with a zero lenght new unicode name to cause an error.  */
2174     status =  _fxe_unicode_directory_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 0, FX_NULL);
2175 
2176     /* Check for the error.  */
2177     if (status != FX_PTR_ERROR)
2178     {
2179 
2180         /* Increment the failed tests counter.  */
2181         test_control_failed_tests++;
2182 
2183         /* Print error message.  */
2184         printf("Error in checking of fxe_unicode_directory_rename!\n");
2185     }
2186 
2187     /* Call the _fxe_unicode_directory_rename with a NULL new short name to cause an error.  */
2188     status =  _fxe_unicode_directory_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, FX_NULL);
2189 
2190     /* Check for the error.  */
2191     if (status != FX_PTR_ERROR)
2192     {
2193 
2194         /* Increment the failed tests counter.  */
2195         test_control_failed_tests++;
2196 
2197         /* Print error message.  */
2198         printf("Error in checking of fxe_unicode_directory_rename!\n");
2199     }
2200 
2201     /* Call the _fxe_unicode_directory_rename to cause an error.  */
2202     status =  _fxe_unicode_directory_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, "SHORT");
2203 
2204     /* Check for the error.  */
2205     if (status != FX_CALLER_ERROR)
2206     {
2207 
2208         /* Increment the failed tests counter.  */
2209         test_control_failed_tests++;
2210 
2211         /* Print error message.  */
2212         printf("Error in checking of fxe_unicode_directory_rename!\n");
2213     }
2214 
2215     /* Clear the system state to simulate an ISR caller.  */
2216     _tx_thread_system_state =  0;
2217 
2218     /* Call the _fxe_unicode_directory_rename to cause an error.  */
2219     status =  _fxe_unicode_directory_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, "SHORT");
2220 
2221     /* Check for the error.  */
2222     if (status != FX_CALLER_ERROR)
2223     {
2224 
2225         /* Increment the failed tests counter.  */
2226         test_control_failed_tests++;
2227 
2228         /* Print error message.  */
2229         printf("Error in checking of fxe_unicode_directory_rename!\n");
2230     }
2231 
2232 #ifndef TX_TIMER_PROCESS_IN_ISR
2233 
2234     /* Set the current thread to the timer thread, for caller checking.  */
2235     _tx_thread_current_ptr =  &_tx_timer_thread;
2236 
2237     /* Call the _fxe_unicode_directory_rename to cause an error.  */
2238     status =  _fxe_unicode_directory_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, "SHORT");
2239 
2240     /* Set the current thread back to NULL.  */
2241     _tx_thread_current_ptr =  FX_NULL;
2242 
2243     /* Check for the error.  */
2244     if (status != FX_CALLER_ERROR)
2245     {
2246 
2247         /* Increment the failed tests counter.  */
2248         test_control_failed_tests++;
2249 
2250         /* Print error message.  */
2251         printf("Error in checking of fxe_unicode_file_rename!\n");
2252     }
2253 #endif
2254 
2255     /* Restore the system state.  */
2256     _tx_thread_system_state =  saved_system_state;
2257 
2258 
2259     /* Check caller error checking for fx_unicode_file_create.  */
2260 
2261     /* Save the system state.  */
2262     saved_system_state =  _tx_thread_system_state;
2263 
2264     /* Setup the fake media structure.  */
2265     media_instance.fx_media_id =  FX_MEDIA_ID;
2266 
2267     /* Call the _fxe_unicode_file_create with a NULL source name to cause an error.  */
2268     status =  _fxe_unicode_file_create(&media_instance, FX_NULL, 0, "SHORT");
2269 
2270     /* Check for the error.  */
2271     if (status != FX_PTR_ERROR)
2272     {
2273 
2274         /* Increment the failed tests counter.  */
2275         test_control_failed_tests++;
2276 
2277         /* Print error message.  */
2278         printf("Error in checking of fxe_unicode_file_create!\n");
2279     }
2280 
2281     /* Call the _fxe_unicode_file_create with a zero source name lenght to cause an error.  */
2282     status =  _fxe_unicode_file_create(&media_instance, (UCHAR *)"UNICODE NAME", 0, "SHORT");
2283 
2284     /* Check for the error.  */
2285     if (status != FX_PTR_ERROR)
2286     {
2287 
2288         /* Increment the failed tests counter.  */
2289         test_control_failed_tests++;
2290 
2291         /* Print error message.  */
2292         printf("Error in checking of fxe_unicode_file_create!\n");
2293     }
2294 
2295     /* Call the _fxe_unicode_file_create with a NULL source short name to cause an error.  */
2296     status =  _fxe_unicode_file_create(&media_instance, (UCHAR *)"UNICODE NAME", 6, FX_NULL);
2297 
2298     /* Check for the error.  */
2299     if (status != FX_PTR_ERROR)
2300     {
2301 
2302         /* Increment the failed tests counter.  */
2303         test_control_failed_tests++;
2304 
2305         /* Print error message.  */
2306         printf("Error in checking of fxe_unicode_file_create!\n");
2307     }
2308 
2309     /* Call the _fxe_unicode_file_create to cause an error.  */
2310     status =  _fxe_unicode_file_create(&media_instance, (UCHAR *)"UNICODE NAME", 6, "SHORT");
2311 
2312     /* Check for the error.  */
2313     if (status != FX_CALLER_ERROR)
2314     {
2315 
2316         /* Increment the failed tests counter.  */
2317         test_control_failed_tests++;
2318 
2319         /* Print error message.  */
2320         printf("Error in checking of fxe_unicode_file_create!\n");
2321     }
2322 
2323     /* Clear the system state to simulate an ISR caller.  */
2324     _tx_thread_system_state =  0;
2325 
2326     /* Call the _fxe_unicode_file_create to cause an error.  */
2327     status =  _fxe_unicode_file_create(&media_instance, (UCHAR *)"UNICODE NAME", 6, "SHORT");
2328 
2329     /* Check for the error.  */
2330     if (status != FX_CALLER_ERROR)
2331     {
2332 
2333         /* Increment the failed tests counter.  */
2334         test_control_failed_tests++;
2335 
2336         /* Print error message.  */
2337         printf("Error in checking of fxe_unicode_file_create!\n");
2338     }
2339 
2340 #ifndef TX_TIMER_PROCESS_IN_ISR
2341 
2342     /* Set the current thread to the timer thread, for caller checking.  */
2343     _tx_thread_current_ptr =  &_tx_timer_thread;
2344 
2345     /* Call the _fxe_unicode_file_create to cause an error.  */
2346     status =  _fxe_unicode_file_create(&media_instance, (UCHAR *)"UNICODE NAME", 6, "SHORT");
2347 
2348     /* Set the current thread back to NULL.  */
2349     _tx_thread_current_ptr =  FX_NULL;
2350 
2351     /* Check for the error.  */
2352     if (status != FX_CALLER_ERROR)
2353     {
2354 
2355         /* Increment the failed tests counter.  */
2356         test_control_failed_tests++;
2357 
2358         /* Print error message.  */
2359         printf("Error in checking of fxe_unicode_file_create!\n");
2360     }
2361 #endif
2362 
2363     /* Restore the system state.  */
2364     _tx_thread_system_state =  saved_system_state;
2365 
2366 
2367     /* Check caller error checking for fx_unicode_file_rename.  */
2368 
2369     /* Save the system state.  */
2370     saved_system_state =  _tx_thread_system_state;
2371 
2372     /* Setup the fake media structure.  */
2373     media_instance.fx_media_id =  FX_MEDIA_ID;
2374 
2375     /* Call the _fxe_unicode_file_rename with a NULL old unicode name to cause an error.  */
2376     status =  _fxe_unicode_file_rename(&media_instance, FX_NULL, 0, FX_NULL, 0, FX_NULL);
2377 
2378     /* Check for the error.  */
2379     if (status != FX_PTR_ERROR)
2380     {
2381 
2382         /* Increment the failed tests counter.  */
2383         test_control_failed_tests++;
2384 
2385         /* Print error message.  */
2386         printf("Error in checking of fxe_unicode_file_rename!\n");
2387     }
2388 
2389     /* Call the _fxe_unicode_file_rename with a zero length old unicode name to cause an error.  */
2390     status =  _fxe_unicode_file_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 0, FX_NULL, 0, FX_NULL);
2391 
2392     /* Check for the error.  */
2393     if (status != FX_PTR_ERROR)
2394     {
2395 
2396         /* Increment the failed tests counter.  */
2397         test_control_failed_tests++;
2398 
2399         /* Print error message.  */
2400         printf("Error in checking of fxe_unicode_file_rename!\n");
2401     }
2402 
2403     /* Call the _fxe_unicode_file_rename with a NULL new unicode name to cause an error.  */
2404     status =  _fxe_unicode_file_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, FX_NULL, 0, FX_NULL);
2405 
2406     /* Check for the error.  */
2407     if (status != FX_PTR_ERROR)
2408     {
2409 
2410         /* Increment the failed tests counter.  */
2411         test_control_failed_tests++;
2412 
2413         /* Print error message.  */
2414         printf("Error in checking of fxe_unicode_file_rename!\n");
2415     }
2416 
2417     /* Call the _fxe_unicode_file_rename with a zero lenght new unicode name to cause an error.  */
2418     status =  _fxe_unicode_file_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 0, FX_NULL);
2419 
2420     /* Check for the error.  */
2421     if (status != FX_PTR_ERROR)
2422     {
2423 
2424         /* Increment the failed tests counter.  */
2425         test_control_failed_tests++;
2426 
2427         /* Print error message.  */
2428         printf("Error in checking of fxe_unicode_file_rename!\n");
2429     }
2430 
2431     /* Call the _fxe_unicode_file_rename with a NULL new short name to cause an error.  */
2432     status =  _fxe_unicode_file_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, FX_NULL);
2433 
2434     /* Check for the error.  */
2435     if (status != FX_PTR_ERROR)
2436     {
2437 
2438         /* Increment the failed tests counter.  */
2439         test_control_failed_tests++;
2440 
2441         /* Print error message.  */
2442         printf("Error in checking of fxe_unicode_file_rename!\n");
2443     }
2444 
2445     /* Call the _fxe_unicode_file_rename to cause an error.  */
2446     status =  _fxe_unicode_file_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, "SHORT");
2447 
2448     /* Check for the error.  */
2449     if (status != FX_CALLER_ERROR)
2450     {
2451 
2452         /* Increment the failed tests counter.  */
2453         test_control_failed_tests++;
2454 
2455         /* Print error message.  */
2456         printf("Error in checking of fxe_unicode_file_rename!\n");
2457     }
2458 
2459     /* Clear the system state to simulate an ISR caller.  */
2460     _tx_thread_system_state =  0;
2461 
2462     /* Call the _fxe_unicode_file_rename to cause an error.  */
2463     status =  _fxe_unicode_file_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, "SHORT");
2464 
2465     /* Check for the error.  */
2466     if (status != FX_CALLER_ERROR)
2467     {
2468 
2469         /* Increment the failed tests counter.  */
2470         test_control_failed_tests++;
2471 
2472         /* Print error message.  */
2473         printf("Error in checking of fxe_unicode_file_rename!\n");
2474     }
2475 
2476 #ifndef TX_TIMER_PROCESS_IN_ISR
2477 
2478     /* Set the current thread to the timer thread, for caller checking.  */
2479     _tx_thread_current_ptr =  &_tx_timer_thread;
2480 
2481     /* Call the _fxe_unicode_file_rename to cause an error.  */
2482     status =  _fxe_unicode_file_rename(&media_instance, (UCHAR *)"OLD_UNICODE_NAME", 16, (UCHAR *)"NEW_UNICODE_NAME", 16, "SHORT");
2483 
2484     /* Set the current thread back to NULL.  */
2485     _tx_thread_current_ptr =  FX_NULL;
2486 
2487     /* Check for the error.  */
2488     if (status != FX_CALLER_ERROR)
2489     {
2490 
2491         /* Increment the failed tests counter.  */
2492         test_control_failed_tests++;
2493 
2494         /* Print error message.  */
2495         printf("Error in checking of fxe_unicode_file_rename!\n");
2496     }
2497 #endif
2498 
2499     /* Restore the system state.  */
2500     _tx_thread_system_state =  saved_system_state;
2501 
2502 
2503     /* Check caller error checking for fx_unicode_name_get.  */
2504 
2505     /* Save the system state.  */
2506     saved_system_state =  _tx_thread_system_state;
2507 
2508     /* Setup the fake media structure.  */
2509     media_instance.fx_media_id =  FX_MEDIA_ID;
2510 
2511     /* Call the _fxe_unicode_name_get with a NULL short name to cause an error.  */
2512     status =  _fxe_unicode_name_get(&media_instance, FX_NULL, FX_NULL, FX_NULL);
2513 
2514     /* Check for the error.  */
2515     if (status != FX_PTR_ERROR)
2516     {
2517 
2518         /* Increment the failed tests counter.  */
2519         test_control_failed_tests++;
2520 
2521         /* Print error message.  */
2522         printf("Error in checking of fxe_unicode_name_get!\n");
2523     }
2524 
2525     /* Call the _fxe_unicode_name_get with a NULL destination name to cause an error.  */
2526     status =  _fxe_unicode_name_get(&media_instance, "SHORTNAME", FX_NULL, FX_NULL);
2527 
2528     /* Check for the error.  */
2529     if (status != FX_PTR_ERROR)
2530     {
2531 
2532         /* Increment the failed tests counter.  */
2533         test_control_failed_tests++;
2534 
2535         /* Print error message.  */
2536         printf("Error in checking of fxe_unicode_name_get!\n");
2537     }
2538 
2539     /* Call the _fxe_unicode_name_get with a NULL destination name size to cause an error.  */
2540     status =  _fxe_unicode_name_get(&media_instance, "SHORTNAME", (UCHAR *)"DESTINATION", FX_NULL);
2541 
2542     /* Check for the error.  */
2543     if (status != FX_PTR_ERROR)
2544     {
2545 
2546         /* Increment the failed tests counter.  */
2547         test_control_failed_tests++;
2548 
2549         /* Print error message.  */
2550         printf("Error in checking of fxe_unicode_name_get!\n");
2551     }
2552 
2553     /* Call the _fxe_unicode_name_get to cause an error.  */
2554     status =  _fxe_unicode_name_get(&media_instance, "SHORTNAME", (UCHAR *)"DESTINATION", &temp);
2555 
2556     /* Check for the error.  */
2557     if (status != FX_CALLER_ERROR)
2558     {
2559 
2560         /* Increment the failed tests counter.  */
2561         test_control_failed_tests++;
2562 
2563         /* Print error message.  */
2564         printf("Error in checking of fxe_unicode_name_get!\n");
2565     }
2566 
2567     /* Call the _fxe_unicode_name_get_extended with a NULL short name to cause an error.  */
2568     status = _fxe_unicode_name_get_extended(FX_NULL, FX_NULL, FX_NULL, FX_NULL, 0);
2569 
2570     /* Check for the error.  */
2571     if (status != FX_PTR_ERROR)
2572     {
2573 
2574         /* Increment the failed tests counter.  */
2575         test_control_failed_tests++;
2576 
2577         /* Print error message.  */
2578         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2579     }
2580 
2581     /* Call the _fxe_unicode_name_get_extended with a NULL short name to cause an error.  */
2582     status = _fxe_unicode_name_get_extended(&media_instance, FX_NULL, FX_NULL, FX_NULL, 0);
2583 
2584     /* Check for the error.  */
2585     if (status != FX_PTR_ERROR)
2586     {
2587 
2588         /* Increment the failed tests counter.  */
2589         test_control_failed_tests++;
2590 
2591         /* Print error message.  */
2592         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2593     }
2594 
2595     /* Call the _fxe_unicode_name_get_extended with a NULL destination name to cause an error.  */
2596     status = _fxe_unicode_name_get_extended(&media_instance, "SHORTNAME", FX_NULL, FX_NULL, 0);
2597 
2598     /* Check for the error.  */
2599     if (status != FX_PTR_ERROR)
2600     {
2601 
2602         /* Increment the failed tests counter.  */
2603         test_control_failed_tests++;
2604 
2605         /* Print error message.  */
2606         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2607     }
2608 
2609     /* Call the _fxe_unicode_name_get_extended with a NULL destination name size to cause an error.  */
2610     status = _fxe_unicode_name_get_extended(&media_instance, "SHORTNAME", (UCHAR*)"DESTINATION", FX_NULL, 0);
2611 
2612     /* Check for the error.  */
2613     if (status != FX_PTR_ERROR)
2614     {
2615 
2616         /* Increment the failed tests counter.  */
2617         test_control_failed_tests++;
2618 
2619         /* Print error message.  */
2620         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2621     }
2622 
2623     /* Call the _fxe_unicode_name_get_extended to cause an error.  */
2624     status = _fxe_unicode_name_get_extended(&media_instance, "SHORTNAME", (UCHAR*)"DESTINATION", &temp, 1);
2625 
2626     /* Check for the error.  */
2627     if (status != FX_CALLER_ERROR)
2628     {
2629 
2630         /* Increment the failed tests counter.  */
2631         test_control_failed_tests++;
2632 
2633         /* Print error message.  */
2634         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2635     }
2636 
2637     /* Call the _fxe_unicode_name_get_extended to cause an error.  */
2638     status = _fxe_unicode_name_get_extended(&media_instance, "SHORTNAME", (UCHAR*)"DESTINATION", &temp, 0);
2639 
2640     /* Check for the error.  */
2641     if (status != FX_BUFFER_ERROR)
2642     {
2643 
2644         /* Increment the failed tests counter.  */
2645         test_control_failed_tests++;
2646 
2647         /* Print error message.  */
2648         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2649     }
2650 
2651     /* Clear the system state to simulate an ISR caller.  */
2652     _tx_thread_system_state =  0;
2653 
2654     /* Call the _fxe_unicode_name_get to cause an error.  */
2655     status =  _fxe_unicode_name_get(&media_instance, "SHORTNAME", (UCHAR *)"DESTINATION", &temp);
2656 
2657     /* Check for the error.  */
2658     if (status != FX_CALLER_ERROR)
2659     {
2660 
2661         /* Increment the failed tests counter.  */
2662         test_control_failed_tests++;
2663 
2664         /* Print error message.  */
2665         printf("Error in checking of fxe_unicode_name_get!\n");
2666     }
2667 
2668     /* Call the _fxe_unicode_name_get_extended to cause an error.  */
2669     status = _fxe_unicode_name_get_extended(&media_instance, "SHORTNAME", (UCHAR*)"DESTINATION", &temp, 1);
2670 
2671     /* Check for the error.  */
2672     if (status != FX_CALLER_ERROR)
2673     {
2674 
2675         /* Increment the failed tests counter.  */
2676         test_control_failed_tests++;
2677 
2678         /* Print error message.  */
2679         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2680     }
2681 
2682 #ifndef TX_TIMER_PROCESS_IN_ISR
2683 
2684     /* Set the current thread to the timer thread, for caller checking.  */
2685     _tx_thread_current_ptr =  &_tx_timer_thread;
2686 
2687     /* Call the _fxe_unicode_name_get to cause an error.  */
2688     status =  _fxe_unicode_name_get(&media_instance, "SHORTNAME", (UCHAR *)"DESTINATION", &temp);
2689 
2690     /* Set the current thread back to NULL.  */
2691     _tx_thread_current_ptr =  FX_NULL;
2692 
2693     /* Check for the error.  */
2694     if (status != FX_CALLER_ERROR)
2695     {
2696 
2697         /* Increment the failed tests counter.  */
2698         test_control_failed_tests++;
2699 
2700         /* Print error message.  */
2701         printf("Error in checking of fxe_unicode_name_get!\n");
2702     }
2703 
2704     /* Set the current thread to the timer thread, for caller checking.  */
2705     _tx_thread_current_ptr = &_tx_timer_thread;
2706 
2707     /* Call the _fxe_unicode_name_get_extended to cause an error.  */
2708     status = _fxe_unicode_name_get_extended(&media_instance, "SHORTNAME", (UCHAR*)"DESTINATION", &temp, 1);
2709 
2710     /* Set the current thread back to NULL.  */
2711     _tx_thread_current_ptr = FX_NULL;
2712 
2713     /* Check for the error.  */
2714     if (status != FX_CALLER_ERROR)
2715     {
2716 
2717         /* Increment the failed tests counter.  */
2718         test_control_failed_tests++;
2719 
2720         /* Print error message.  */
2721         printf("Error in checking of fxe_unicode_name_get_extended!\n");
2722     }
2723 #endif
2724 
2725     /* Restore the system state.  */
2726     _tx_thread_system_state =  saved_system_state;
2727 
2728 
2729     /* Check caller error checking for fx_unicode_short_name_get.  */
2730 
2731     /* Save the system state.  */
2732     saved_system_state =  _tx_thread_system_state;
2733 
2734     /* Setup the fake media structure.  */
2735     media_instance.fx_media_id =  FX_MEDIA_ID;
2736 
2737     /* Call the _fxe_unicode_short_name_get with a NULL source name to cause an error.  */
2738     status =  _fxe_unicode_short_name_get(&media_instance, FX_NULL, 0, FX_NULL);
2739 
2740     /* Check for the error.  */
2741     if (status != FX_PTR_ERROR)
2742     {
2743 
2744         /* Increment the failed tests counter.  */
2745         test_control_failed_tests++;
2746 
2747         /* Print error message.  */
2748         printf("Error in checking of fxe_unicode_short_name_get!\n");
2749     }
2750 
2751     /* Call the _fxe_unicode_short_name_get with a zero length source name to cause an error.  */
2752     status =  _fxe_unicode_short_name_get(&media_instance, (UCHAR *)"SOURCENAME", 0, FX_NULL);
2753 
2754     /* Check for the error.  */
2755     if (status != FX_PTR_ERROR)
2756     {
2757 
2758         /* Increment the failed tests counter.  */
2759         test_control_failed_tests++;
2760 
2761         /* Print error message.  */
2762         printf("Error in checking of fxe_unicode_short_name_get!\n");
2763     }
2764 
2765     /* Call the _fxe_unicode_short_name_get with a NULL destination name to cause an error.  */
2766     status =  _fxe_unicode_short_name_get(&media_instance, (UCHAR *)"SOURCENAME", 16, FX_NULL);
2767 
2768     /* Check for the error.  */
2769     if (status != FX_PTR_ERROR)
2770     {
2771 
2772         /* Increment the failed tests counter.  */
2773         test_control_failed_tests++;
2774 
2775         /* Print error message.  */
2776         printf("Error in checking of fxe_unicode_short_name_get!\n");
2777     }
2778 
2779     /* Call the _fxe_unicode_short_name_get to cause an error.  */
2780     status =  _fxe_unicode_short_name_get(&media_instance, (UCHAR *)"SOURCENAME", 16, "DESTINATION");
2781 
2782     /* Check for the error.  */
2783     if (status != FX_CALLER_ERROR)
2784     {
2785 
2786         /* Increment the failed tests counter.  */
2787         test_control_failed_tests++;
2788 
2789         /* Print error message.  */
2790         printf("Error in checking of fxe_unicode_short_name_get!\n");
2791     }
2792 
2793     /* Call the _fxe_unicode_short_name_get_extended with a NULL source name to cause an error.  */
2794     status = _fxe_unicode_short_name_get_extended(&media_instance, FX_NULL, 0, FX_NULL, 0);
2795 
2796     /* Check for the error.  */
2797     if (status != FX_PTR_ERROR)
2798     {
2799 
2800         /* Increment the failed tests counter.  */
2801         test_control_failed_tests++;
2802 
2803         /* Print error message.  */
2804         printf("Error in checking of fxe_unicode_short_name_get_extended!\n");
2805     }
2806 
2807     /* Call the _fxe_unicode_short_name_get_extended with a zero length source name to cause an error.  */
2808     status = _fxe_unicode_short_name_get_extended(&media_instance, (UCHAR*)"SOURCENAME", 0, FX_NULL, 0);
2809 
2810     /* Check for the error.  */
2811     if (status != FX_PTR_ERROR)
2812     {
2813 
2814         /* Increment the failed tests counter.  */
2815         test_control_failed_tests++;
2816 
2817         /* Print error message.  */
2818         printf("Error in checking of fxe_unicode_short_name_get_extended!\n");
2819     }
2820 
2821     /* Call the _fxe_unicode_short_name_get_extended with a NULL destination name to cause an error.  */
2822     status = _fxe_unicode_short_name_get_extended(&media_instance, (UCHAR*)"SOURCENAME", 16, FX_NULL, 0);
2823 
2824     /* Check for the error.  */
2825     if (status != FX_PTR_ERROR)
2826     {
2827 
2828         /* Increment the failed tests counter.  */
2829         test_control_failed_tests++;
2830 
2831         /* Print error message.  */
2832         printf("Error in checking of fxe_unicode_short_name_get_extended!\n");
2833     }
2834 
2835     /* Call the _fxe_unicode_short_name_get_extended with a NULL destination name to cause an error.  */
2836     status = _fxe_unicode_short_name_get_extended(FX_NULL, FX_NULL, 0, FX_NULL, 0);
2837 
2838     /* Check for the error.  */
2839     if (status != FX_PTR_ERROR)
2840     {
2841 
2842         /* Increment the failed tests counter.  */
2843         test_control_failed_tests++;
2844 
2845         /* Print error message.  */
2846         printf("Error in checking of fxe_unicode_short_name_get_extended!\n");
2847     }
2848 
2849     /* Call the _fxe_unicode_short_name_get_extended to cause an error.  */
2850     status = _fxe_unicode_short_name_get_extended(&media_instance, (UCHAR*)"SOURCENAME", 16, "DESTINATION", 1);
2851 
2852     /* Check for the error.  */
2853     if (status != FX_CALLER_ERROR)
2854     {
2855 
2856         /* Increment the failed tests counter.  */
2857         test_control_failed_tests++;
2858 
2859         /* Print error message.  */
2860         printf("Error in checking of fxe_unicode_short_name_get_extended!\n");
2861     }
2862 
2863     /* Call the _fxe_unicode_short_name_get_extended to cause an error.  */
2864     status = _fxe_unicode_short_name_get_extended(&media_instance, (UCHAR*)"SOURCENAME", 16, "DESTINATION", 0);
2865 
2866     /* Check for the error.  */
2867     if (status != FX_BUFFER_ERROR)
2868     {
2869 
2870         /* Increment the failed tests counter.  */
2871         test_control_failed_tests++;
2872 
2873         /* Print error message.  */
2874         printf("Error in checking of fxe_unicode_short_name_get_extended!\n");
2875     }
2876 
2877     /* Clear the system state to simulate an ISR caller.  */
2878     _tx_thread_system_state =  0;
2879 
2880     /* Call the _fxe_unicode_short_name_get to cause an error.  */
2881     status =  _fxe_unicode_short_name_get(&media_instance, (UCHAR *)"SOURCENAME", 16, "DESTINATION");
2882 
2883     /* Check for the error.  */
2884     if (status != FX_CALLER_ERROR)
2885     {
2886 
2887         /* Increment the failed tests counter.  */
2888         test_control_failed_tests++;
2889 
2890         /* Print error message.  */
2891         printf("Error in checking of fxe_unicode_short_name_get!\n");
2892     }
2893 
2894     /* Call the _fxe_unicode_short_name_get_extended to cause an error.  */
2895     status = _fxe_unicode_short_name_get_extended(&media_instance, (UCHAR*)"SOURCENAME", 16, "DESTINATION", 1);
2896 
2897     /* Check for the error.  */
2898     if (status != FX_CALLER_ERROR)
2899     {
2900 
2901         /* Increment the failed tests counter.  */
2902         test_control_failed_tests++;
2903 
2904         /* Print error message.  */
2905         printf("Error in checking of fxe_unicode_short_name_get_extended!\n");
2906     }
2907 #ifndef TX_TIMER_PROCESS_IN_ISR
2908 
2909     /* Set the current thread to the timer thread, for caller checking.  */
2910     _tx_thread_current_ptr =  &_tx_timer_thread;
2911 
2912     /* Call the _fxe_unicode_short_name_get to cause an error.  */
2913     status =  _fxe_unicode_short_name_get(&media_instance, (UCHAR *)"SOURCENAME", 16, "DESTINATION");
2914 
2915     /* Set the current thread back to NULL.  */
2916     _tx_thread_current_ptr =  FX_NULL;
2917 
2918     /* Check for the error.  */
2919     if (status != FX_CALLER_ERROR)
2920     {
2921 
2922         /* Increment the failed tests counter.  */
2923         test_control_failed_tests++;
2924 
2925         /* Print error message.  */
2926         printf("Error in checking of fxe_unicode_short_name_get!\n");
2927     }
2928 
2929     /* Set the current thread to the timer thread, for caller checking.  */
2930     _tx_thread_current_ptr = &_tx_timer_thread;
2931 
2932     /* Call the _fxe_unicode_short_name_get to cause an error.  */
2933     status = _fxe_unicode_short_name_get_extended(&media_instance, (UCHAR*)"SOURCENAME", 16, "DESTINATION", 1);
2934 
2935     /* Set the current thread back to NULL.  */
2936     _tx_thread_current_ptr = FX_NULL;
2937 
2938     /* Check for the error.  */
2939     if (status != FX_CALLER_ERROR)
2940     {
2941 
2942         /* Increment the failed tests counter.  */
2943         test_control_failed_tests++;
2944 
2945         /* Print error message.  */
2946         printf("Error in checking of fxe_unicode_short_name_get!\n");
2947     }
2948 #endif
2949 
2950     /* Restore the system state.  */
2951     _tx_thread_system_state =  saved_system_state;
2952 
2953     /* Check caller error checking for fx_file_write_notify.  */
2954 
2955     /* Save the system state.  */
2956     saved_system_state =  _tx_thread_system_state;
2957 
2958     /* Setup the fake media structure.  */
2959     media_instance.fx_media_id =  FX_MEDIA_ID;
2960 
2961     /* Call the _fxe_file_write_notify_set with a NULL file pointer to cause an error.  */
2962     status =  _fxe_file_write_notify_set(FX_NULL, FX_NULL);
2963 
2964     /* Check for the error.  */
2965     if (status != FX_PTR_ERROR)
2966     {
2967 
2968         /* Increment the failed tests counter.  */
2969         test_control_failed_tests++;
2970 
2971         /* Print error message.  */
2972         printf("Error in checking of fxe_file_write_notify_set!\n");
2973     }
2974 
2975     /* Call the _fxe_file_write_notify_set to cause an error.  */
2976     status =  _fxe_file_write_notify_set(&file_instance, FX_NULL);
2977 
2978     /* Check for the error.  */
2979     if (status != FX_CALLER_ERROR)
2980     {
2981 
2982         /* Increment the failed tests counter.  */
2983         test_control_failed_tests++;
2984 
2985         /* Print error message.  */
2986         printf("Error in checking of fxe_file_write_notify_set!\n");
2987     }
2988 
2989     /* Clear the system state to simulate an ISR caller.  */
2990     _tx_thread_system_state =  0;
2991 
2992     /* Call the _fxe_file_write_notify_set to cause an error.  */
2993     status =  _fxe_file_write_notify_set(&file_instance, FX_NULL);
2994 
2995     /* Check for the error.  */
2996     if (status != FX_CALLER_ERROR)
2997     {
2998 
2999         /* Increment the failed tests counter.  */
3000         test_control_failed_tests++;
3001 
3002         /* Print error message.  */
3003         printf("Error in checking of fxe_file_write_notify_set!\n");
3004     }
3005 
3006 #ifndef TX_TIMER_PROCESS_IN_ISR
3007 
3008     /* Set the current thread to the timer thread, for caller checking.  */
3009     _tx_thread_current_ptr =  &_tx_timer_thread;
3010 
3011     /* Call the _fxe_file_write_notify_set to cause an error.  */
3012     status =  _fxe_file_write_notify_set(&file_instance, FX_NULL);
3013 
3014     /* Set the current thread back to NULL.  */
3015     _tx_thread_current_ptr =  FX_NULL;
3016 
3017     /* Check for the error.  */
3018     if (status != FX_CALLER_ERROR)
3019     {
3020 
3021         /* Increment the failed tests counter.  */
3022         test_control_failed_tests++;
3023 
3024         /* Print error message.  */
3025         printf("Error in checking of fxe_file_write_notify_set!\n");
3026     }
3027 #endif
3028 
3029     /* Restore the system state.  */
3030     _tx_thread_system_state =  saved_system_state;
3031 
3032 
3033     /* Check caller error checking for fx_file_write.  */
3034 
3035     /* Save the system state.  */
3036     saved_system_state =  _tx_thread_system_state;
3037 
3038     /* Setup the fake media structure.  */
3039     media_instance.fx_media_id =  FX_MEDIA_ID;
3040 
3041     /* Call the _fxe_file_write with a NULL buffer pointer to cause an error.  */
3042     status =  _fxe_file_write(&file_instance, FX_NULL, 20);
3043 
3044     /* Check for the error.  */
3045     if (status != FX_PTR_ERROR)
3046     {
3047 
3048         /* Increment the failed tests counter.  */
3049         test_control_failed_tests++;
3050 
3051         /* Print error message.  */
3052         printf("Error in checking of fxe_file_write!\n");
3053     }
3054 
3055     /* Call the _fxe_file_write with a NULL buffer pointer to cause an error.  */
3056     status =  _fxe_file_write(&file_instance, buffer, 20);
3057 
3058     /* Check for the error.  */
3059     if (status != FX_CALLER_ERROR)
3060     {
3061 
3062         /* Increment the failed tests counter.  */
3063         test_control_failed_tests++;
3064 
3065         /* Print error message.  */
3066         printf("Error in checking of fxe_file_write!\n");
3067     }
3068 
3069     /* Clear the system state to simulate an ISR caller.  */
3070     _tx_thread_system_state =  0;
3071 
3072     /* Call the _fxe_file_write with a NULL buffer pointer to cause an error.  */
3073     status =  _fxe_file_write(&file_instance, buffer, 20);
3074 
3075     /* Check for the error.  */
3076     if (status != FX_CALLER_ERROR)
3077     {
3078 
3079         /* Increment the failed tests counter.  */
3080         test_control_failed_tests++;
3081 
3082         /* Print error message.  */
3083         printf("Error in checking of fxe_file_write!\n");
3084     }
3085 
3086 #ifndef TX_TIMER_PROCESS_IN_ISR
3087 
3088     /* Set the current thread to the timer thread, for caller checking.  */
3089     _tx_thread_current_ptr =  &_tx_timer_thread;
3090 
3091     /* Call the _fxe_file_write with a NULL buffer pointer to cause an error.  */
3092     status =  _fxe_file_write(&file_instance, buffer, 20);
3093 
3094     /* Set the current thread back to NULL.  */
3095     _tx_thread_current_ptr =  FX_NULL;
3096 
3097     /* Check for the error.  */
3098     if (status != FX_CALLER_ERROR)
3099     {
3100 
3101         /* Increment the failed tests counter.  */
3102         test_control_failed_tests++;
3103 
3104         /* Print error message.  */
3105         printf("Error in checking of fxe_file_write!\n");
3106     }
3107 #endif
3108 
3109     /* Restore the system state.  */
3110     _tx_thread_system_state =  saved_system_state;
3111 
3112 
3113     /* Check caller error checking for fx_file_truncate_release.  */
3114 
3115     /* Save the system state.  */
3116     saved_system_state =  _tx_thread_system_state;
3117 
3118     /* Call the _fxe_file_truncate_release to cause an error.  */
3119     status =  _fxe_file_truncate_release(&file_instance, 10);
3120 
3121     /* Check for the error.  */
3122     if (status != FX_CALLER_ERROR)
3123     {
3124 
3125         /* Increment the failed tests counter.  */
3126         test_control_failed_tests++;
3127 
3128         /* Print error message.  */
3129         printf("Error in checking of fxe_file_truncate_release!\n");
3130     }
3131 
3132     /* Clear the system state to simulate an ISR caller.  */
3133     _tx_thread_system_state =  0;
3134 
3135     /* Call the _fxe_file_truncate_release to cause an error.  */
3136     status =  _fxe_file_truncate_release(&file_instance, 10);
3137 
3138     /* Check for the error.  */
3139     if (status != FX_CALLER_ERROR)
3140     {
3141 
3142         /* Increment the failed tests counter.  */
3143         test_control_failed_tests++;
3144 
3145         /* Print error message.  */
3146         printf("Error in checking of fxe_file_truncate_release!\n");
3147     }
3148 
3149 #ifndef TX_TIMER_PROCESS_IN_ISR
3150 
3151     /* Set the current thread to the timer thread, for caller checking.  */
3152     _tx_thread_current_ptr =  &_tx_timer_thread;
3153 
3154     /* Call the _fxe_file_truncate_release to cause an error.  */
3155     status =  _fxe_file_truncate_release(&file_instance, 10);
3156 
3157     /* Set the current thread back to NULL.  */
3158     _tx_thread_current_ptr =  FX_NULL;
3159 
3160     /* Check for the error.  */
3161     if (status != FX_CALLER_ERROR)
3162     {
3163 
3164         /* Increment the failed tests counter.  */
3165         test_control_failed_tests++;
3166 
3167         /* Print error message.  */
3168         printf("Error in checking of fxe_file_truncate_release!\n");
3169     }
3170 #endif
3171 
3172     /* Restore the system state.  */
3173     _tx_thread_system_state =  saved_system_state;
3174 
3175 
3176     /* Check caller error checking for fx_file_truncate.  */
3177 
3178     /* Save the system state.  */
3179     saved_system_state =  _tx_thread_system_state;
3180 
3181     /* Call the _fxe_file_truncate to cause an error.  */
3182     status =  _fxe_file_truncate(&file_instance, 10);
3183 
3184     /* Check for the error.  */
3185     if (status != FX_CALLER_ERROR)
3186     {
3187 
3188         /* Increment the failed tests counter.  */
3189         test_control_failed_tests++;
3190 
3191         /* Print error message.  */
3192         printf("Error in checking of fxe_file_truncate!\n");
3193     }
3194 
3195     /* Clear the system state to simulate an ISR caller.  */
3196     _tx_thread_system_state =  0;
3197 
3198     /* Call the _fxe_file_truncate to cause an error.  */
3199     status =  _fxe_file_truncate(&file_instance, 10);
3200 
3201     /* Check for the error.  */
3202     if (status != FX_CALLER_ERROR)
3203     {
3204 
3205         /* Increment the failed tests counter.  */
3206         test_control_failed_tests++;
3207 
3208         /* Print error message.  */
3209         printf("Error in checking of fxe_file_truncate!\n");
3210     }
3211 
3212 #ifndef TX_TIMER_PROCESS_IN_ISR
3213 
3214     /* Set the current thread to the timer thread, for caller checking.  */
3215     _tx_thread_current_ptr =  &_tx_timer_thread;
3216 
3217     /* Call the _fxe_file_truncate to cause an error.  */
3218     status =  _fxe_file_truncate(&file_instance, 10);
3219 
3220     /* Set the current thread back to NULL.  */
3221     _tx_thread_current_ptr =  FX_NULL;
3222 
3223     /* Check for the error.  */
3224     if (status != FX_CALLER_ERROR)
3225     {
3226 
3227         /* Increment the failed tests counter.  */
3228         test_control_failed_tests++;
3229 
3230         /* Print error message.  */
3231         printf("Error in checking of fxe_file_truncate!\n");
3232     }
3233 #endif
3234 
3235     /* Restore the system state.  */
3236     _tx_thread_system_state =  saved_system_state;
3237 
3238 
3239     /* Check caller error checking for fx_file_seek.  */
3240 
3241     /* Save the system state.  */
3242     saved_system_state =  _tx_thread_system_state;
3243 
3244     /* Call the _fxe_file_seek to cause an error.  */
3245     status =  _fxe_file_seek(&file_instance, 10);
3246 
3247     /* Check for the error.  */
3248     if (status != FX_CALLER_ERROR)
3249     {
3250 
3251         /* Increment the failed tests counter.  */
3252         test_control_failed_tests++;
3253 
3254         /* Print error message.  */
3255         printf("Error in checking of fxe_file_seek!\n");
3256     }
3257 
3258     /* Clear the system state to simulate an ISR caller.  */
3259     _tx_thread_system_state =  0;
3260 
3261     /* Call the _fxe_file_seek to cause an error.  */
3262     status =  _fxe_file_seek(&file_instance, 10);
3263 
3264     /* Check for the error.  */
3265     if (status != FX_CALLER_ERROR)
3266     {
3267 
3268         /* Increment the failed tests counter.  */
3269         test_control_failed_tests++;
3270 
3271         /* Print error message.  */
3272         printf("Error in checking of fxe_file_seek!\n");
3273     }
3274 
3275 #ifndef TX_TIMER_PROCESS_IN_ISR
3276 
3277     /* Set the current thread to the timer thread, for caller checking.  */
3278     _tx_thread_current_ptr =  &_tx_timer_thread;
3279 
3280     /* Call the _fxe_file_seek to cause an error.  */
3281     status =  _fxe_file_seek(&file_instance, 10);
3282 
3283     /* Set the current thread back to NULL.  */
3284     _tx_thread_current_ptr =  FX_NULL;
3285 
3286     /* Check for the error.  */
3287     if (status != FX_CALLER_ERROR)
3288     {
3289 
3290         /* Increment the failed tests counter.  */
3291         test_control_failed_tests++;
3292 
3293         /* Print error message.  */
3294         printf("Error in checking of fxe_file_seek!\n");
3295     }
3296 #endif
3297 
3298     /* Restore the system state.  */
3299     _tx_thread_system_state =  saved_system_state;
3300 
3301 
3302     /* Check caller error checking for fx_file_rename.  */
3303 
3304     /* Save the system state.  */
3305     saved_system_state =  _tx_thread_system_state;
3306 
3307     /* Call the _fxe_file_rename to cause an error.  */
3308     status =  _fxe_file_rename(&media_instance, "OLDNAME", "NEWNAME");
3309 
3310     /* Check for the error.  */
3311     if (status != FX_CALLER_ERROR)
3312     {
3313 
3314         /* Increment the failed tests counter.  */
3315         test_control_failed_tests++;
3316 
3317         /* Print error message.  */
3318         printf("Error in checking of fxe_file_rename!\n");
3319     }
3320 
3321     /* Clear the system state to simulate an ISR caller.  */
3322     _tx_thread_system_state =  0;
3323 
3324     /* Call the _fxe_file_rename to cause an error.  */
3325     status =  _fxe_file_rename(&media_instance, "OLDNAME", "NEWNAME");
3326 
3327     /* Check for the error.  */
3328     if (status != FX_CALLER_ERROR)
3329     {
3330 
3331         /* Increment the failed tests counter.  */
3332         test_control_failed_tests++;
3333 
3334         /* Print error message.  */
3335         printf("Error in checking of fxe_file_rename!\n");
3336     }
3337 
3338 #ifndef TX_TIMER_PROCESS_IN_ISR
3339 
3340     /* Set the current thread to the timer thread, for caller checking.  */
3341     _tx_thread_current_ptr =  &_tx_timer_thread;
3342 
3343     /* Call the _fxe_file_rename to cause an error.  */
3344     status =  _fxe_file_rename(&media_instance, "OLDNAME", "NEWNAME");
3345 
3346     /* Set the current thread back to NULL.  */
3347     _tx_thread_current_ptr =  FX_NULL;
3348 
3349     /* Check for the error.  */
3350     if (status != FX_CALLER_ERROR)
3351     {
3352 
3353         /* Increment the failed tests counter.  */
3354         test_control_failed_tests++;
3355 
3356         /* Print error message.  */
3357         printf("Error in checking of fxe_file_rename!\n");
3358     }
3359 #endif
3360 
3361     /* Restore the system state.  */
3362     _tx_thread_system_state =  saved_system_state;
3363 
3364 
3365     /* Check caller error checking for fx_file_relative_seek.  */
3366 
3367     /* Save the system state.  */
3368     saved_system_state =  _tx_thread_system_state;
3369 
3370     /* Call the _fxe_file_relative_seek to cause an error.  */
3371     status =  _fxe_file_relative_seek(&file_instance, 0, FX_SEEK_BEGIN);
3372 
3373     /* Check for the error.  */
3374     if (status != FX_CALLER_ERROR)
3375     {
3376 
3377         /* Increment the failed tests counter.  */
3378         test_control_failed_tests++;
3379 
3380         /* Print error message.  */
3381         printf("Error in checking of fxe_file_relative_seek!\n");
3382     }
3383 
3384     /* Clear the system state to simulate an ISR caller.  */
3385     _tx_thread_system_state =  0;
3386 
3387     /* Call the _fxe_file_relative_seek to cause an error.  */
3388     status =  _fxe_file_relative_seek(&file_instance, 0, FX_SEEK_BEGIN);
3389 
3390     /* Check for the error.  */
3391     if (status != FX_CALLER_ERROR)
3392     {
3393 
3394         /* Increment the failed tests counter.  */
3395         test_control_failed_tests++;
3396 
3397         /* Print error message.  */
3398         printf("Error in checking of fxe_file_relative_seek!\n");
3399     }
3400 
3401 #ifndef TX_TIMER_PROCESS_IN_ISR
3402 
3403     /* Set the current thread to the timer thread, for caller checking.  */
3404     _tx_thread_current_ptr =  &_tx_timer_thread;
3405 
3406     /* Call the _fxe_file_relative_seek to cause an error.  */
3407     status =  _fxe_file_relative_seek(&file_instance, 0, FX_SEEK_BEGIN);
3408 
3409     /* Set the current thread back to NULL.  */
3410     _tx_thread_current_ptr =  FX_NULL;
3411 
3412     /* Check for the error.  */
3413     if (status != FX_CALLER_ERROR)
3414     {
3415 
3416         /* Increment the failed tests counter.  */
3417         test_control_failed_tests++;
3418 
3419         /* Print error message.  */
3420         printf("Error in checking of fxe_file_relative_seek!\n");
3421     }
3422 #endif
3423 
3424     /* Restore the system state.  */
3425     _tx_thread_system_state =  saved_system_state;
3426 
3427 
3428     /* Check caller error checking for fx_file_read.  */
3429 
3430     /* Save the system state.  */
3431     saved_system_state =  _tx_thread_system_state;
3432 
3433     /* Call the _fxe_file_read with NULL buffer to cause an error.  */
3434     status =  _fxe_file_read(&file_instance, FX_NULL, 20, &temp);
3435 
3436     /* Check for the error.  */
3437     if (status != FX_PTR_ERROR)
3438     {
3439 
3440         /* Increment the failed tests counter.  */
3441         test_control_failed_tests++;
3442 
3443         /* Print error message.  */
3444         printf("Error in checking of fxe_file_read!\n");
3445     }
3446 
3447     /* Call the _fxe_file_read with NULL actual size to cause an error.  */
3448     status =  _fxe_file_read(&file_instance, buffer, 20, FX_NULL);
3449 
3450     /* Check for the error.  */
3451     if (status != FX_PTR_ERROR)
3452     {
3453 
3454         /* Increment the failed tests counter.  */
3455         test_control_failed_tests++;
3456 
3457         /* Print error message.  */
3458         printf("Error in checking of fxe_file_read!\n");
3459     }
3460 
3461     /* Call the _fxe_file_read to cause an error.  */
3462     status =  _fxe_file_read(&file_instance, buffer, 20, &temp);
3463 
3464     /* Check for the error.  */
3465     if (status != FX_CALLER_ERROR)
3466     {
3467 
3468         /* Increment the failed tests counter.  */
3469         test_control_failed_tests++;
3470 
3471         /* Print error message.  */
3472         printf("Error in checking of fxe_file_read!\n");
3473     }
3474 
3475     /* Clear the system state to simulate an ISR caller.  */
3476     _tx_thread_system_state =  0;
3477 
3478     /* Call the _fxe_file_read to cause an error.  */
3479     status =  _fxe_file_read(&file_instance, buffer, 20, &temp);
3480 
3481     /* Check for the error.  */
3482     if (status != FX_CALLER_ERROR)
3483     {
3484 
3485         /* Increment the failed tests counter.  */
3486         test_control_failed_tests++;
3487 
3488         /* Print error message.  */
3489         printf("Error in checking of fxe_file_read!\n");
3490     }
3491 
3492 #ifndef TX_TIMER_PROCESS_IN_ISR
3493 
3494     /* Set the current thread to the timer thread, for caller checking.  */
3495     _tx_thread_current_ptr =  &_tx_timer_thread;
3496 
3497     /* Call the _fxe_file_read to cause an error.  */
3498     status =  _fxe_file_read(&file_instance, buffer, 20, &temp);
3499 
3500     /* Set the current thread back to NULL.  */
3501     _tx_thread_current_ptr =  FX_NULL;
3502 
3503     /* Check for the error.  */
3504     if (status != FX_CALLER_ERROR)
3505     {
3506 
3507         /* Increment the failed tests counter.  */
3508         test_control_failed_tests++;
3509 
3510         /* Print error message.  */
3511         printf("Error in checking of fxe_file_read!\n");
3512     }
3513 #endif
3514 
3515     /* Restore the system state.  */
3516     _tx_thread_system_state =  saved_system_state;
3517 
3518 
3519     /* Check caller error checking for fx_file_open.  */
3520 
3521     /* Setup the fake media structure.  */
3522     media_instance.fx_media_id =  0;
3523 
3524     /* Call the _fx_file_open with a 0 media ID to cause an error.  */
3525     status =  _fx_file_open(&media_instance, FX_NULL, "TEST", FX_OPEN_FOR_READ);
3526 
3527     /* Check for the error.  */
3528     if (status != FX_MEDIA_NOT_OPEN)
3529     {
3530 
3531         /* Increment the failed tests counter.  */
3532         test_control_failed_tests++;
3533 
3534         /* Print error message.  */
3535         printf("Error in checking of fx_file_open!\n");
3536     }
3537 
3538     /* Save the system state.  */
3539     saved_system_state =  _tx_thread_system_state;
3540 
3541     /* Setup the fake media structure.  */
3542     media_instance.fx_media_id =  FX_MEDIA_ID;
3543 
3544     /* Call the _fxe_file_open with NULL file pointer to cause an error.  */
3545     status =  _fxe_file_open(&media_instance, FX_NULL, "TEST", FX_OPEN_FOR_READ, 20);
3546 
3547     /* Check for the error.  */
3548     if (status != FX_PTR_ERROR)
3549     {
3550 
3551         /* Increment the failed tests counter.  */
3552         test_control_failed_tests++;
3553 
3554         /* Print error message.  */
3555         printf("Error in checking of fxe_file_open!\n");
3556     }
3557 
3558     /* Call the _fxe_file_open with bad control block size to cause an error.  */
3559     status =  _fxe_file_open(&media_instance, &file_instance, "TEST", FX_OPEN_FOR_READ, 20);
3560 
3561     /* Check for the error.  */
3562     if (status != FX_PTR_ERROR)
3563     {
3564 
3565         /* Increment the failed tests counter.  */
3566         test_control_failed_tests++;
3567 
3568         /* Print error message.  */
3569         printf("Error in checking of fxe_file_open!\n");
3570     }
3571 
3572     /* Call the _fxe_file_open with bad open type to cause an error.  */
3573     status =  _fxe_file_open(&media_instance, &file_instance, "TEST", (FX_OPEN_FOR_READ+FX_OPEN_FOR_READ_FAST+FX_OPEN_FOR_WRITE+99), sizeof(FX_FILE));
3574 
3575     /* Check for the error.  */
3576     if (status != FX_ACCESS_ERROR)
3577     {
3578 
3579         /* Increment the failed tests counter.  */
3580         test_control_failed_tests++;
3581 
3582         /* Print error message.  */
3583         printf("Error in checking of fxe_file_open!\n");
3584     }
3585 
3586     /* Call the _fxe_file_open to cause an error.  */
3587     status =  _fxe_file_open(&media_instance, &file_instance, "TEST", FX_OPEN_FOR_READ, sizeof(FX_FILE));
3588 
3589     /* Check for the error.  */
3590     if (status != FX_CALLER_ERROR)
3591     {
3592 
3593         /* Increment the failed tests counter.  */
3594         test_control_failed_tests++;
3595 
3596         /* Print error message.  */
3597         printf("Error in checking of fxe_file_open!\n");
3598     }
3599 
3600     /* Clear the system state to simulate an ISR caller.  */
3601     _tx_thread_system_state =  0;
3602 
3603     /* Call the _fxe_file_open to cause an error.  */
3604     status =  _fxe_file_open(&media_instance, &file_instance, "TEST", FX_OPEN_FOR_READ, sizeof(FX_FILE));
3605 
3606     /* Check for the error.  */
3607     if (status != FX_CALLER_ERROR)
3608     {
3609 
3610         /* Increment the failed tests counter.  */
3611         test_control_failed_tests++;
3612 
3613         /* Print error message.  */
3614         printf("Error in checking of fxe_file_open!\n");
3615     }
3616 
3617 #ifndef TX_TIMER_PROCESS_IN_ISR
3618 
3619     /* Set the current thread to the timer thread, for caller checking.  */
3620     _tx_thread_current_ptr =  &_tx_timer_thread;
3621 
3622     /* Call the _fxe_file_open to cause an error.  */
3623     status =  _fxe_file_open(&media_instance, &file_instance, "TEST", FX_OPEN_FOR_READ, sizeof(FX_FILE));
3624 
3625     /* Set the current thread back to NULL.  */
3626     _tx_thread_current_ptr =  FX_NULL;
3627 
3628     /* Check for the error.  */
3629     if (status != FX_CALLER_ERROR)
3630     {
3631 
3632         /* Increment the failed tests counter.  */
3633         test_control_failed_tests++;
3634 
3635         /* Print error message.  */
3636         printf("Error in checking of fxe_file_open!\n");
3637     }
3638 #endif
3639 
3640     /* Restore the system state.  */
3641     _tx_thread_system_state =  saved_system_state;
3642 
3643 
3644     /* Check caller error checking for fx_file_extended_truncate_release.  */
3645 
3646     /* Save the system state.  */
3647     saved_system_state =  _tx_thread_system_state;
3648 
3649     /* Setup the fake media structure.  */
3650     media_instance.fx_media_id =  FX_MEDIA_ID;
3651 
3652     /* Call the _fxe_file_extended_truncate_release to cause an error.  */
3653     status =  _fxe_file_extended_truncate_release(&file_instance, 20);
3654 
3655     /* Check for the error.  */
3656     if (status != FX_CALLER_ERROR)
3657     {
3658 
3659         /* Increment the failed tests counter.  */
3660         test_control_failed_tests++;
3661 
3662         /* Print error message.  */
3663         printf("Error in checking of fxe_file_truncate_release!\n");
3664     }
3665 
3666     /* Clear the system state to simulate an ISR caller.  */
3667     _tx_thread_system_state =  0;
3668 
3669     /* Call the _fxe_file_extended_truncate_release to cause an error.  */
3670     status =  _fxe_file_extended_truncate_release(&file_instance, 20);
3671 
3672     /* Check for the error.  */
3673     if (status != FX_CALLER_ERROR)
3674     {
3675 
3676         /* Increment the failed tests counter.  */
3677         test_control_failed_tests++;
3678 
3679         /* Print error message.  */
3680         printf("Error in checking of fxe_file_extended_truncate_release!\n");
3681     }
3682 
3683 #ifndef TX_TIMER_PROCESS_IN_ISR
3684 
3685     /* Set the current thread to the timer thread, for caller checking.  */
3686     _tx_thread_current_ptr =  &_tx_timer_thread;
3687 
3688     /* Call the _fxe_file_extended_truncate_release to cause an error.  */
3689     status =  _fxe_file_extended_truncate_release(&file_instance, 20);
3690 
3691     /* Set the current thread back to NULL.  */
3692     _tx_thread_current_ptr =  FX_NULL;
3693 
3694     /* Check for the error.  */
3695     if (status != FX_CALLER_ERROR)
3696     {
3697 
3698         /* Increment the failed tests counter.  */
3699         test_control_failed_tests++;
3700 
3701         /* Print error message.  */
3702         printf("Error in checking of fxe_file_extended_truncate_release!\n");
3703     }
3704 #endif
3705 
3706     /* Restore the system state.  */
3707     _tx_thread_system_state =  saved_system_state;
3708 
3709 
3710     /* Check caller error checking for fx_file_extended_truncate.  */
3711 
3712     /* Save the system state.  */
3713     saved_system_state =  _tx_thread_system_state;
3714 
3715     /* Setup the fake media structure.  */
3716     media_instance.fx_media_id =  FX_MEDIA_ID;
3717 
3718     /* Call the _fxe_file_extended_truncate to cause an error.  */
3719     status =  _fxe_file_extended_truncate(&file_instance, 20);
3720 
3721     /* Check for the error.  */
3722     if (status != FX_CALLER_ERROR)
3723     {
3724 
3725         /* Increment the failed tests counter.  */
3726         test_control_failed_tests++;
3727 
3728         /* Print error message.  */
3729         printf("Error in checking of fxe_file_truncate!\n");
3730     }
3731 
3732     /* Clear the system state to simulate an ISR caller.  */
3733     _tx_thread_system_state =  0;
3734 
3735     /* Call the _fxe_file_extended_truncate to cause an error.  */
3736     status =  _fxe_file_extended_truncate(&file_instance, 20);
3737 
3738     /* Check for the error.  */
3739     if (status != FX_CALLER_ERROR)
3740     {
3741 
3742         /* Increment the failed tests counter.  */
3743         test_control_failed_tests++;
3744 
3745         /* Print error message.  */
3746         printf("Error in checking of fxe_file_extended_truncate!\n");
3747     }
3748 
3749 #ifndef TX_TIMER_PROCESS_IN_ISR
3750 
3751     /* Set the current thread to the timer thread, for caller checking.  */
3752     _tx_thread_current_ptr =  &_tx_timer_thread;
3753 
3754     /* Call the _fxe_file_extended_truncate to cause an error.  */
3755     status =  _fxe_file_extended_truncate(&file_instance, 20);
3756 
3757     /* Set the current thread back to NULL.  */
3758     _tx_thread_current_ptr =  FX_NULL;
3759 
3760     /* Check for the error.  */
3761     if (status != FX_CALLER_ERROR)
3762     {
3763 
3764         /* Increment the failed tests counter.  */
3765         test_control_failed_tests++;
3766 
3767         /* Print error message.  */
3768         printf("Error in checking of fxe_file_extended_truncate!\n");
3769     }
3770 #endif
3771 
3772     /* Restore the system state.  */
3773     _tx_thread_system_state =  saved_system_state;
3774 
3775 
3776     /* Check caller error checking for fx_file_extended_seek.  */
3777 
3778     /* Save the system state.  */
3779     saved_system_state =  _tx_thread_system_state;
3780 
3781     /* Setup the fake media structure.  */
3782     media_instance.fx_media_id =  FX_MEDIA_ID;
3783 
3784     /* Call the _fxe_file_extended_seek to cause an error.  */
3785     status =  _fxe_file_extended_seek(&file_instance, 20);
3786 
3787     /* Check for the error.  */
3788     if (status != FX_CALLER_ERROR)
3789     {
3790 
3791         /* Increment the failed tests counter.  */
3792         test_control_failed_tests++;
3793 
3794         /* Print error message.  */
3795         printf("Error in checking of fxe_file_extended_seek!\n");
3796     }
3797 
3798     /* Clear the system state to simulate an ISR caller.  */
3799     _tx_thread_system_state =  0;
3800 
3801     /* Call the _fxe_file_extended_seek to cause an error.  */
3802     status =  _fxe_file_extended_seek(&file_instance, 20);
3803 
3804     /* Check for the error.  */
3805     if (status != FX_CALLER_ERROR)
3806     {
3807 
3808         /* Increment the failed tests counter.  */
3809         test_control_failed_tests++;
3810 
3811         /* Print error message.  */
3812         printf("Error in checking of fxe_file_extended_seek!\n");
3813     }
3814 
3815 #ifndef TX_TIMER_PROCESS_IN_ISR
3816 
3817     /* Set the current thread to the timer thread, for caller checking.  */
3818     _tx_thread_current_ptr =  &_tx_timer_thread;
3819 
3820     /* Call the _fxe_file_extended_seek to cause an error.  */
3821     status =  _fxe_file_extended_seek(&file_instance, 20);
3822 
3823     /* Set the current thread back to NULL.  */
3824     _tx_thread_current_ptr =  FX_NULL;
3825 
3826     /* Check for the error.  */
3827     if (status != FX_CALLER_ERROR)
3828     {
3829 
3830         /* Increment the failed tests counter.  */
3831         test_control_failed_tests++;
3832 
3833         /* Print error message.  */
3834         printf("Error in checking of fxe_file_extended_seek!\n");
3835     }
3836 #endif
3837 
3838     /* Restore the system state.  */
3839     _tx_thread_system_state =  saved_system_state;
3840 
3841 
3842     /* Check caller error checking for fx_file_extended_relative_seek.  */
3843 
3844     /* Save the system state.  */
3845     saved_system_state =  _tx_thread_system_state;
3846 
3847     /* Setup the fake media structure.  */
3848     media_instance.fx_media_id =  FX_MEDIA_ID;
3849 
3850     /* Call the _fxe_file_extended_relative_seek to cause an error.  */
3851     status =  _fxe_file_extended_relative_seek(&file_instance, 20, FX_SEEK_END);
3852 
3853     /* Check for the error.  */
3854     if (status != FX_CALLER_ERROR)
3855     {
3856 
3857         /* Increment the failed tests counter.  */
3858         test_control_failed_tests++;
3859 
3860         /* Print error message.  */
3861         printf("Error in checking of fxe_file_extended_relative_seek!\n");
3862     }
3863 
3864     /* Clear the system state to simulate an ISR caller.  */
3865     _tx_thread_system_state =  0;
3866 
3867     /* Call the _fxe_file_extended_relative_seek to cause an error.  */
3868     status =  _fxe_file_extended_relative_seek(&file_instance, 20, FX_SEEK_FORWARD);
3869 
3870     /* Check for the error.  */
3871     if (status != FX_CALLER_ERROR)
3872     {
3873 
3874         /* Increment the failed tests counter.  */
3875         test_control_failed_tests++;
3876 
3877         /* Print error message.  */
3878         printf("Error in checking of fxe_file_extended_relative_seek!\n");
3879     }
3880 
3881 #ifndef TX_TIMER_PROCESS_IN_ISR
3882 
3883     /* Set the current thread to the timer thread, for caller checking.  */
3884     _tx_thread_current_ptr =  &_tx_timer_thread;
3885 
3886     /* Call the _fxe_file_extended_relative_seek to cause an error.  */
3887     status =  _fxe_file_extended_relative_seek(&file_instance, 20, FX_SEEK_BEGIN);
3888 
3889     /* Set the current thread back to NULL.  */
3890     _tx_thread_current_ptr =  FX_NULL;
3891 
3892     /* Check for the error.  */
3893     if (status != FX_CALLER_ERROR)
3894     {
3895 
3896         /* Increment the failed tests counter.  */
3897         test_control_failed_tests++;
3898 
3899         /* Print error message.  */
3900         printf("Error in checking of fxe_file_extended_relative_seek!\n");
3901     }
3902 #endif
3903 
3904     /* Restore the system state.  */
3905     _tx_thread_system_state =  saved_system_state;
3906 
3907 
3908     /* Check caller error checking for fx_file_extended_best_effort_allocate.  */
3909 
3910     /* Save the system state.  */
3911     saved_system_state =  _tx_thread_system_state;
3912 
3913     /* Setup the fake media structure.  */
3914     media_instance.fx_media_id =  FX_MEDIA_ID;
3915 
3916     /* Call the _fxe_file_extended_best_effort_allocate with NULL actual size allocated to cause an error.  */
3917     status =  _fxe_file_extended_best_effort_allocate(&file_instance, 20, FX_NULL);
3918 
3919     /* Check for the error.  */
3920     if (status != FX_PTR_ERROR)
3921     {
3922 
3923         /* Increment the failed tests counter.  */
3924         test_control_failed_tests++;
3925 
3926         /* Print error message.  */
3927         printf("Error in checking of fxe_file_extended_best_effort_allocate!\n");
3928     }
3929 
3930     /* Call the _fxe_file_extended_best_effort_allocate to cause an error.  */
3931     status =  _fxe_file_extended_best_effort_allocate(&file_instance, 20, &available_bytes);
3932 
3933     /* Check for the error.  */
3934     if (status != FX_CALLER_ERROR)
3935     {
3936 
3937         /* Increment the failed tests counter.  */
3938         test_control_failed_tests++;
3939 
3940         /* Print error message.  */
3941         printf("Error in checking of fxe_file_extended_best_effort_allocate!\n");
3942     }
3943 
3944     /* Clear the system state to simulate an ISR caller.  */
3945     _tx_thread_system_state =  0;
3946 
3947     /* Call the _fxe_file_extended_best_effort_allocate to cause an error.  */
3948     status =  _fxe_file_extended_best_effort_allocate(&file_instance, 20, &available_bytes);
3949 
3950     /* Check for the error.  */
3951     if (status != FX_CALLER_ERROR)
3952     {
3953 
3954         /* Increment the failed tests counter.  */
3955         test_control_failed_tests++;
3956 
3957         /* Print error message.  */
3958         printf("Error in checking of fxe_file_extended_best_effort_allocate!\n");
3959     }
3960 
3961 #ifndef TX_TIMER_PROCESS_IN_ISR
3962 
3963     /* Set the current thread to the timer thread, for caller checking.  */
3964     _tx_thread_current_ptr =  &_tx_timer_thread;
3965 
3966     /* Call the _fxe_file_extended_best_effort_allocate to cause an error.  */
3967     status =  _fxe_file_extended_best_effort_allocate(&file_instance, 20, &available_bytes);
3968 
3969     /* Set the current thread back to NULL.  */
3970     _tx_thread_current_ptr =  FX_NULL;
3971 
3972     /* Check for the error.  */
3973     if (status != FX_CALLER_ERROR)
3974     {
3975 
3976         /* Increment the failed tests counter.  */
3977         test_control_failed_tests++;
3978 
3979         /* Print error message.  */
3980         printf("Error in checking of fxe_file_extended_best_effort_allocate!\n");
3981     }
3982 #endif
3983 
3984     /* Restore the system state.  */
3985     _tx_thread_system_state =  saved_system_state;
3986 
3987 
3988     /* Check caller error checking for fx_file_extended_allocate.  */
3989 
3990     /* Save the system state.  */
3991     saved_system_state =  _tx_thread_system_state;
3992 
3993     /* Setup the fake media structure.  */
3994     media_instance.fx_media_id =  FX_MEDIA_ID;
3995 
3996     /* Call the _fxe_file_extended_allocate to cause an error.  */
3997     status =  _fxe_file_extended_allocate(&file_instance, 20);
3998 
3999     /* Check for the error.  */
4000     if (status != FX_CALLER_ERROR)
4001     {
4002 
4003         /* Increment the failed tests counter.  */
4004         test_control_failed_tests++;
4005 
4006         /* Print error message.  */
4007         printf("Error in checking of fxe_file_extended_allocate!\n");
4008     }
4009 
4010     /* Clear the system state to simulate an ISR caller.  */
4011     _tx_thread_system_state =  0;
4012 
4013     /* Call the _fxe_file_extended_allocate to cause an error.  */
4014     status =  _fxe_file_extended_allocate(&file_instance, 20);
4015 
4016     /* Check for the error.  */
4017     if (status != FX_CALLER_ERROR)
4018     {
4019 
4020         /* Increment the failed tests counter.  */
4021         test_control_failed_tests++;
4022 
4023         /* Print error message.  */
4024         printf("Error in checking of fxe_file_extended_allocate!\n");
4025     }
4026 
4027 #ifndef TX_TIMER_PROCESS_IN_ISR
4028 
4029     /* Set the current thread to the timer thread, for caller checking.  */
4030     _tx_thread_current_ptr =  &_tx_timer_thread;
4031 
4032     /* Call the _fxe_file_extended_allocate to cause an error.  */
4033     status =  _fxe_file_extended_allocate(&file_instance, 20);
4034 
4035     /* Set the current thread back to NULL.  */
4036     _tx_thread_current_ptr =  FX_NULL;
4037 
4038     /* Check for the error.  */
4039     if (status != FX_CALLER_ERROR)
4040     {
4041 
4042         /* Increment the failed tests counter.  */
4043         test_control_failed_tests++;
4044 
4045         /* Print error message.  */
4046         printf("Error in checking of fxe_file_extended_allocate!\n");
4047     }
4048 #endif
4049 
4050     /* Restore the system state.  */
4051     _tx_thread_system_state =  saved_system_state;
4052 
4053 
4054     /* Check caller error checking for fx_file_delete.  */
4055 
4056     /* Save the system state.  */
4057     saved_system_state =  _tx_thread_system_state;
4058 
4059     /* Setup the fake media structure.  */
4060     media_instance.fx_media_id =  FX_MEDIA_ID;
4061 
4062     /* Call the _fxe_file_delete to cause an error.  */
4063     status =  _fxe_file_delete(&media_instance, "MYFILE");
4064 
4065     /* Check for the error.  */
4066     if (status != FX_CALLER_ERROR)
4067     {
4068 
4069         /* Increment the failed tests counter.  */
4070         test_control_failed_tests++;
4071 
4072         /* Print error message.  */
4073         printf("Error in checking of fxe_file_delete!\n");
4074     }
4075 
4076     /* Clear the system state to simulate an ISR caller.  */
4077     _tx_thread_system_state =  0;
4078 
4079     /* Call the _fxe_file_delete to cause an error.  */
4080     status =  _fxe_file_delete(&media_instance, "MYFILE");
4081 
4082     /* Check for the error.  */
4083     if (status != FX_CALLER_ERROR)
4084     {
4085 
4086         /* Increment the failed tests counter.  */
4087         test_control_failed_tests++;
4088 
4089         /* Print error message.  */
4090         printf("Error in checking of fxe_file_delete!\n");
4091     }
4092 
4093 #ifndef TX_TIMER_PROCESS_IN_ISR
4094 
4095     /* Set the current thread to the timer thread, for caller checking.  */
4096     _tx_thread_current_ptr =  &_tx_timer_thread;
4097 
4098     /* Call the _fxe_file_delete to cause an error.  */
4099     status =  _fxe_file_delete(&media_instance, "MYFILE");
4100 
4101     /* Set the current thread back to NULL.  */
4102     _tx_thread_current_ptr =  FX_NULL;
4103 
4104     /* Check for the error.  */
4105     if (status != FX_CALLER_ERROR)
4106     {
4107 
4108         /* Increment the failed tests counter.  */
4109         test_control_failed_tests++;
4110 
4111         /* Print error message.  */
4112         printf("Error in checking of fxe_file_delete!\n");
4113     }
4114 #endif
4115 
4116     /* Restore the system state.  */
4117     _tx_thread_system_state =  saved_system_state;
4118 
4119 
4120     /* Check caller error checking for fx_file_date_time_set.  */
4121 
4122     /* Save the system state.  */
4123     saved_system_state =  _tx_thread_system_state;
4124 
4125     /* Setup the fake media structure.  */
4126     media_instance.fx_media_id =  FX_MEDIA_ID;
4127 
4128     /* Call the _fxe_file_date_time_set to cause an error.  */
4129     status =  _fxe_file_date_time_set(&media_instance, "TEST.TXT",
4130                 2017, 12, 31, 23, 59, 58);
4131 
4132     /* Check for the error.  */
4133     if (status != FX_CALLER_ERROR)
4134     {
4135 
4136         /* Increment the failed tests counter.  */
4137         test_control_failed_tests++;
4138 
4139         /* Print error message.  */
4140         printf("Error in checking of fxe_file_date_time)set!\n");
4141     }
4142 
4143     /* Clear the system state to simulate an ISR caller.  */
4144     _tx_thread_system_state =  0;
4145 
4146     /* Call the _fxe_file_date_time_set to cause an error.  */
4147     status =  _fxe_file_date_time_set(&media_instance, "TEST.TXT",
4148                 2017, 12, 31, 23, 59, 58);
4149 
4150     /* Check for the error.  */
4151     if (status != FX_CALLER_ERROR)
4152     {
4153 
4154         /* Increment the failed tests counter.  */
4155         test_control_failed_tests++;
4156 
4157         /* Print error message.  */
4158         printf("Error in checking of fxe_file_date_time_set!\n");
4159     }
4160 
4161 #ifndef TX_TIMER_PROCESS_IN_ISR
4162 
4163     /* Set the current thread to the timer thread, for caller checking.  */
4164     _tx_thread_current_ptr =  &_tx_timer_thread;
4165 
4166     /* Call the _fxe_file_date_time_set to cause an error.  */
4167     status =  _fxe_file_date_time_set(&media_instance, "TEST.TXT",
4168                 2017, 12, 31, 23, 59, 58);
4169 
4170     /* Set the current thread back to NULL.  */
4171     _tx_thread_current_ptr =  FX_NULL;
4172 
4173     /* Check for the error.  */
4174     if (status != FX_CALLER_ERROR)
4175     {
4176 
4177         /* Increment the failed tests counter.  */
4178         test_control_failed_tests++;
4179 
4180         /* Print error message.  */
4181         printf("Error in checking of fxe_file_date_time_set!\n");
4182     }
4183 #endif
4184 
4185     /* Restore the system state.  */
4186     _tx_thread_system_state =  saved_system_state;
4187 
4188 
4189     /* Check caller error checking for fx_file_create.  */
4190 
4191     /* Save the system state.  */
4192     saved_system_state =  _tx_thread_system_state;
4193 
4194     /* Setup the fake media structure.  */
4195     media_instance.fx_media_id =  FX_MEDIA_ID;
4196 
4197     /* Call the _fxe_file_create to cause an error.  */
4198     status =  _fxe_file_create(&media_instance, "TEST.TXT");
4199 
4200     /* Check for the error.  */
4201     if (status != FX_CALLER_ERROR)
4202     {
4203 
4204         /* Increment the failed tests counter.  */
4205         test_control_failed_tests++;
4206 
4207         /* Print error message.  */
4208         printf("Error in checking of fxe_file_create!\n");
4209     }
4210 
4211     /* Clear the system state to simulate an ISR caller.  */
4212     _tx_thread_system_state =  0;
4213 
4214     /* Call the _fxe_file_create to cause an error.  */
4215     status =  _fxe_file_create(&media_instance, "TEST.TXT");
4216 
4217     /* Check for the error.  */
4218     if (status != FX_CALLER_ERROR)
4219     {
4220 
4221         /* Increment the failed tests counter.  */
4222         test_control_failed_tests++;
4223 
4224         /* Print error message.  */
4225         printf("Error in checking of fxe_file_create!\n");
4226     }
4227 
4228 #ifndef TX_TIMER_PROCESS_IN_ISR
4229 
4230     /* Set the current thread to the timer thread, for caller checking.  */
4231     _tx_thread_current_ptr =  &_tx_timer_thread;
4232 
4233     /* Call the _fxe_file_create to cause an error.  */
4234     status =  _fxe_file_create(&media_instance, "TEST.TXT");
4235 
4236     /* Set the current thread back to NULL.  */
4237     _tx_thread_current_ptr =  FX_NULL;
4238 
4239     /* Check for the error.  */
4240     if (status != FX_CALLER_ERROR)
4241     {
4242 
4243         /* Increment the failed tests counter.  */
4244         test_control_failed_tests++;
4245 
4246         /* Print error message.  */
4247         printf("Error in checking of fxe_file_create!\n");
4248     }
4249 #endif
4250 
4251     /* Restore the system state.  */
4252     _tx_thread_system_state =  saved_system_state;
4253 
4254 
4255     /* Check caller error checking for fx_file_close.  */
4256 
4257     /* Save the system state.  */
4258     saved_system_state =  _tx_thread_system_state;
4259 
4260     /* Setup the fake media structure.  */
4261     media_instance.fx_media_id =  FX_MEDIA_ID;
4262 
4263     /* Call the _fxe_file_close to cause an error.  */
4264     status =  _fxe_file_close(&file_instance);
4265 
4266     /* Check for the error.  */
4267     if (status != FX_CALLER_ERROR)
4268     {
4269 
4270         /* Increment the failed tests counter.  */
4271         test_control_failed_tests++;
4272 
4273         /* Print error message.  */
4274         printf("Error in checking of fxe_file_close!\n");
4275     }
4276 
4277     /* Clear the system state to simulate an ISR caller.  */
4278     _tx_thread_system_state =  0;
4279 
4280     /* Call the _fxe_file_close to cause an error.  */
4281     status =  _fxe_file_close(&file_instance);
4282 
4283     /* Check for the error.  */
4284     if (status != FX_CALLER_ERROR)
4285     {
4286 
4287         /* Increment the failed tests counter.  */
4288         test_control_failed_tests++;
4289 
4290         /* Print error message.  */
4291         printf("Error in checking of fxe_file_close!\n");
4292     }
4293 
4294 #ifndef TX_TIMER_PROCESS_IN_ISR
4295 
4296     /* Set the current thread to the timer thread, for caller checking.  */
4297     _tx_thread_current_ptr =  &_tx_timer_thread;
4298 
4299     /* Call the _fxe_file_close to cause an error.  */
4300     status =  _fxe_file_close(&file_instance);
4301 
4302     /* Set the current thread back to NULL.  */
4303     _tx_thread_current_ptr =  FX_NULL;
4304 
4305     /* Check for the error.  */
4306     if (status != FX_CALLER_ERROR)
4307     {
4308 
4309         /* Increment the failed tests counter.  */
4310         test_control_failed_tests++;
4311 
4312         /* Print error message.  */
4313         printf("Error in checking of fxe_file_close!\n");
4314     }
4315 #endif
4316 
4317     /* Restore the system state.  */
4318     _tx_thread_system_state =  saved_system_state;
4319 
4320 
4321     /* Check caller error checking for fx_file_best_effort_allocate.  */
4322 
4323     /* Save the system state.  */
4324     saved_system_state =  _tx_thread_system_state;
4325 
4326     /* Setup the fake media structure.  */
4327     media_instance.fx_media_id =  FX_MEDIA_ID;
4328 
4329     /* Call the _fxe_file_best_effort_allocate with a NULL actual_size_allocated to cause an error.  */
4330     status =  _fxe_file_best_effort_allocate(&file_instance, 20, FX_NULL);
4331 
4332     /* Check for the error.  */
4333     if (status != FX_PTR_ERROR)
4334     {
4335 
4336         /* Increment the failed tests counter.  */
4337         test_control_failed_tests++;
4338 
4339         /* Print error message.  */
4340         printf("Error in checking of fxe_file_best_effort_allocate!\n");
4341     }
4342 
4343     /* Call the _fxe_file_best_effort_allocate to cause an error.  */
4344     status =  _fxe_file_best_effort_allocate(&file_instance, 20, &temp);
4345 
4346     /* Check for the error.  */
4347     if (status != FX_CALLER_ERROR)
4348     {
4349 
4350         /* Increment the failed tests counter.  */
4351         test_control_failed_tests++;
4352 
4353         /* Print error message.  */
4354         printf("Error in checking of fxe_file_best_effort_allocate!\n");
4355     }
4356 
4357     /* Clear the system state to simulate an ISR caller.  */
4358     _tx_thread_system_state =  0;
4359 
4360     /* Call the _fxe_file_best_effort_allocate to cause an error.  */
4361     status =  _fxe_file_best_effort_allocate(&file_instance, 20, &temp);
4362 
4363     /* Check for the error.  */
4364     if (status != FX_CALLER_ERROR)
4365     {
4366 
4367         /* Increment the failed tests counter.  */
4368         test_control_failed_tests++;
4369 
4370         /* Print error message.  */
4371         printf("Error in checking of fxe_file_best_effort_allocate!\n");
4372     }
4373 
4374 #ifndef TX_TIMER_PROCESS_IN_ISR
4375 
4376     /* Set the current thread to the timer thread, for caller checking.  */
4377     _tx_thread_current_ptr =  &_tx_timer_thread;
4378 
4379     /* Call the _fxe_file_best_effort_allocate to cause an error.  */
4380     status =  _fxe_file_best_effort_allocate(&file_instance, 20, &temp);
4381 
4382     /* Set the current thread back to NULL.  */
4383     _tx_thread_current_ptr =  FX_NULL;
4384 
4385     /* Check for the error.  */
4386     if (status != FX_CALLER_ERROR)
4387     {
4388 
4389         /* Increment the failed tests counter.  */
4390         test_control_failed_tests++;
4391 
4392         /* Print error message.  */
4393         printf("Error in checking of fxe_file_best_effort_allocate!\n");
4394     }
4395 #endif
4396 
4397     /* Restore the system state.  */
4398     _tx_thread_system_state =  saved_system_state;
4399 
4400 
4401     /* Check caller error checking for fx_file_attributes_set.  */
4402 
4403     /* Save the system state.  */
4404     saved_system_state =  _tx_thread_system_state;
4405 
4406     /* Setup the fake media structure.  */
4407     media_instance.fx_media_id =  FX_MEDIA_ID;
4408 
4409     /* Call the _fxe_file_attributes_set to cause an error.  */
4410     status =  _fxe_file_attributes_set(&media_instance, "TEST.TXT", FX_READ_ONLY);
4411 
4412     /* Check for the error.  */
4413     if (status != FX_CALLER_ERROR)
4414     {
4415 
4416         /* Increment the failed tests counter.  */
4417         test_control_failed_tests++;
4418 
4419         /* Print error message.  */
4420         printf("Error in checking of fxe_file_attributes_set!\n");
4421     }
4422 
4423     /* Clear the system state to simulate an ISR caller.  */
4424     _tx_thread_system_state =  0;
4425 
4426     /* Call the _fxe_file_attributes_set to cause an error.  */
4427     status =  _fxe_file_attributes_set(&media_instance, "TEST.TXT", FX_READ_ONLY);
4428 
4429     /* Check for the error.  */
4430     if (status != FX_CALLER_ERROR)
4431     {
4432 
4433         /* Increment the failed tests counter.  */
4434         test_control_failed_tests++;
4435 
4436         /* Print error message.  */
4437         printf("Error in checking of fxe_file_attributes_set!\n");
4438     }
4439 
4440 #ifndef TX_TIMER_PROCESS_IN_ISR
4441 
4442     /* Set the current thread to the timer thread, for caller checking.  */
4443     _tx_thread_current_ptr =  &_tx_timer_thread;
4444 
4445     /* Call the _fxe_file_attributes_set to cause an error.  */
4446     status =  _fxe_file_attributes_set(&media_instance, "TEST.TXT", FX_READ_ONLY);
4447 
4448     /* Set the current thread back to NULL.  */
4449     _tx_thread_current_ptr =  FX_NULL;
4450 
4451     /* Check for the error.  */
4452     if (status != FX_CALLER_ERROR)
4453     {
4454 
4455         /* Increment the failed tests counter.  */
4456         test_control_failed_tests++;
4457 
4458         /* Print error message.  */
4459         printf("Error in checking of fxe_file_attributes_set!\n");
4460     }
4461 #endif
4462 
4463     /* Restore the system state.  */
4464     _tx_thread_system_state =  saved_system_state;
4465 
4466 
4467     /* Check caller error checking for fx_file_attributes_read.  */
4468 
4469     /* Save the system state.  */
4470     saved_system_state =  _tx_thread_system_state;
4471 
4472     /* Setup the fake media structure.  */
4473     media_instance.fx_media_id =  FX_MEDIA_ID;
4474 
4475     /* Call the _fxe_file_attributes_read with NULL attributes variable to cause an error.  */
4476     status =  _fxe_file_attributes_read(&media_instance, "TEST.TXT", FX_NULL);
4477 
4478     /* Check for the error.  */
4479     if (status != FX_PTR_ERROR)
4480     {
4481 
4482         /* Increment the failed tests counter.  */
4483         test_control_failed_tests++;
4484 
4485         /* Print error message.  */
4486         printf("Error in checking of fxe_file_attributes_read!\n");
4487     }
4488 
4489     /* Call the _fxe_file_attributes_read to cause an error.  */
4490     status =  _fxe_file_attributes_read(&media_instance, "TEST.TXT", &attributes);
4491 
4492     /* Check for the error.  */
4493     if (status != FX_CALLER_ERROR)
4494     {
4495 
4496         /* Increment the failed tests counter.  */
4497         test_control_failed_tests++;
4498 
4499         /* Print error message.  */
4500         printf("Error in checking of fxe_file_attributes_read!\n");
4501     }
4502 
4503     /* Clear the system state to simulate an ISR caller.  */
4504     _tx_thread_system_state =  0;
4505 
4506     /* Call the _fxe_file_attributes_read to cause an error.  */
4507     status =  _fxe_file_attributes_read(&media_instance, "TEST.TXT", &attributes);
4508 
4509     /* Check for the error.  */
4510     if (status != FX_CALLER_ERROR)
4511     {
4512 
4513         /* Increment the failed tests counter.  */
4514         test_control_failed_tests++;
4515 
4516         /* Print error message.  */
4517         printf("Error in checking of fxe_file_attributes_read!\n");
4518     }
4519 
4520 #ifndef TX_TIMER_PROCESS_IN_ISR
4521 
4522     /* Set the current thread to the timer thread, for caller checking.  */
4523     _tx_thread_current_ptr =  &_tx_timer_thread;
4524 
4525     /* Call the _fxe_file_attributes_read to cause an error.  */
4526     status =  _fxe_file_attributes_read(&media_instance, "TEST.TXT", &attributes);
4527 
4528     /* Set the current thread back to NULL.  */
4529     _tx_thread_current_ptr =  FX_NULL;
4530 
4531     /* Check for the error.  */
4532     if (status != FX_CALLER_ERROR)
4533     {
4534 
4535         /* Increment the failed tests counter.  */
4536         test_control_failed_tests++;
4537 
4538         /* Print error message.  */
4539         printf("Error in checking of fxe_file_attributes_read!\n");
4540     }
4541 #endif
4542 
4543     /* Restore the system state.  */
4544     _tx_thread_system_state =  saved_system_state;
4545 
4546 
4547     /* Check caller error checking for fx_file_allocate.  */
4548 
4549     /* Save the system state.  */
4550     saved_system_state =  _tx_thread_system_state;
4551 
4552     /* Setup the fake media structure.  */
4553     media_instance.fx_media_id =  FX_MEDIA_ID;
4554 
4555     /* Call the _fxe_file_allocate to cause an error.  */
4556     status =  _fxe_file_allocate(&file_instance, 20);
4557 
4558     /* Check for the error.  */
4559     if (status != FX_CALLER_ERROR)
4560     {
4561 
4562         /* Increment the failed tests counter.  */
4563         test_control_failed_tests++;
4564 
4565         /* Print error message.  */
4566         printf("Error in checking of fxe_file_allocate!\n");
4567     }
4568 
4569     /* Clear the system state to simulate an ISR caller.  */
4570     _tx_thread_system_state =  0;
4571 
4572     /* Call the _fxe_file_allocate to cause an error.  */
4573     status =  _fxe_file_allocate(&file_instance, 20);
4574 
4575     /* Check for the error.  */
4576     if (status != FX_CALLER_ERROR)
4577     {
4578 
4579         /* Increment the failed tests counter.  */
4580         test_control_failed_tests++;
4581 
4582         /* Print error message.  */
4583         printf("Error in checking of fxe_file_allocate!\n");
4584     }
4585 
4586 #ifndef TX_TIMER_PROCESS_IN_ISR
4587 
4588     /* Set the current thread to the timer thread, for caller checking.  */
4589     _tx_thread_current_ptr =  &_tx_timer_thread;
4590 
4591     /* Call the _fxe_file_allocate to cause an error.  */
4592     status =  _fxe_file_allocate(&file_instance, 20);
4593 
4594     /* Set the current thread back to NULL.  */
4595     _tx_thread_current_ptr =  FX_NULL;
4596 
4597     /* Check for the error.  */
4598     if (status != FX_CALLER_ERROR)
4599     {
4600 
4601         /* Increment the failed tests counter.  */
4602         test_control_failed_tests++;
4603 
4604         /* Print error message.  */
4605         printf("Error in checking of fxe_file_allocate!\n");
4606     }
4607 #endif
4608 
4609     /* Restore the system state.  */
4610     _tx_thread_system_state =  saved_system_state;
4611 
4612 
4613     /* Check caller error checking for fx_directory_short_name_get.  */
4614 
4615     /* Save the system state.  */
4616     saved_system_state =  _tx_thread_system_state;
4617 
4618     /* Setup the fake media structure.  */
4619     media_instance.fx_media_id =  FX_MEDIA_ID;
4620 
4621     /* Call the _fxe_directory_short_name_get with NULL long file name to cause an error.  */
4622     status =  _fxe_directory_short_name_get(&media_instance, FX_NULL, "SHORT");
4623 
4624     /* Check for the error.  */
4625     if (status != FX_PTR_ERROR)
4626     {
4627 
4628         /* Increment the failed tests counter.  */
4629         test_control_failed_tests++;
4630 
4631         /* Print error message.  */
4632         printf("Error in checking of fxe_directory_short_name_get!\n");
4633     }
4634 
4635     /* Call the _fxe_directory_short_name_get_extended with NULL long file name to cause an error.  */
4636     status = _fxe_directory_short_name_get_extended(&media_instance, FX_NULL, "SHORT", 0);
4637 
4638     /* Check for the error.  */
4639     if (status != FX_PTR_ERROR)
4640     {
4641 
4642         /* Increment the failed tests counter.  */
4643         test_control_failed_tests++;
4644 
4645         /* Print error message.  */
4646         printf("Error in checking of fxe_directory_short_name_get_extended!\n");
4647     }
4648 
4649     /* Call the _fxe_directory_short_name_get with NULL short name to cause an error.  */
4650     status =  _fxe_directory_short_name_get(&media_instance, "LONGNAME", FX_NULL);
4651 
4652     /* Check for the error.  */
4653     if (status != FX_PTR_ERROR)
4654     {
4655 
4656         /* Increment the failed tests counter.  */
4657         test_control_failed_tests++;
4658 
4659         /* Print error message.  */
4660         printf("Error in checking of fxe_directory_short_name_get!\n");
4661     }
4662 
4663     /* Call the _fxe_directory_short_name_get_extended with NULL short name to cause an error.  */
4664     status = _fxe_directory_short_name_get_extended(&media_instance, "LONGNAME", FX_NULL, 0);
4665 
4666     /* Check for the error.  */
4667     if (status != FX_PTR_ERROR)
4668     {
4669 
4670         /* Increment the failed tests counter.  */
4671         test_control_failed_tests++;
4672 
4673         /* Print error message.  */
4674         printf("Error in checking of fxe_directory_short_name_get_extended!\n");
4675     }
4676 
4677     /* Call the _fxe_directory_short_name_get_extended with NULL short name to cause an error.  */
4678     status = _fxe_directory_short_name_get_extended(&media_instance, "LONGNAME", "SHORT", 0);
4679 
4680     /* Check for the error.  */
4681     if (status != FX_BUFFER_ERROR)
4682     {
4683 
4684         /* Increment the failed tests counter.  */
4685         test_control_failed_tests++;
4686 
4687         /* Print error message.  */
4688         printf("Error in checking of fxe_directory_short_name_get_extended!\n");
4689     }
4690 
4691     /* Call the _fxe_directory_short_name_get to cause an error.  */
4692     status =  _fxe_directory_short_name_get(&media_instance, "LONGNAME", "SHORT");
4693 
4694     /* Check for the error.  */
4695     if (status != FX_CALLER_ERROR)
4696     {
4697 
4698         /* Increment the failed tests counter.  */
4699         test_control_failed_tests++;
4700 
4701         /* Print error message.  */
4702         printf("Error in checking of fxe_directory_short_name_get!\n");
4703     }
4704 
4705     /* Call the _fxe_directory_short_name_get_extended to cause an error.  */
4706     status = _fxe_directory_short_name_get_extended(&media_instance, "LONGNAME", "SHORT", 1);
4707 
4708     /* Check for the error.  */
4709     if (status != FX_CALLER_ERROR)
4710     {
4711 
4712         /* Increment the failed tests counter.  */
4713         test_control_failed_tests++;
4714 
4715         /* Print error message.  */
4716         printf("Error in checking of fxe_directory_short_name_get_extended!\n");
4717     }
4718 
4719     /* Clear the system state to simulate an ISR caller.  */
4720     _tx_thread_system_state =  0;
4721 
4722     /* Call the _fxe_directory_short_name_get to cause an error.  */
4723     status =  _fxe_directory_short_name_get(&media_instance, "LONGNAME", "SHORT");
4724 
4725     /* Check for the error.  */
4726     if (status != FX_CALLER_ERROR)
4727     {
4728 
4729         /* Increment the failed tests counter.  */
4730         test_control_failed_tests++;
4731 
4732         /* Print error message.  */
4733         printf("Error in checking of fxe_directory_short_name_get!\n");
4734     }
4735 
4736     /* Call the _fxe_directory_short_name_get_extended to cause an error.  */
4737     status = _fxe_directory_short_name_get_extended(&media_instance, "LONGNAME", "SHORT", 1);
4738 
4739     /* Check for the error.  */
4740     if (status != FX_CALLER_ERROR)
4741     {
4742 
4743         /* Increment the failed tests counter.  */
4744         test_control_failed_tests++;
4745 
4746         /* Print error message.  */
4747         printf("Error in checking of fxe_directory_short_name_get_extended!\n");
4748     }
4749 
4750 #ifndef TX_TIMER_PROCESS_IN_ISR
4751 
4752     /* Set the current thread to the timer thread, for caller checking.  */
4753     _tx_thread_current_ptr =  &_tx_timer_thread;
4754 
4755     /* Call the _fxe_directory_short_name_get to cause an error.  */
4756     status =  _fxe_directory_short_name_get(&media_instance, "LONGNAME", "SHORT");
4757 
4758     /* Set the current thread back to NULL.  */
4759     _tx_thread_current_ptr =  FX_NULL;
4760 
4761     /* Check for the error.  */
4762     if (status != FX_CALLER_ERROR)
4763     {
4764 
4765         /* Increment the failed tests counter.  */
4766         test_control_failed_tests++;
4767 
4768         /* Print error message.  */
4769         printf("Error in checking of fxe_directory_short_name_get!\n");
4770     }
4771 
4772     /* Set the current thread to the timer thread, for caller checking.  */
4773     _tx_thread_current_ptr =  &_tx_timer_thread;
4774 
4775     /* Call the _fxe_directory_short_name_get_extended to cause an error.  */
4776     status =  _fxe_directory_short_name_get_extended(&media_instance, "LONGNAME", "SHORT", 1);
4777 
4778     /* Set the current thread back to NULL.  */
4779     _tx_thread_current_ptr =  FX_NULL;
4780 
4781     /* Check for the error.  */
4782     if (status != FX_CALLER_ERROR)
4783     {
4784 
4785         /* Increment the failed tests counter.  */
4786         test_control_failed_tests++;
4787 
4788         /* Print error message.  */
4789         printf("Error in checking of fxe_directory_short_name_get_extended!\n");
4790     }
4791 #endif
4792 
4793     /* Restore the system state.  */
4794     _tx_thread_system_state =  saved_system_state;
4795 
4796 
4797     /* Check caller error checking for fx_directory_rename.  */
4798 
4799     /* Save the system state.  */
4800     saved_system_state =  _tx_thread_system_state;
4801 
4802     /* Setup the fake media structure.  */
4803     media_instance.fx_media_id =  FX_MEDIA_ID;
4804 
4805     /* Call the _fxe_directory_rename to cause an error.  */
4806     status =  _fxe_directory_rename(&media_instance, "LONGNAME", "SHORT");
4807 
4808     /* Check for the error.  */
4809     if (status != FX_CALLER_ERROR)
4810     {
4811 
4812         /* Increment the failed tests counter.  */
4813         test_control_failed_tests++;
4814 
4815         /* Print error message.  */
4816         printf("Error in checking of fxe_directory_rename!\n");
4817     }
4818 
4819     /* Clear the system state to simulate an ISR caller.  */
4820     _tx_thread_system_state =  0;
4821 
4822     /* Call the _fxe_directory_rename to cause an error.  */
4823     status =  _fxe_directory_rename(&media_instance, "LONGNAME", "SHORT");
4824 
4825     /* Check for the error.  */
4826     if (status != FX_CALLER_ERROR)
4827     {
4828 
4829         /* Increment the failed tests counter.  */
4830         test_control_failed_tests++;
4831 
4832         /* Print error message.  */
4833         printf("Error in checking of fxe_directory_rename!\n");
4834     }
4835 
4836 #ifndef TX_TIMER_PROCESS_IN_ISR
4837 
4838     /* Set the current thread to the timer thread, for caller checking.  */
4839     _tx_thread_current_ptr =  &_tx_timer_thread;
4840 
4841     /* Call the _fxe_directory_rename to cause an error.  */
4842     status =  _fxe_directory_rename(&media_instance, "LONGNAME", "SHORT");
4843 
4844     /* Set the current thread back to NULL.  */
4845     _tx_thread_current_ptr =  FX_NULL;
4846 
4847     /* Check for the error.  */
4848     if (status != FX_CALLER_ERROR)
4849     {
4850 
4851         /* Increment the failed tests counter.  */
4852         test_control_failed_tests++;
4853 
4854         /* Print error message.  */
4855         printf("Error in checking of fxe_directory_rename!\n");
4856     }
4857 #endif
4858 
4859     /* Restore the system state.  */
4860     _tx_thread_system_state =  saved_system_state;
4861 
4862 
4863     /* Check caller error checking for fx_directory_next_full_entry_find.  */
4864 
4865     /* Save the system state.  */
4866     saved_system_state =  _tx_thread_system_state;
4867 
4868     /* Setup the fake media structure.  */
4869     media_instance.fx_media_id =  FX_MEDIA_ID;
4870 
4871     /* Call the _fxe_directory_next_full_entry_find to cause an error.  */
4872     status =  _fxe_directory_next_full_entry_find(&media_instance, FX_NULL, FX_NULL, FX_NULL,
4873                                                                    FX_NULL, FX_NULL, FX_NULL,
4874                                                                    FX_NULL, FX_NULL, FX_NULL);
4875 
4876     /* Check for the error.  */
4877     if (status != FX_CALLER_ERROR)
4878     {
4879 
4880         /* Increment the failed tests counter.  */
4881         test_control_failed_tests++;
4882 
4883         /* Print error message.  */
4884         printf("Error in checking of fxe_directory_next_full_entry_find!\n");
4885     }
4886 
4887     /* Clear the system state to simulate an ISR caller.  */
4888     _tx_thread_system_state =  0;
4889 
4890     /* Call the _fxe_directory_next_full_entry_find to cause an error.  */
4891     status =  _fxe_directory_next_full_entry_find(&media_instance, FX_NULL, FX_NULL, FX_NULL,
4892                                                                    FX_NULL, FX_NULL, FX_NULL,
4893                                                                    FX_NULL, FX_NULL, FX_NULL);
4894 
4895     /* Check for the error.  */
4896     if (status != FX_CALLER_ERROR)
4897     {
4898 
4899         /* Increment the failed tests counter.  */
4900         test_control_failed_tests++;
4901 
4902         /* Print error message.  */
4903         printf("Error in checking of fxe_directory_next_full_entry_find!\n");
4904     }
4905 
4906 #ifndef TX_TIMER_PROCESS_IN_ISR
4907 
4908     /* Set the current thread to the timer thread, for caller checking.  */
4909     _tx_thread_current_ptr =  &_tx_timer_thread;
4910 
4911     /* Call the _fxe_directory_next_full_entry_find to cause an error.  */
4912     status =  _fxe_directory_next_full_entry_find(&media_instance, FX_NULL, FX_NULL, FX_NULL,
4913                                                                    FX_NULL, FX_NULL, FX_NULL,
4914                                                                    FX_NULL, FX_NULL, FX_NULL);
4915 
4916     /* Set the current thread back to NULL.  */
4917     _tx_thread_current_ptr =  FX_NULL;
4918 
4919     /* Check for the error.  */
4920     if (status != FX_CALLER_ERROR)
4921     {
4922 
4923         /* Increment the failed tests counter.  */
4924         test_control_failed_tests++;
4925 
4926         /* Print error message.  */
4927         printf("Error in checking of fxe_directory_next_full_entry_find!\n");
4928     }
4929 #endif
4930 
4931     /* Restore the system state.  */
4932     _tx_thread_system_state =  saved_system_state;
4933 
4934 
4935     /* Check caller error checking for fx_directory_next_entry_find.  */
4936 
4937     /* Save the system state.  */
4938     saved_system_state =  _tx_thread_system_state;
4939 
4940     /* Setup the fake media structure.  */
4941     media_instance.fx_media_id =  FX_MEDIA_ID;
4942 
4943     /* Call the _fxe_directory_next_entry_find to cause an error.  */
4944     status =  _fxe_directory_next_entry_find(&media_instance, FX_NULL);
4945 
4946     /* Check for the error.  */
4947     if (status != FX_CALLER_ERROR)
4948     {
4949 
4950         /* Increment the failed tests counter.  */
4951         test_control_failed_tests++;
4952 
4953         /* Print error message.  */
4954         printf("Error in checking of fxe_directory_next_entry_find!\n");
4955     }
4956 
4957     /* Clear the system state to simulate an ISR caller.  */
4958     _tx_thread_system_state =  0;
4959 
4960     /* Call the _fxe_directory_next_entry_find to cause an error.  */
4961     status =  _fxe_directory_next_entry_find(&media_instance, FX_NULL);
4962 
4963     /* Check for the error.  */
4964     if (status != FX_CALLER_ERROR)
4965     {
4966 
4967         /* Increment the failed tests counter.  */
4968         test_control_failed_tests++;
4969 
4970         /* Print error message.  */
4971         printf("Error in checking of fxe_directory_next_entry_find!\n");
4972     }
4973 
4974 #ifndef TX_TIMER_PROCESS_IN_ISR
4975 
4976     /* Set the current thread to the timer thread, for caller checking.  */
4977     _tx_thread_current_ptr =  &_tx_timer_thread;
4978 
4979     /* Call the _fxe_directory_next_entry_find to cause an error.  */
4980     status =  _fxe_directory_next_entry_find(&media_instance, FX_NULL);
4981 
4982     /* Set the current thread back to NULL.  */
4983     _tx_thread_current_ptr =  FX_NULL;
4984 
4985     /* Check for the error.  */
4986     if (status != FX_CALLER_ERROR)
4987     {
4988 
4989         /* Increment the failed tests counter.  */
4990         test_control_failed_tests++;
4991 
4992         /* Print error message.  */
4993         printf("Error in checking of fxe_directory_next_entry_find!\n");
4994     }
4995 #endif
4996 
4997     /* Restore the system state.  */
4998     _tx_thread_system_state =  saved_system_state;
4999 
5000 
5001     /* Check caller error checking for fx_directory_name_test.  */
5002 
5003     /* Save the system state.  */
5004     saved_system_state =  _tx_thread_system_state;
5005 
5006     /* Setup the fake media structure.  */
5007     media_instance.fx_media_id =  FX_MEDIA_ID;
5008 
5009     /* Call the _fxe_directory_name_test to cause an error.  */
5010     status =  _fxe_directory_name_test(&media_instance, "DIRNAME");
5011 
5012     /* Check for the error.  */
5013     if (status != FX_CALLER_ERROR)
5014     {
5015 
5016         /* Increment the failed tests counter.  */
5017         test_control_failed_tests++;
5018 
5019         /* Print error message.  */
5020         printf("Error in checking of fxe_directory_name_test!\n");
5021     }
5022 
5023     /* Clear the system state to simulate an ISR caller.  */
5024     _tx_thread_system_state =  0;
5025 
5026     /* Call the _fxe_directory_name_test to cause an error.  */
5027     status =  _fxe_directory_name_test(&media_instance, "DIRNAME");
5028 
5029     /* Check for the error.  */
5030     if (status != FX_CALLER_ERROR)
5031     {
5032 
5033         /* Increment the failed tests counter.  */
5034         test_control_failed_tests++;
5035 
5036         /* Print error message.  */
5037         printf("Error in checking of fxe_directory_name_test!\n");
5038     }
5039 
5040 #ifndef TX_TIMER_PROCESS_IN_ISR
5041 
5042     /* Set the current thread to the timer thread, for caller checking.  */
5043     _tx_thread_current_ptr =  &_tx_timer_thread;
5044 
5045     /* Call the _fxe_directory_name_test to cause an error.  */
5046     status =  _fxe_directory_name_test(&media_instance, "DIRNAME");
5047 
5048     /* Set the current thread back to NULL.  */
5049     _tx_thread_current_ptr =  FX_NULL;
5050 
5051     /* Check for the error.  */
5052     if (status != FX_CALLER_ERROR)
5053     {
5054 
5055         /* Increment the failed tests counter.  */
5056         test_control_failed_tests++;
5057 
5058         /* Print error message.  */
5059         printf("Error in checking of fxe_directory_name_test!\n");
5060     }
5061 #endif
5062 
5063     /* Restore the system state.  */
5064     _tx_thread_system_state =  saved_system_state;
5065 
5066 
5067     /* Check caller error checking for fx_directory_long_name_get.  */
5068 
5069     /* Save the system state.  */
5070     saved_system_state =  _tx_thread_system_state;
5071 
5072     /* Setup the fake media structure.  */
5073     media_instance.fx_media_id =  FX_MEDIA_ID;
5074 
5075     /* Call the _fxe_directory_long_name_get with NULL short name to cause an error.  */
5076     status =  _fxe_directory_long_name_get(&media_instance, FX_NULL, "LONGNAME");
5077 
5078     /* Check for the error.  */
5079     if (status != FX_PTR_ERROR)
5080     {
5081 
5082         /* Increment the failed tests counter.  */
5083         test_control_failed_tests++;
5084 
5085         /* Print error message.  */
5086         printf("Error in checking of fxe_directory_long_name_get!\n");
5087     }
5088 
5089     /* Call the _fxe_directory_long_name_get_extended with NULL short name to cause an error.  */
5090     status = _fxe_directory_long_name_get_extended(&media_instance, FX_NULL, "LONGNAME", 0);
5091 
5092     /* Check for the error.  */
5093     if (status != FX_PTR_ERROR)
5094     {
5095 
5096         /* Increment the failed tests counter.  */
5097         test_control_failed_tests++;
5098 
5099         /* Print error message.  */
5100         printf("Error in checking of fxe_directory_long_name_get_extended!\n");
5101     }
5102 
5103     /* Call the _fxe_directory_long_name_get with NULL long name to cause an error.  */
5104     status =  _fxe_directory_long_name_get(&media_instance, "SHORTNAME", FX_NULL);
5105 
5106     /* Check for the error.  */
5107     if (status != FX_PTR_ERROR)
5108     {
5109 
5110         /* Increment the failed tests counter.  */
5111         test_control_failed_tests++;
5112 
5113         /* Print error message.  */
5114         printf("Error in checking of fxe_directory_long_name_get!\n");
5115     }
5116 
5117     /* Call the _fxe_directory_long_name_get_extended with NULL long name to cause an error.  */
5118     status = _fxe_directory_long_name_get_extended(&media_instance, "SHORTNAME", FX_NULL, 0);
5119 
5120     /* Check for the error.  */
5121     if (status != FX_PTR_ERROR)
5122     {
5123 
5124         /* Increment the failed tests counter.  */
5125         test_control_failed_tests++;
5126 
5127         /* Print error message.  */
5128         printf("Error in checking of fxe_directory_long_name_get_extended!\n");
5129     }
5130 
5131     /* Call the _fxe_directory_long_name_get_extended with zero long name buffer length to cause an error.  */
5132     status = _fxe_directory_long_name_get_extended(&media_instance, "SHORTNAME", "LONGNAME", 0);
5133 
5134     /* Check for the error.  */
5135     if (status != FX_BUFFER_ERROR)
5136     {
5137 
5138         /* Increment the failed tests counter.  */
5139         test_control_failed_tests++;
5140 
5141         /* Print error message.  */
5142         printf("Error in checking of fxe_directory_long_name_get_extended!\n");
5143     }
5144 
5145     /* Call the _fxe_directory_long_name_get to cause an error.  */
5146     status =  _fxe_directory_long_name_get(&media_instance, "SHORTNAME", "LONGNAME");
5147 
5148     /* Check for the error.  */
5149     if (status != FX_CALLER_ERROR)
5150     {
5151 
5152         /* Increment the failed tests counter.  */
5153         test_control_failed_tests++;
5154 
5155         /* Print error message.  */
5156         printf("Error in checking of fxe_directory_long_name_get!\n");
5157     }
5158 
5159     /* Call the _fxe_directory_long_name_get_extended to cause an error.  */
5160     status = _fxe_directory_long_name_get_extended(&media_instance, "SHORTNAME", "LONGNAME", 1);
5161 
5162     /* Check for the error.  */
5163     if (status != FX_CALLER_ERROR)
5164     {
5165 
5166         /* Increment the failed tests counter.  */
5167         test_control_failed_tests++;
5168 
5169         /* Print error message.  */
5170         printf("Error in checking of fxe_directory_long_name_get_extended!\n");
5171     }
5172 
5173     /* Clear the system state to simulate an ISR caller.  */
5174     _tx_thread_system_state =  0;
5175 
5176     /* Call the _fxe_directory_long_name_get to cause an error.  */
5177     status =  _fxe_directory_long_name_get(&media_instance, "SHORTNAME", "LONGNAME");
5178 
5179     /* Check for the error.  */
5180     if (status != FX_CALLER_ERROR)
5181     {
5182 
5183         /* Increment the failed tests counter.  */
5184         test_control_failed_tests++;
5185 
5186         /* Print error message.  */
5187         printf("Error in checking of fxe_directory_long_name_get!\n");
5188     }
5189 
5190     /* Call the _fxe_directory_long_name_get_extended to cause an error.  */
5191     status = _fxe_directory_long_name_get_extended(&media_instance, "SHORTNAME", "LONGNAME", 1);
5192 
5193     /* Check for the error.  */
5194     if (status != FX_CALLER_ERROR)
5195     {
5196 
5197         /* Increment the failed tests counter.  */
5198         test_control_failed_tests++;
5199 
5200         /* Print error message.  */
5201         printf("Error in checking of fxe_directory_long_name_get_extended!\n");
5202     }
5203 
5204 #ifndef TX_TIMER_PROCESS_IN_ISR
5205 
5206     /* Set the current thread to the timer thread, for caller checking.  */
5207     _tx_thread_current_ptr =  &_tx_timer_thread;
5208 
5209     /* Call the _fxe_directory_long_name_get to cause an error.  */
5210     status =  _fxe_directory_long_name_get(&media_instance, "SHORTNAME", "LONGNAME");
5211 
5212     /* Set the current thread back to NULL.  */
5213     _tx_thread_current_ptr =  FX_NULL;
5214 
5215     /* Check for the error.  */
5216     if (status != FX_CALLER_ERROR)
5217     {
5218 
5219         /* Increment the failed tests counter.  */
5220         test_control_failed_tests++;
5221 
5222         /* Print error message.  */
5223         printf("Error in checking of fxe_directory_long_name_get!\n");
5224     }
5225 
5226     /* Set the current thread to the timer thread, for caller checking.  */
5227     _tx_thread_current_ptr = &_tx_timer_thread;
5228 
5229     /* Call the _fxe_directory_long_name_get_extended to cause an error.  */
5230     status = _fxe_directory_long_name_get_extended(&media_instance, "SHORTNAME", "LONGNAME", 1);
5231 
5232     /* Set the current thread back to NULL.  */
5233     _tx_thread_current_ptr = FX_NULL;
5234 
5235     /* Check for the error.  */
5236     if (status != FX_CALLER_ERROR)
5237     {
5238 
5239         /* Increment the failed tests counter.  */
5240         test_control_failed_tests++;
5241 
5242         /* Print error message.  */
5243         printf("Error in checking of fxe_directory_long_name_get_extended!\n");
5244     }
5245 #endif
5246 
5247     /* media_ptr is NULL. */
5248     status = _fxe_directory_local_path_get(FX_NULL, FX_NULL);
5249 
5250     /* Check for the error.  */
5251     if (status != FX_PTR_ERROR)
5252     {
5253 
5254         /* Increment the failed tests counter.  */
5255         test_control_failed_tests++;
5256 
5257         /* Print error message.  */
5258         printf("Error in checking of fxe_directory_local_path_get!\n");
5259     }
5260 
5261     /* return_path_name is NULL. */
5262     status = _fxe_directory_local_path_get(&media_instance, FX_NULL);
5263 
5264     /* Check for the error.  */
5265     if (status != FX_PTR_ERROR)
5266     {
5267 
5268         /* Increment the failed tests counter.  */
5269         test_control_failed_tests++;
5270 
5271         /* Print error message.  */
5272         printf("Error in checking of fxe_directory_local_path_get!\n");
5273     }
5274 
5275     /* Restore the system state.  */
5276     _tx_thread_system_state =  saved_system_state;
5277 
5278 
5279     /* Check caller error checking for fx_directory_local_path_set.  */
5280 
5281     /* Save the system state.  */
5282     saved_system_state =  _tx_thread_system_state;
5283 
5284     /* Setup the fake media structure.  */
5285     media_instance.fx_media_id =  FX_MEDIA_ID;
5286 
5287     /* Call the _fxe_directory_local_path_set with NULL short name to cause an error.  */
5288     status =  _fxe_directory_local_path_set(&media_instance, FX_NULL, FX_NULL, 0);
5289 
5290     /* Check for the error.  */
5291     if (status != FX_PTR_ERROR)
5292     {
5293 
5294         /* Increment the failed tests counter.  */
5295         test_control_failed_tests++;
5296 
5297         /* Print error message.  */
5298         printf("Error in checking of fxe_directory_local_path_set!\n");
5299     }
5300 
5301     /* Call the _fxe_directory_local_path_set with 0 path control block size to cause an error.  */
5302     status =  _fxe_directory_local_path_set(&media_instance, &local_path_instance, FX_NULL, 0);
5303 
5304     /* Check for the error.  */
5305     if (status != FX_PTR_ERROR)
5306     {
5307 
5308         /* Increment the failed tests counter.  */
5309         test_control_failed_tests++;
5310 
5311         /* Print error message.  */
5312         printf("Error in checking of fxe_directory_local_path_set!\n");
5313     }
5314 
5315     /* Restore the system state.  */
5316     _tx_thread_system_state =  saved_system_state;
5317 
5318 
5319     /* Check caller error checking for fx_directory_local_path_restore.  */
5320 
5321     /* Save the system state.  */
5322     saved_system_state =  _tx_thread_system_state;
5323 
5324     /* Setup the fake media structure.  */
5325     media_instance.fx_media_id =  FX_MEDIA_ID;
5326 
5327     /* Call the _fxe_directory_local_path_restore with NULL local path pointer to cause an error.  */
5328     status =  _fxe_directory_local_path_restore(&media_instance, FX_NULL);
5329 
5330     /* Check for the error.  */
5331     if (status != FX_PTR_ERROR)
5332     {
5333 
5334         /* Increment the failed tests counter.  */
5335         test_control_failed_tests++;
5336 
5337         /* Print error message.  */
5338         printf("Error in checking of fxe_directory_local_path_restore!\n");
5339     }
5340 
5341     /* Restore the system state.  */
5342     _tx_thread_system_state =  saved_system_state;
5343 
5344 
5345     /* Check caller error checking for fx_directory_information_get.  */
5346 
5347     /* Save the system state.  */
5348     saved_system_state =  _tx_thread_system_state;
5349 
5350     /* Setup the fake media structure.  */
5351     media_instance.fx_media_id =  FX_MEDIA_ID;
5352 
5353     /* Call the _fxe_directory_information_get with NULL media name to cause an error.  */
5354     status =  _fxe_directory_information_get(FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5355 
5356     /* Check for the error.  */
5357     if (status != FX_PTR_ERROR)
5358     {
5359 
5360         /* Increment the failed tests counter.  */
5361         test_control_failed_tests++;
5362 
5363         /* Print error message.  */
5364         printf("Error in checking of fxe_directory_information_get!\n");
5365     }
5366 
5367     /* Call the _fxe_directory_information_get with NULL attributes pointer to cause an error.  */
5368     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5369 
5370     /* Check for the error.  */
5371     if (status != FX_PTR_ERROR)
5372     {
5373 
5374         /* Increment the failed tests counter.  */
5375         test_control_failed_tests++;
5376 
5377         /* Print error message.  */
5378         printf("Error in checking of fxe_directory_information_get!\n");
5379     }
5380 
5381     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5382     status =  _fxe_directory_information_get(&media_instance, FX_NULL, &attributes, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5383 
5384     /* Check for the error.  */
5385     if (status != FX_CALLER_ERROR)
5386     {
5387 
5388         /* Increment the failed tests counter.  */
5389         test_control_failed_tests++;
5390 
5391         /* Print error message.  */
5392         printf("Error in checking of fxe_directory_information_get!\n");
5393     }
5394 
5395     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5396     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, (ULONG*)&attributes, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5397 
5398     /* Check for the error.  */
5399     if (status != FX_CALLER_ERROR)
5400     {
5401 
5402         /* Increment the failed tests counter.  */
5403         test_control_failed_tests++;
5404 
5405         /* Print error message.  */
5406         printf("Error in checking of fxe_directory_information_get!\n");
5407     }
5408 
5409     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5410     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, FX_NULL, &attributes, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5411 
5412     /* Check for the error.  */
5413     if (status != FX_CALLER_ERROR)
5414     {
5415 
5416         /* Increment the failed tests counter.  */
5417         test_control_failed_tests++;
5418 
5419         /* Print error message.  */
5420         printf("Error in checking of fxe_directory_information_get!\n");
5421     }
5422 
5423     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5424     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, FX_NULL, FX_NULL, &attributes, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5425 
5426     /* Check for the error.  */
5427     if (status != FX_CALLER_ERROR)
5428     {
5429 
5430         /* Increment the failed tests counter.  */
5431         test_control_failed_tests++;
5432 
5433         /* Print error message.  */
5434         printf("Error in checking of fxe_directory_information_get!\n");
5435     }
5436 
5437     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5438     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, &attributes, FX_NULL, FX_NULL, FX_NULL);
5439 
5440     /* Check for the error.  */
5441     if (status != FX_CALLER_ERROR)
5442     {
5443 
5444         /* Increment the failed tests counter.  */
5445         test_control_failed_tests++;
5446 
5447         /* Print error message.  */
5448         printf("Error in checking of fxe_directory_information_get!\n");
5449     }
5450 
5451     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5452     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, &attributes, FX_NULL, FX_NULL);
5453 
5454     /* Check for the error.  */
5455     if (status != FX_CALLER_ERROR)
5456     {
5457 
5458         /* Increment the failed tests counter.  */
5459         test_control_failed_tests++;
5460 
5461         /* Print error message.  */
5462         printf("Error in checking of fxe_directory_information_get!\n");
5463     }
5464 
5465     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5466     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, &attributes, FX_NULL);
5467 
5468     /* Check for the error.  */
5469     if (status != FX_CALLER_ERROR)
5470     {
5471 
5472         /* Increment the failed tests counter.  */
5473         test_control_failed_tests++;
5474 
5475         /* Print error message.  */
5476         printf("Error in checking of fxe_directory_information_get!\n");
5477     }
5478 
5479     /* Call the _fxe_directory_information_get with one non-NULL pointer to cause an error.  */
5480     status =  _fxe_directory_information_get(&media_instance, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, &attributes);
5481 
5482     /* Check for the error.  */
5483     if (status != FX_CALLER_ERROR)
5484     {
5485 
5486         /* Increment the failed tests counter.  */
5487         test_control_failed_tests++;
5488 
5489         /* Print error message.  */
5490         printf("Error in checking of fxe_directory_information_get!\n");
5491     }
5492 
5493     /* Call the _fxe_directory_information_get to cause an error.  */
5494     status =  _fxe_directory_information_get(&media_instance, FX_NULL, &attributes, (ULONG *)&attributes, &attributes, &attributes, &attributes, &attributes, &attributes, &attributes);
5495 
5496     /* Check for the error.  */
5497     if (status != FX_CALLER_ERROR)
5498     {
5499 
5500         /* Increment the failed tests counter.  */
5501         test_control_failed_tests++;
5502 
5503         /* Print error message.  */
5504         printf("Error in checking of fxe_directory_information_get!\n");
5505     }
5506 
5507     /* Clear the system state to simulate an ISR caller.  */
5508     _tx_thread_system_state =  0;
5509 
5510     /* Call the _fxe_directory_information_get to cause an error.  */
5511     status =  _fxe_directory_information_get(&media_instance, FX_NULL, &attributes, (ULONG *)&attributes, &attributes, &attributes, &attributes, &attributes, &attributes, &attributes);
5512 
5513     /* Check for the error.  */
5514     if (status != FX_CALLER_ERROR)
5515     {
5516 
5517         /* Increment the failed tests counter.  */
5518         test_control_failed_tests++;
5519 
5520         /* Print error message.  */
5521         printf("Error in checking of fxe_directory_information_get!\n");
5522     }
5523 
5524 #ifndef TX_TIMER_PROCESS_IN_ISR
5525 
5526     /* Set the current thread to the timer thread, for caller checking.  */
5527     _tx_thread_current_ptr =  &_tx_timer_thread;
5528 
5529     /* Call the _fxe_directory_information_get to cause an error.  */
5530     status =  _fxe_directory_information_get(&media_instance, FX_NULL, &attributes, (ULONG *)&attributes, &attributes, &attributes, &attributes, &attributes, &attributes, &attributes);
5531 
5532     /* Set the current thread back to NULL.  */
5533     _tx_thread_current_ptr =  FX_NULL;
5534 
5535     /* Check for the error.  */
5536     if (status != FX_CALLER_ERROR)
5537     {
5538 
5539         /* Increment the failed tests counter.  */
5540         test_control_failed_tests++;
5541 
5542         /* Print error message.  */
5543         printf("Error in checking of fxe_directory_information_get!\n");
5544     }
5545 #endif
5546 
5547     /* Restore the system state.  */
5548     _tx_thread_system_state =  saved_system_state;
5549 
5550 
5551     /* Check caller error checking for fx_directory_first_full_entry_find.  */
5552 
5553     /* Save the system state.  */
5554     saved_system_state =  _tx_thread_system_state;
5555 
5556     /* Setup the fake media structure.  */
5557     media_instance.fx_media_id =  FX_MEDIA_ID;
5558 
5559     /* Call the _fxe_directory_first_full_entry_find to cause an error.  */
5560     status =  _fxe_directory_first_full_entry_find(&media_instance, FX_NULL, FX_NULL, FX_NULL,
5561                                                     FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5562 
5563     /* Check for the error.  */
5564     if (status != FX_CALLER_ERROR)
5565     {
5566 
5567         /* Increment the failed tests counter.  */
5568         test_control_failed_tests++;
5569 
5570         /* Print error message.  */
5571         printf("Error in checking of fxe_directory_first_full_entry_find!\n");
5572     }
5573 
5574     /* Clear the system state to simulate an ISR caller.  */
5575     _tx_thread_system_state =  0;
5576 
5577     /* Call the _fxe_directory_first_full_entry_find to cause an error.  */
5578     status =  _fxe_directory_first_full_entry_find(&media_instance, FX_NULL, FX_NULL, FX_NULL,
5579                                                     FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5580 
5581     /* Check for the error.  */
5582     if (status != FX_CALLER_ERROR)
5583     {
5584 
5585         /* Increment the failed tests counter.  */
5586         test_control_failed_tests++;
5587 
5588         /* Print error message.  */
5589         printf("Error in checking of fxe_directory_first_full_entry_find!\n");
5590     }
5591 
5592 #ifndef TX_TIMER_PROCESS_IN_ISR
5593 
5594     /* Set the current thread to the timer thread, for caller checking.  */
5595     _tx_thread_current_ptr =  &_tx_timer_thread;
5596 
5597     /* Call the _fxe_directory_first_full_entry_find to cause an error.  */
5598     status =  _fxe_directory_first_full_entry_find(&media_instance, FX_NULL, FX_NULL, FX_NULL,
5599                                                     FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
5600 
5601     /* Set the current thread back to NULL.  */
5602     _tx_thread_current_ptr =  FX_NULL;
5603 
5604     /* Check for the error.  */
5605     if (status != FX_CALLER_ERROR)
5606     {
5607 
5608         /* Increment the failed tests counter.  */
5609         test_control_failed_tests++;
5610 
5611         /* Print error message.  */
5612         printf("Error in checking of fxe_directory_first_full_entry_find!\n");
5613     }
5614 #endif
5615 
5616     /* Restore the system state.  */
5617     _tx_thread_system_state =  saved_system_state;
5618 
5619 
5620     /* Check caller error checking for fx_directory_first_entry_find.  */
5621 
5622     /* Save the system state.  */
5623     saved_system_state =  _tx_thread_system_state;
5624 
5625     /* Setup the fake media structure.  */
5626     media_instance.fx_media_id =  FX_MEDIA_ID;
5627 
5628     /* Call the _fxe_directory_first_entry_find to cause an error.  */
5629     status =  _fxe_directory_first_entry_find(&media_instance, FX_NULL);
5630 
5631     /* Check for the error.  */
5632     if (status != FX_CALLER_ERROR)
5633     {
5634 
5635         /* Increment the failed tests counter.  */
5636         test_control_failed_tests++;
5637 
5638         /* Print error message.  */
5639         printf("Error in checking of fxe_directory_first_entry_find!\n");
5640     }
5641 
5642     /* Clear the system state to simulate an ISR caller.  */
5643     _tx_thread_system_state =  0;
5644 
5645     /* Call the _fxe_directory_first_entry_find to cause an error.  */
5646     status =  _fxe_directory_first_entry_find(&media_instance, FX_NULL);
5647 
5648     /* Check for the error.  */
5649     if (status != FX_CALLER_ERROR)
5650     {
5651 
5652         /* Increment the failed tests counter.  */
5653         test_control_failed_tests++;
5654 
5655         /* Print error message.  */
5656         printf("Error in checking of fxe_directory_first_entry_find!\n");
5657     }
5658 
5659 #ifndef TX_TIMER_PROCESS_IN_ISR
5660 
5661     /* Set the current thread to the timer thread, for caller checking.  */
5662     _tx_thread_current_ptr =  &_tx_timer_thread;
5663 
5664     /* Call the _fxe_directory_first_entry_find to cause an error.  */
5665     status =  _fxe_directory_first_entry_find(&media_instance, FX_NULL);
5666 
5667     /* Set the current thread back to NULL.  */
5668     _tx_thread_current_ptr =  FX_NULL;
5669 
5670     /* Check for the error.  */
5671     if (status != FX_CALLER_ERROR)
5672     {
5673 
5674         /* Increment the failed tests counter.  */
5675         test_control_failed_tests++;
5676 
5677         /* Print error message.  */
5678         printf("Error in checking of fxe_directory_first_entry_find!\n");
5679     }
5680 #endif
5681 
5682     /* Restore the system state.  */
5683     _tx_thread_system_state =  saved_system_state;
5684 
5685 
5686     /* Check caller error checking for fx_directory_delete.  */
5687 
5688     /* Save the system state.  */
5689     saved_system_state =  _tx_thread_system_state;
5690 
5691     /* Setup the fake media structure.  */
5692     media_instance.fx_media_id =  FX_MEDIA_ID;
5693 
5694     /* Call the _fxe_directory_delete to cause an error.  */
5695     status =  _fxe_directory_delete(&media_instance, FX_NULL);
5696 
5697     /* Check for the error.  */
5698     if (status != FX_CALLER_ERROR)
5699     {
5700 
5701         /* Increment the failed tests counter.  */
5702         test_control_failed_tests++;
5703 
5704         /* Print error message.  */
5705         printf("Error in checking of fxe_directory_delete!\n");
5706     }
5707 
5708     /* Clear the system state to simulate an ISR caller.  */
5709     _tx_thread_system_state =  0;
5710 
5711     /* Call the _fxe_directory_delete to cause an error.  */
5712     status =  _fxe_directory_delete(&media_instance, FX_NULL);
5713 
5714     /* Check for the error.  */
5715     if (status != FX_CALLER_ERROR)
5716     {
5717 
5718         /* Increment the failed tests counter.  */
5719         test_control_failed_tests++;
5720 
5721         /* Print error message.  */
5722         printf("Error in checking of fxe_directory_delete!\n");
5723     }
5724 
5725 #ifndef TX_TIMER_PROCESS_IN_ISR
5726 
5727     /* Set the current thread to the timer thread, for caller checking.  */
5728     _tx_thread_current_ptr =  &_tx_timer_thread;
5729 
5730     /* Call the _fxe_directory_delete to cause an error.  */
5731     status =  _fxe_directory_delete(&media_instance, FX_NULL);
5732 
5733     /* Set the current thread back to NULL.  */
5734     _tx_thread_current_ptr =  FX_NULL;
5735 
5736     /* Check for the error.  */
5737     if (status != FX_CALLER_ERROR)
5738     {
5739 
5740         /* Increment the failed tests counter.  */
5741         test_control_failed_tests++;
5742 
5743         /* Print error message.  */
5744         printf("Error in checking of fxe_directory_delete!\n");
5745     }
5746 #endif
5747 
5748     /* Restore the system state.  */
5749     _tx_thread_system_state =  saved_system_state;
5750 
5751 
5752     /* Check caller error checking for fx_directory_default_set.  */
5753 
5754     /* Save the system state.  */
5755     saved_system_state =  _tx_thread_system_state;
5756 
5757     /* Setup the fake media structure.  */
5758     media_instance.fx_media_id =  FX_MEDIA_ID;
5759 
5760     /* Call the _fxe_directory_default_set to cause an error.  */
5761     status =  _fxe_directory_default_set(&media_instance, FX_NULL);
5762 
5763     /* Check for the error.  */
5764     if (status != FX_CALLER_ERROR)
5765     {
5766 
5767         /* Increment the failed tests counter.  */
5768         test_control_failed_tests++;
5769 
5770         /* Print error message.  */
5771         printf("Error in checking of fxe_directory_default_set!\n");
5772     }
5773 
5774     /* Clear the system state to simulate an ISR caller.  */
5775     _tx_thread_system_state =  0;
5776 
5777     /* Call the _fxe_directory_default_set to cause an error.  */
5778     status =  _fxe_directory_default_set(&media_instance, FX_NULL);
5779 
5780     /* Check for the error.  */
5781     if (status != FX_CALLER_ERROR)
5782     {
5783 
5784         /* Increment the failed tests counter.  */
5785         test_control_failed_tests++;
5786 
5787         /* Print error message.  */
5788         printf("Error in checking of fxe_directory_default_set!\n");
5789     }
5790 
5791 #ifndef TX_TIMER_PROCESS_IN_ISR
5792 
5793     /* Set the current thread to the timer thread, for caller checking.  */
5794     _tx_thread_current_ptr =  &_tx_timer_thread;
5795 
5796     /* Call the _fxe_directory_default_set to cause an error.  */
5797     status =  _fxe_directory_default_set(&media_instance, FX_NULL);
5798 
5799     /* Set the current thread back to NULL.  */
5800     _tx_thread_current_ptr =  FX_NULL;
5801 
5802     /* Check for the error.  */
5803     if (status != FX_CALLER_ERROR)
5804     {
5805 
5806         /* Increment the failed tests counter.  */
5807         test_control_failed_tests++;
5808 
5809         /* Print error message.  */
5810         printf("Error in checking of fxe_directory_default_set!\n");
5811     }
5812 #endif
5813 
5814     /* Restore the system state.  */
5815     _tx_thread_system_state =  saved_system_state;
5816 
5817 
5818     /* Check caller error checking for fx_directory_default_get.  */
5819 
5820     /* Save the system state.  */
5821     saved_system_state =  _tx_thread_system_state;
5822 
5823     /* Setup the fake media structure.  */
5824     media_instance.fx_media_id =  FX_MEDIA_ID;
5825 
5826     /* Call the _fxe_directory_default_get to cause an error.  */
5827     status =  _fxe_directory_default_get(&media_instance, &string_ptr);
5828 
5829     /* Check for the error.  */
5830     if (status != FX_CALLER_ERROR)
5831     {
5832 
5833         /* Increment the failed tests counter.  */
5834         test_control_failed_tests++;
5835 
5836         /* Print error message.  */
5837         printf("Error in checking of fxe_directory_default_get!\n");
5838     }
5839 
5840     /* Clear the system state to simulate an ISR caller.  */
5841     _tx_thread_system_state =  0;
5842 
5843     /* Call the _fxe_directory_default_get to cause an error.  */
5844     status =  _fxe_directory_default_get(&media_instance, &string_ptr);
5845 
5846     /* Check for the error.  */
5847     if (status != FX_CALLER_ERROR)
5848     {
5849 
5850         /* Increment the failed tests counter.  */
5851         test_control_failed_tests++;
5852 
5853         /* Print error message.  */
5854         printf("Error in checking of fxe_directory_default_get!\n");
5855     }
5856 
5857 #ifndef TX_TIMER_PROCESS_IN_ISR
5858 
5859     /* Set the current thread to the timer thread, for caller checking.  */
5860     _tx_thread_current_ptr =  &_tx_timer_thread;
5861 
5862     /* Call the _fxe_directory_default_get to cause an error.  */
5863     status =  _fxe_directory_default_get(&media_instance, &string_ptr);
5864 
5865     /* Set the current thread back to NULL.  */
5866     _tx_thread_current_ptr =  FX_NULL;
5867 
5868     /* Check for the error.  */
5869     if (status != FX_CALLER_ERROR)
5870     {
5871 
5872         /* Increment the failed tests counter.  */
5873         test_control_failed_tests++;
5874 
5875         /* Print error message.  */
5876         printf("Error in checking of fxe_directory_default_get!\n");
5877     }
5878 #endif
5879 
5880     /* Restore the system state.  */
5881     _tx_thread_system_state =  saved_system_state;
5882 
5883 
5884     /* Check caller error checking for fx_directory_create.  */
5885 
5886     /* Save the system state.  */
5887     saved_system_state =  _tx_thread_system_state;
5888 
5889     /* Setup the fake media structure.  */
5890     media_instance.fx_media_id =  FX_MEDIA_ID;
5891 
5892     /* Call the _fxe_directory_create to cause an error.  */
5893     status =  _fxe_directory_create(&media_instance, "RETURN");
5894 
5895     /* Check for the error.  */
5896     if (status != FX_CALLER_ERROR)
5897     {
5898 
5899         /* Increment the failed tests counter.  */
5900         test_control_failed_tests++;
5901 
5902         /* Print error message.  */
5903         printf("Error in checking of fxe_directory_create!\n");
5904     }
5905 
5906     /* Clear the system state to simulate an ISR caller.  */
5907     _tx_thread_system_state =  0;
5908 
5909     /* Call the _fxe_directory_create to cause an error.  */
5910     status =  _fxe_directory_create(&media_instance, "RETURN");
5911 
5912     /* Check for the error.  */
5913     if (status != FX_CALLER_ERROR)
5914     {
5915 
5916         /* Increment the failed tests counter.  */
5917         test_control_failed_tests++;
5918 
5919         /* Print error message.  */
5920         printf("Error in checking of fxe_directory_create!\n");
5921     }
5922 
5923 #ifndef TX_TIMER_PROCESS_IN_ISR
5924 
5925     /* Set the current thread to the timer thread, for caller checking.  */
5926     _tx_thread_current_ptr =  &_tx_timer_thread;
5927 
5928     /* Call the _fxe_directory_create to cause an error.  */
5929     status =  _fxe_directory_create(&media_instance, "RETURN");
5930 
5931     /* Set the current thread back to NULL.  */
5932     _tx_thread_current_ptr =  FX_NULL;
5933 
5934     /* Check for the error.  */
5935     if (status != FX_CALLER_ERROR)
5936     {
5937 
5938         /* Increment the failed tests counter.  */
5939         test_control_failed_tests++;
5940 
5941         /* Print error message.  */
5942         printf("Error in checking of fxe_directory_create!\n");
5943     }
5944 #endif
5945 
5946     /* Restore the system state.  */
5947     _tx_thread_system_state =  saved_system_state;
5948 
5949 
5950     /* Check caller error checking for fx_directory_attributes_set.  */
5951 
5952     /* Save the system state.  */
5953     saved_system_state =  _tx_thread_system_state;
5954 
5955     /* Setup the fake media structure.  */
5956     media_instance.fx_media_id =  FX_MEDIA_ID;
5957 
5958     /* Call the _fxe_directory_attributes_set to cause an error.  */
5959     status =  _fxe_directory_attributes_set(&media_instance, "RETURN", FX_HIDDEN);
5960 
5961     /* Check for the error.  */
5962     if (status != FX_CALLER_ERROR)
5963     {
5964 
5965         /* Increment the failed tests counter.  */
5966         test_control_failed_tests++;
5967 
5968         /* Print error message.  */
5969         printf("Error in checking of fxe_directory_attributes_set!\n");
5970     }
5971 
5972     /* Clear the system state to simulate an ISR caller.  */
5973     _tx_thread_system_state =  0;
5974 
5975     /* Call the _fxe_directory_attributes_set to cause an error.  */
5976     status =  _fxe_directory_attributes_set(&media_instance, "RETURN", FX_HIDDEN);
5977 
5978     /* Check for the error.  */
5979     if (status != FX_CALLER_ERROR)
5980     {
5981 
5982         /* Increment the failed tests counter.  */
5983         test_control_failed_tests++;
5984 
5985         /* Print error message.  */
5986         printf("Error in checking of fxe_directory_attributes_set!\n");
5987     }
5988 
5989 #ifndef TX_TIMER_PROCESS_IN_ISR
5990 
5991     /* Set the current thread to the timer thread, for caller checking.  */
5992     _tx_thread_current_ptr =  &_tx_timer_thread;
5993 
5994     /* Call the _fxe_directory_attributes_set to cause an error.  */
5995     status =  _fxe_directory_attributes_set(&media_instance, "RETURN", FX_HIDDEN);
5996 
5997     /* Set the current thread back to NULL.  */
5998     _tx_thread_current_ptr =  FX_NULL;
5999 
6000     /* Check for the error.  */
6001     if (status != FX_CALLER_ERROR)
6002     {
6003 
6004         /* Increment the failed tests counter.  */
6005         test_control_failed_tests++;
6006 
6007         /* Print error message.  */
6008         printf("Error in checking of fxe_directory_attributes_set!\n");
6009     }
6010 #endif
6011 
6012     /* Restore the system state.  */
6013     _tx_thread_system_state =  saved_system_state;
6014 
6015 
6016     /* Check caller error checking for fx_directory_attributes_read.  */
6017 
6018     /* Save the system state.  */
6019     saved_system_state =  _tx_thread_system_state;
6020 
6021     /* Setup the fake media structure.  */
6022     media_instance.fx_media_id =  FX_MEDIA_ID;
6023 
6024     /* Call the _fxe_directory_attributes_read with a NULL attributes pointer to cause an error.  */
6025     status =  _fxe_directory_attributes_read(&media_instance, "RETURN", FX_NULL);
6026 
6027     /* Check for the error.  */
6028     if (status != FX_PTR_ERROR)
6029     {
6030 
6031         /* Increment the failed tests counter.  */
6032         test_control_failed_tests++;
6033 
6034         /* Print error message.  */
6035         printf("Error in checking of fxe_directory_attributes_read!\n");
6036     }
6037 
6038     /* Call the _fxe_directory_attributes_read to cause an error.  */
6039     status =  _fxe_directory_attributes_read(&media_instance, "RETURN", &attributes);
6040 
6041     /* Check for the error.  */
6042     if (status != FX_CALLER_ERROR)
6043     {
6044 
6045         /* Increment the failed tests counter.  */
6046         test_control_failed_tests++;
6047 
6048         /* Print error message.  */
6049         printf("Error in checking of fxe_directory_attributes_read!\n");
6050     }
6051 
6052     /* Clear the system state to simulate an ISR caller.  */
6053     _tx_thread_system_state =  0;
6054 
6055     /* Call the _fxe_directory_attributes_read to cause an error.  */
6056     status =  _fxe_directory_attributes_read(&media_instance, "RETURN", &attributes);
6057 
6058     /* Check for the error.  */
6059     if (status != FX_CALLER_ERROR)
6060     {
6061 
6062         /* Increment the failed tests counter.  */
6063         test_control_failed_tests++;
6064 
6065         /* Print error message.  */
6066         printf("Error in checking of fxe_directory_attributes_read!\n");
6067     }
6068 
6069 #ifndef TX_TIMER_PROCESS_IN_ISR
6070 
6071     /* Set the current thread to the timer thread, for caller checking.  */
6072     _tx_thread_current_ptr =  &_tx_timer_thread;
6073 
6074     /* Call the _fxe_directory_attributes_read to cause an error.  */
6075     status =  _fxe_directory_attributes_read(&media_instance, "RETURN", &attributes);
6076 
6077     /* Set the current thread back to NULL.  */
6078     _tx_thread_current_ptr =  FX_NULL;
6079 
6080     /* Check for the error.  */
6081     if (status != FX_CALLER_ERROR)
6082     {
6083 
6084         /* Increment the failed tests counter.  */
6085         test_control_failed_tests++;
6086 
6087         /* Print error message.  */
6088         printf("Error in checking of fxe_directory_attributes_read!\n");
6089     }
6090 #endif
6091 
6092     /* Restore the system state.  */
6093     _tx_thread_system_state =  saved_system_state;
6094 
6095     /* Check PTR error checking for _fxe_directory_default_get_copy.  */
6096 
6097     /* Save the system state.  */
6098     saved_system_state =  _tx_thread_system_state;
6099 
6100     CHAR            path_name_buffer[32];
6101 
6102     /* Setup the fake media structure.  */
6103     media_instance.fx_media_id =  FX_MEDIA_ID;
6104 
6105     /* Call the _fxe_directory_default_get_copy with a NULL attributes pointer to cause an error.  */
6106     status =  _fxe_directory_default_get_copy(NULL, path_name_buffer, sizeof(path_name_buffer));
6107 
6108     /* Check for the error.  */
6109     if (status != FX_PTR_ERROR)
6110     {
6111 
6112         /* Increment the failed tests counter.  */
6113         test_control_failed_tests++;
6114 
6115         /* Print error message.  */
6116         printf("Error in checking of _fxe_directory_default_get_copy!\n");
6117     }
6118 
6119     /* Call the _fxe_directory_default_get_copy with a NULL attributes pointer to cause an error.  */
6120     status =  _fxe_directory_default_get_copy(&media_instance, NULL, sizeof(path_name_buffer));
6121 
6122     /* Check for the error.  */
6123     if (status != FX_PTR_ERROR)
6124     {
6125 
6126         /* Increment the failed tests counter.  */
6127         test_control_failed_tests++;
6128 
6129         /* Print error message.  */
6130         printf("Error in checking of _fxe_directory_default_get_copy!\n");
6131     }
6132 
6133     /* Call the _fxe_directory_default_get_copy to cause an error.  */
6134     status =  _fxe_directory_default_get_copy(&media_instance, path_name_buffer, sizeof(path_name_buffer));
6135 
6136     /* Check for the error.  */
6137     if (status != FX_CALLER_ERROR)
6138     {
6139 
6140         /* Increment the failed tests counter.  */
6141         test_control_failed_tests++;
6142 
6143         /* Print error message.  */
6144         printf("Error in checking of _fxe_directory_default_get_copy!\n");
6145     }
6146 
6147     /* Clear the system state to simulate an ISR caller.  */
6148     _tx_thread_system_state =  0;
6149 
6150     /* Call the _fxe_directory_default_get_copy to cause an error.  */
6151     status =  _fxe_directory_default_get_copy(&media_instance, path_name_buffer, sizeof(path_name_buffer));
6152 
6153     /* Check for the error.  */
6154     if (status != FX_CALLER_ERROR)
6155     {
6156 
6157         /* Increment the failed tests counter.  */
6158         test_control_failed_tests++;
6159 
6160         /* Print error message.  */
6161         printf("Error in checking of _fxe_directory_default_get_copy!\n");
6162     }
6163 
6164 #ifndef TX_TIMER_PROCESS_IN_ISR
6165 
6166     /* Set the current thread to the timer thread, for caller checking.  */
6167     _tx_thread_current_ptr =  &_tx_timer_thread;
6168 
6169     /* Call the _fxe_directory_default_get_copy to cause an error.  */
6170     status =  _fxe_directory_default_get_copy(&media_instance, path_name_buffer, sizeof(path_name_buffer));
6171 
6172     /* Set the current thread back to NULL.  */
6173     _tx_thread_current_ptr =  FX_NULL;
6174 
6175     /* Check for the error.  */
6176     if (status != FX_CALLER_ERROR)
6177     {
6178 
6179         /* Increment the failed tests counter.  */
6180         test_control_failed_tests++;
6181 
6182         /* Print error message.  */
6183         printf("Error in checking of _fxe_directory_default_get_copy!\n");
6184     }
6185 #endif
6186 
6187     /* Restore the system state.  */
6188     _tx_thread_system_state =  saved_system_state;
6189 
6190     /* Check PTR error checking for _fxe_directory_local_path_get_copy.  */
6191 
6192     /* Save the system state.  */
6193     saved_system_state =  _tx_thread_system_state;
6194 
6195     /* Call the _fxe_directory_local_path_get_copy with a NULL attributes pointer to cause an error.  */
6196     status =  _fxe_directory_local_path_get_copy(NULL, path_name_buffer, sizeof(path_name_buffer));
6197 
6198     /* Check for the error.  */
6199     if (status != FX_PTR_ERROR)
6200     {
6201 
6202         /* Increment the failed tests counter.  */
6203         test_control_failed_tests++;
6204 
6205         /* Print error message.  */
6206         printf("Error in checking of _fxe_directory_local_path_get_copy!\n");
6207     }
6208 
6209     /* Call the _fxe_directory_local_path_get_copy with a NULL attributes pointer to cause an error.  */
6210     status =  _fxe_directory_local_path_get_copy(&media_instance, NULL, sizeof(path_name_buffer));
6211 
6212     /* Check for the error.  */
6213     if (status != FX_PTR_ERROR)
6214     {
6215 
6216         /* Increment the failed tests counter.  */
6217         test_control_failed_tests++;
6218 
6219         /* Print error message.  */
6220         printf("Error in checking of _fxe_directory_local_path_get_copy!\n");
6221     }
6222 
6223     /* Call the _fxe_directory_local_path_get_copy to cause an error.  */
6224     status =  _fxe_directory_local_path_get_copy(&media_instance, path_name_buffer, sizeof(path_name_buffer));
6225 
6226     /* Check for the error.  */
6227     if (status != FX_CALLER_ERROR)
6228     {
6229 
6230         /* Increment the failed tests counter.  */
6231         test_control_failed_tests++;
6232 
6233         /* Print error message.  */
6234         printf("Error in checking of _fxe_directory_local_path_get_copy!\n");
6235     }
6236 
6237     /* Clear the system state to simulate an ISR caller.  */
6238     _tx_thread_system_state =  0;
6239 
6240     /* Call the _fxe_directory_local_path_get_copy to cause an error.  */
6241     status =  _fxe_directory_local_path_get_copy(&media_instance, path_name_buffer, sizeof(path_name_buffer));
6242 
6243     /* Check for the error.  */
6244     if (status != FX_CALLER_ERROR)
6245     {
6246 
6247         /* Increment the failed tests counter.  */
6248         test_control_failed_tests++;
6249 
6250         /* Print error message.  */
6251         printf("Error in checking of _fxe_directory_local_path_get_copy!\n");
6252     }
6253 
6254 #ifndef TX_TIMER_PROCESS_IN_ISR
6255 
6256     /* Set the current thread to the timer thread, for caller checking.  */
6257     _tx_thread_current_ptr =  &_tx_timer_thread;
6258 
6259     /* Call the _fxe_directory_local_path_get_copy to cause an error.  */
6260     status =  _fxe_directory_local_path_get_copy(&media_instance, path_name_buffer, sizeof(path_name_buffer));
6261 
6262     /* Set the current thread back to NULL.  */
6263     _tx_thread_current_ptr =  FX_NULL;
6264 
6265     /* Check for the error.  */
6266     if (status != FX_CALLER_ERROR)
6267     {
6268 
6269         /* Increment the failed tests counter.  */
6270         test_control_failed_tests++;
6271 
6272         /* Print error message.  */
6273         printf("Error in checking of _fxe_directory_local_path_get_copy!\n");
6274     }
6275 #endif
6276     /* Restore the system state.  */
6277     _tx_thread_system_state =  saved_system_state;
6278 
6279     /* Create the test control thread.  */
6280     tx_thread_create(&test_control_thread, "test control thread", test_control_thread_entry, 0,
6281             test_control_thread_stack, TEST_STACK_SIZE,
6282             0, 0, TX_NO_TIME_SLICE, TX_AUTO_START);
6283 
6284 #ifndef NETXTEST_TIMEOUT_DISABLE
6285     /* Create the test control semaphore.  */
6286     tx_semaphore_create(&test_control_sema, "Test control semaphore", 0);
6287 #endif
6288 
6289 #else
6290     /* Skipping the error checking shell(caller error) tests for FileX Standalone  */
6291     test_control_thread_entry(0);
6292 #endif /* FX_STANDALONE_ENABLE */
6293 }
6294 
6295 
6296 
6297 /* Define the test control thread.  This thread is responsible for dispatching all of the
6298    tests in the ThreadX test suite.  */
6299 
test_control_thread_entry(ULONG thread_input)6300 void  test_control_thread_entry(ULONG thread_input)
6301 {
6302 
6303 UINT    i;
6304 
6305     FX_PARAMETER_NOT_USED(thread_input);
6306 
6307     /* Loop to process all tests...  */
6308     i =  0;
6309     while (test_control_tests[i].test_entry != FX_NULL)
6310     {
6311 
6312         /* Dispatch the test.  */
6313         (test_control_tests[i++].test_entry)(test_free_memory_ptr);
6314 #ifndef FX_STANDALONE_ENABLE
6315 #ifdef TEST_TIMEOUT_DISABLE
6316         /* Suspend control test to allow test to run.  */
6317         tx_thread_suspend(&test_control_thread);
6318 #else
6319         if(tx_semaphore_get(&test_control_sema, test_control_tests[i - 1].timeout))
6320         {
6321 
6322             /* Test case timeouts. */
6323             printf("ERROR!\n");
6324             test_control_failed_tests++;
6325 
6326         }
6327 #endif
6328 #endif
6329         /* Test finished, cleanup in preparation for the next test.  */
6330         test_control_cleanup();
6331 
6332 #ifdef BATCH_TEST
6333         fflush(stdout);
6334 #endif
6335     }
6336 
6337     /* Finished with all tests, print results and return!  */
6338     printf("**** Testing Complete ****\n");
6339     printf("**** Test Summary:  Tests Passed:  %lu   Tests Failed:  %lu\n", test_control_successful_tests, test_control_failed_tests);
6340 
6341 #ifdef BATCH_TEST
6342     exit((INT)test_control_failed_tests);
6343 #endif
6344 }
6345 
6346 
test_control_return(UINT status)6347 void  test_control_return(UINT status)
6348 {
6349 #ifndef FX_STANDALONE_ENABLE
6350 UINT    old_posture =  TX_INT_ENABLE;
6351 #endif
6352 
6353     /* Save the status in a global.  */
6354     test_control_return_status =  status;
6355 
6356     /* Ensure interrupts are enabled.  */
6357 #ifndef FX_STANDALONE_ENABLE
6358     old_posture =  tx_interrupt_control(TX_INT_ENABLE);
6359 #endif
6360     /* Determine if it was successful or not.  */
6361     /* Define 254 as a special error code without output. */
6362 #ifndef FX_STANDALONE_ENABLE
6363     if (((status > 0) && (status < 254)) || (_tx_thread_preempt_disable) || (old_posture == TX_INT_DISABLE))
6364 #else
6365     if((status > 0) && (status < 254))
6366 #endif
6367     {
6368         printf("                                                             **** ERROR CODE: %u *****\n", status);
6369         test_control_failed_tests++;
6370     }
6371     else if (status == 0)
6372         test_control_successful_tests++;
6373     else if (status == 254)
6374         test_control_failed_tests++;
6375     else if (status == 255)
6376         test_control_na_tests++;
6377 
6378 #ifndef FX_STANDALONE_ENABLE
6379 #ifdef NETXTEST_TIMEOUT_DISABLE
6380     /* Resume the control thread to fully exit the test.  */
6381     tx_thread_resume(&test_control_thread);
6382 #else
6383     tx_semaphore_put(&test_control_sema);
6384 #endif
6385 
6386 #else
6387 
6388     /* Finished with all tests, print results and return!  */
6389     printf("**** Testing Complete ****\n");
6390     printf("**** Test Summary:  Tests Passed:  %lu   Tests Failed:  %lu\n", test_control_successful_tests, test_control_failed_tests);
6391 
6392     pthread_exit(NULL);
6393 #endif
6394 }
6395 
6396 
test_control_cleanup(void)6397 void  test_control_cleanup(void)
6398 {
6399 #ifndef FX_STANDALONE_ENABLE
6400 
6401 TX_MUTEX        *mutex_ptr;
6402 TX_THREAD       *thread_ptr;
6403 
6404 
6405     /* Delete all FX_MEDIA instances.   */
6406     while (_fx_system_media_opened_ptr)
6407     {
6408 
6409         /* Close all media instances.  */
6410         fx_media_close(_fx_system_media_opened_ptr);
6411     }
6412 
6413     /* Delete all queues.  */
6414     while(_tx_queue_created_ptr)
6415     {
6416 
6417         /* Delete queue.  */
6418         tx_queue_delete(_tx_queue_created_ptr);
6419     }
6420 
6421     /* Delete all semaphores.  */
6422     while(_tx_semaphore_created_ptr)
6423     {
6424 
6425 #ifndef TEST_TIMEOUT_DISABLE
6426         if(_tx_semaphore_created_ptr != &test_control_sema)
6427         {
6428 
6429         /* Delete semaphore.  */
6430         tx_semaphore_delete(_tx_semaphore_created_ptr);
6431     }
6432         else if(_tx_semaphore_created_count == 1)
6433             break;
6434         else
6435         {
6436             /* Delete semaphore.  */
6437             tx_semaphore_delete(_tx_semaphore_created_ptr -> tx_semaphore_created_next);
6438         }
6439 #else
6440         /* Delete semaphore.  */
6441         tx_semaphore_delete(_tx_semaphore_created_ptr);
6442 #endif
6443     }
6444 
6445     /* Delete all event flag groups.  */
6446     while(_tx_event_flags_created_ptr)
6447     {
6448 
6449         /* Delete event flag group.  */
6450         tx_event_flags_delete(_tx_event_flags_created_ptr);
6451     }
6452 
6453     /* Delete all byte pools.  */
6454     while(_tx_byte_pool_created_ptr)
6455     {
6456 
6457         /* Delete byte pool.  */
6458         tx_byte_pool_delete(_tx_byte_pool_created_ptr);
6459     }
6460 
6461     /* Delete all block pools.  */
6462     while(_tx_block_pool_created_ptr)
6463     {
6464 
6465         /* Delete block pool.  */
6466         tx_block_pool_delete(_tx_block_pool_created_ptr);
6467     }
6468 
6469     /* Delete all timers.  */
6470     while(_tx_timer_created_ptr)
6471     {
6472 
6473         /* Deactivate timer.  */
6474         tx_timer_deactivate(_tx_timer_created_ptr);
6475 
6476         /* Delete timer.  */
6477         tx_timer_delete(_tx_timer_created_ptr);
6478     }
6479 
6480     /* Delete all mutexes (except for system mutex).  */
6481     while(_tx_mutex_created_ptr)
6482     {
6483 
6484         /* Setup working mutex pointer.  */
6485         mutex_ptr =  _tx_mutex_created_ptr;
6486 
6487 #ifdef __ghs
6488 
6489         /* Determine if the mutex is the GHS system mutex.  If so, don't delete!  */
6490         if (mutex_ptr == &__ghLockMutex)
6491         {
6492 
6493             /* Move to next mutex.  */
6494             mutex_ptr =  mutex_ptr -> tx_mutex_created_next;
6495         }
6496 
6497         /* Determine if there are no more mutexes to delete.  */
6498         if (_tx_mutex_created_count == 1)
6499             break;
6500 #endif
6501 
6502         /* Delete mutex.  */
6503         tx_mutex_delete(mutex_ptr);
6504     }
6505 
6506     /* Delete all threads, except for timer thread, and test control thread.  */
6507     while (_tx_thread_created_ptr)
6508     {
6509 
6510         /* Setup working pointer.  */
6511         thread_ptr =  _tx_thread_created_ptr;
6512 
6513 
6514 #ifdef TX_TIMER_PROCESS_IN_ISR
6515 
6516         /* Determine if there are more threads to delete.  */
6517         if (_tx_thread_created_count == 1)
6518             break;
6519 
6520         /* Determine if this thread is the test control thread.  */
6521         if (thread_ptr == &test_control_thread)
6522         {
6523 
6524             /* Move to the next thread pointer.  */
6525             thread_ptr =  thread_ptr -> tx_thread_created_next;
6526 //            thread_ptr =  thread_ptr -> tx_created_next;
6527         }
6528 #else
6529 
6530         /* Determine if there are more threads to delete.  */
6531         if (_tx_thread_created_count == 2)
6532             break;
6533 
6534         /* Move to the thread not protected.  */
6535         while ((thread_ptr == &_tx_timer_thread) || (thread_ptr == &test_control_thread))
6536         {
6537 
6538             /* Yes, move to the next thread.  */
6539             thread_ptr =  thread_ptr -> tx_thread_created_next;
6540 //            thread_ptr =  thread_ptr -> tx_created_next;
6541         }
6542 #endif
6543 
6544         /* First terminate the thread to ensure it is ready for deletion.  */
6545         tx_thread_terminate(thread_ptr);
6546 
6547         /* Delete the thread.  */
6548         tx_thread_delete(thread_ptr);
6549     }
6550 
6551     /* At this point, only the test control thread and the system timer thread and/or mutex should still be
6552        in the system.  */
6553 #endif
6554 }
6555 
6556 
6557