1 /* This test is designed to test kernel setup functionality in ThreadX.  */
2 
3 #include   <stdio.h>
4 #include   "tx_api.h"
5 #include   "tx_initialize.h"
6 #include   "tx_thread.h"
7 
8 
9 TEST_FLAG               test_forced_mutex_timeout;
10 TEST_FLAG               threadx_mutex_suspension_put_test;
11 TEST_FLAG               threadx_mutex_suspension_priority_test;
12 TEST_FLAG               threadx_byte_allocate_loop_test;
13 TEST_FLAG               test_initialize_flag;
14 TEST_FLAG               threadx_byte_release_loop_test;
15 TEST_FLAG               test_stack_analyze_flag;
16 
17 
18 /* Define the test control global variables.   */
19 
20 ULONG           test_control_return_status;
21 ULONG           test_control_successful_tests;
22 ULONG           test_control_failed_tests;
23 ULONG           test_control_system_errors;
24 
25 UINT            test_mutex_from_init;
26 UINT            test_semaphore_from_init;
27 UINT            test_queue_from_init;
28 UINT            test_event_flags_from_init;
29 UINT            test_byte_pool_create_init;
30 UINT            test_block_pool_create_init;
31 UINT            test_timer_create_init;
32 UINT            mutex_priority_change_extension_selection;
33 UINT            priority_change_extension_selection;
34 
35 
abort_all_threads_suspended_on_mutex(void)36 __attribute__((weak)) void  abort_all_threads_suspended_on_mutex(void)
37 {
38 }
39 
suspend_lowest_priority(void)40 __attribute__((weak)) void  suspend_lowest_priority(void)
41 {
42 }
43 
abort_and_resume_byte_allocating_thread(void)44 __attribute__((weak)) void abort_and_resume_byte_allocating_thread(void)
45 {
46 }
47 
main()48 void main()
49 {
50 
51     /* Setup the ThreadX kernel.  */
52     _tx_initialize_kernel_setup();
53 
54     if (_tx_thread_system_state == TX_INITIALIZE_ALMOST_DONE)
55     {
56         printf("Running Initialize Kernel Setup Test................................ SUCCESS!\n");
57         exit(0);
58     }
59     else
60     {
61         printf("Running Initialize Kernel Setup Test................................ ERROR!\n");
62         exit(1);
63     }
64 }
65 
test_application_define(void * first_unused_memory)66 void test_application_define(void *first_unused_memory){}
tx_application_define(void * first_unused_memory)67 void tx_application_define(void *first_unused_memory){}
68 
69 
70 #ifndef TX_TIMER_PROCESS_IN_ISR
71 
72 /* Define the deletion of the system timer thread.  */
73 
74 extern TX_THREAD _tx_timer_thread;
75 TEST_FLAG threadx_delete_timer_thread;
delete_timer_thread(void)76 void delete_timer_thread(void)
77 {
78 
79     _tx_thread_terminate(&_tx_timer_thread);
80     _tx_thread_delete(&_tx_timer_thread);
81 }
82 
83 #endif