36 #undef __STRICT_ANSI__ 40 #include <rtems/test.h> 54 _RTEMS_Lock_allocator();
56 if (information != NULL) {
62 _RTEMS_Unlock_allocator();
74 count = T_objects_count(api, cls);
75 delta = (int32_t)count - (int32_t)*expected;
79 T_check(&T_special,
false,
"%s leak (%" PRIi32
")", name,
87 T_rtems_barriers_run_initialize(
void)
89 T_barrier_count = T_objects_count(OBJECTS_CLASSIC_API,
90 OBJECTS_RTEMS_BARRIERS);
94 T_rtems_barriers_case_end(
void)
96 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_BARRIERS,
97 &T_barrier_count,
"RTEMS barrier");
101 T_check_rtems_barriers(T_event event,
const char *name)
106 case T_EVENT_RUN_INITIALIZE_EARLY:
107 T_rtems_barriers_run_initialize();
109 case T_EVENT_CASE_END:
110 T_rtems_barriers_case_end();
120 T_rtems_extensions_run_initialize(
void)
122 T_extension_count = T_objects_count(OBJECTS_CLASSIC_API,
123 OBJECTS_RTEMS_EXTENSIONS);
127 T_rtems_extensions_case_end(
void)
129 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_EXTENSIONS,
130 &T_extension_count,
"RTEMS extension");
134 T_check_rtems_extensions(T_event event,
const char *name)
139 case T_EVENT_RUN_INITIALIZE_EARLY:
140 T_rtems_extensions_run_initialize();
142 case T_EVENT_CASE_END:
143 T_rtems_extensions_case_end();
153 T_rtems_message_queues_run_initialize(
void)
155 T_mq_count = T_objects_count(OBJECTS_CLASSIC_API,
156 OBJECTS_RTEMS_MESSAGE_QUEUES);
160 T_rtems_message_queues_case_end(
void)
162 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_MESSAGE_QUEUES,
163 &T_mq_count,
"RTEMS message queue");
167 T_check_rtems_message_queues(T_event event,
const char *name)
172 case T_EVENT_RUN_INITIALIZE_EARLY:
173 T_rtems_message_queues_run_initialize();
175 case T_EVENT_CASE_END:
176 T_rtems_message_queues_case_end();
186 T_rtems_partitions_run_initialize(
void)
188 T_part_count = T_objects_count(OBJECTS_CLASSIC_API,
189 OBJECTS_RTEMS_PARTITIONS);
193 T_rtems_partitions_case_end(
void)
195 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_PARTITIONS,
196 &T_part_count,
"RTEMS partition");
200 T_check_rtems_partitions(T_event event,
const char *name)
205 case T_EVENT_RUN_INITIALIZE_EARLY:
206 T_rtems_partitions_run_initialize();
208 case T_EVENT_CASE_END:
209 T_rtems_partitions_case_end();
219 T_rtems_periods_run_initialize(
void)
221 T_period_count = T_objects_count(OBJECTS_CLASSIC_API,
222 OBJECTS_RTEMS_PERIODS);
226 T_rtems_periods_case_end(
void)
228 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_PERIODS,
229 &T_period_count,
"RTEMS period");
233 T_check_rtems_periods(T_event event,
const char *name)
238 case T_EVENT_RUN_INITIALIZE_EARLY:
239 T_rtems_periods_run_initialize();
241 case T_EVENT_CASE_END:
242 T_rtems_periods_case_end();
252 T_rtems_regions_run_initialize(
void)
254 T_region_count = T_objects_count(OBJECTS_CLASSIC_API,
255 OBJECTS_RTEMS_REGIONS);
259 T_rtems_regions_case_end(
void)
261 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_REGIONS,
262 &T_region_count,
"RTEMS region");
266 T_check_rtems_regions(T_event event,
const char *name)
271 case T_EVENT_RUN_INITIALIZE_EARLY:
272 T_rtems_regions_run_initialize();
274 case T_EVENT_CASE_END:
275 T_rtems_regions_case_end();
285 T_rtems_semaphores_run_initialize(
void)
287 T_sema_count = T_objects_count(OBJECTS_CLASSIC_API,
288 OBJECTS_RTEMS_SEMAPHORES);
292 T_rtems_semaphores_case_end(
void)
294 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_SEMAPHORES,
295 &T_sema_count,
"RTEMS semaphore");
299 T_check_rtems_semaphores(T_event event,
const char *name)
304 case T_EVENT_RUN_INITIALIZE_EARLY:
305 T_rtems_semaphores_run_initialize();
307 case T_EVENT_CASE_END:
308 T_rtems_semaphores_case_end();
318 T_rtems_tasks_run_initialize(
void)
320 T_task_count = T_objects_count(OBJECTS_CLASSIC_API,
321 OBJECTS_RTEMS_TASKS);
325 T_rtems_tasks_case_end(
void)
327 _RTEMS_Lock_allocator();
329 _RTEMS_Unlock_allocator();
331 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TASKS,
332 &T_task_count,
"RTEMS task");
336 T_check_rtems_tasks(T_event event,
const char *name)
341 case T_EVENT_RUN_INITIALIZE_EARLY:
342 T_rtems_tasks_run_initialize();
344 case T_EVENT_CASE_END:
345 T_rtems_tasks_case_end();
355 T_rtems_timers_run_initialize(
void)
357 T_timer_count = T_objects_count(OBJECTS_CLASSIC_API,
358 OBJECTS_RTEMS_TIMERS);
362 T_rtems_timers_case_end(
void)
364 T_objects_check(OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TIMERS,
365 &T_timer_count,
"RTEMS timer");
369 T_check_rtems_timers(T_event event,
const char *name)
374 case T_EVENT_RUN_INITIALIZE_EARLY:
375 T_rtems_timers_run_initialize();
377 case T_EVENT_CASE_END:
378 T_rtems_timers_case_end();
Objects_Information * _Objects_Get_information(Objects_APIs the_api, uint16_t the_class)
Gets object information.
void _Thread_Kill_zombies(void)
Kills all zombie threads in the system.
RTEMS Support for Test Framework.
Objects_Maximum _Objects_Active_count(const Objects_Information *information)
Returns the count of active objects.
Inlined Routines from the Thread Handler.