diff options
Diffstat (limited to 'test/smp/regression/testcontrol.c')
| -rw-r--r-- | test/smp/regression/testcontrol.c | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/test/smp/regression/testcontrol.c b/test/smp/regression/testcontrol.c index e63930d2..6b45750d 100644 --- a/test/smp/regression/testcontrol.c +++ b/test/smp/regression/testcontrol.c @@ -53,7 +53,7 @@ TEST_FLAG threadx_delete_timer_thread; #endif TX_TIMER_INTERNAL **_timer_list_start_backup; TEST_FLAG test_stack_analyze_flag; -TEST_FLAG test_initialize_flag; +TEST_FLAG test_initialize_flag; TX_BLOCK_POOL fake_block_pool; TX_BYTE_POOL fake_byte_pool; TX_EVENT_FLAGS_GROUP fake_event_flags; @@ -113,7 +113,7 @@ VOID (*test_isr_dispatch)(void); UCHAR test_control_memory[0x60000]; UCHAR tests_memory[0x60000]; -UINT mutex_priority_change_extension_selection; +UINT mutex_priority_change_extension_selection; UINT priority_change_extension_selection; TEST_FLAG test_forced_mutex_timeout; TEST_FLAG threadx_byte_allocate_loop_test; @@ -263,7 +263,7 @@ void test_application_define(void *first_unused_memory); /* Define the array of test entry points. */ -TEST_ENTRY test_control_tests[] = +TEST_ENTRY test_control_tests[] = { #if CTEST test_application_define, @@ -297,7 +297,7 @@ TEST_ENTRY test_control_tests[] = threadx_byte_memory_thread_terminate_application_define, threadx_byte_memory_prioritize_application_define, threadx_byte_memory_thread_contention_application_define, - threadx_byte_memory_information_application_define, + threadx_byte_memory_information_application_define, threadx_event_flag_basic_application_define, threadx_event_flag_suspension_application_define, @@ -380,14 +380,14 @@ TEST_ENTRY test_control_tests[] = threadx_thread_stack_checking_application_define, threadx_time_get_set_application_define, - + threadx_timer_simple_application_define, threadx_timer_activate_deactivate_application_define, threadx_timer_deactivate_accuracy_application_define, threadx_timer_large_timer_accuracy_application_define, threadx_timer_multiple_application_define, threadx_timer_multiple_accuracy_application_define, - threadx_timer_information_application_define, + threadx_timer_information_application_define, threadx_trace_basic_application_define, #endif @@ -452,7 +452,7 @@ void test_interrupt_dispatch(void) if (test_isr_dispatch) { - (test_isr_dispatch)(); + (test_isr_dispatch)(); } } @@ -490,7 +490,7 @@ void main() /* Test the pre-initialize path through _tx_initialize_kernel_enter. */ _tx_thread_system_state[0] = TX_INITIALIZE_ALMOST_DONE; test_initialize_flag = 1; - + /* Call the internal kernel enter function to exercise two paths. */ _tx_initialize_kernel_enter(); _tx_thread_system_state[0] = 0; @@ -532,27 +532,27 @@ TX_THREAD *thread_ptr; test_control_system_errors = 0; /* Create two equal priority threads. */ - status = tx_thread_create(&test_thread4, "test thread 4", test_thread_entry1, 4, + status = tx_thread_create(&test_thread4, "test thread 4", test_thread_entry1, 4, test_thread4_stack, sizeof(test_thread4_stack), 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread5, "test thread 5", test_thread_entry1, 5, + status += tx_thread_create(&test_thread5, "test thread 5", test_thread_entry1, 5, test_thread5_stack, sizeof(test_thread5_stack), 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread6, "test thread 6", test_thread_entry1, 6, + status += tx_thread_create(&test_thread6, "test thread 6", test_thread_entry1, 6, test_thread6_stack, sizeof(test_thread6_stack), 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread7, "test thread 7", test_thread_entry1, 7, + status += tx_thread_create(&test_thread7, "test thread 7", test_thread_entry1, 7, test_thread7_stack, sizeof(test_thread7_stack), 17, 17, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread8, "test thread 8", test_thread_entry1, 8, + status += tx_thread_create(&test_thread8, "test thread 8", test_thread_entry1, 8, test_thread8_stack, sizeof(test_thread8_stack), 18, 18, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread9, "test thread 9", test_thread_entry1, 9, + status += tx_thread_create(&test_thread9, "test thread 9", test_thread_entry1, 9, test_thread9_stack, sizeof(test_thread9_stack), 19, 19, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread10, "test thread 10", test_thread_entry1, 10, + status += tx_thread_create(&test_thread10, "test thread 10", test_thread_entry1, 10, test_thread10_stack, sizeof(test_thread10_stack), 20, 20, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread11, "test thread 11", test_thread_entry1, 11, + status += tx_thread_create(&test_thread11, "test thread 11", test_thread_entry1, 11, test_thread11_stack, sizeof(test_thread11_stack), 20, 20, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread12, "test thread 12", test_thread_entry1, 12, + status += tx_thread_create(&test_thread12, "test thread 12", test_thread_entry1, 12, test_thread12_stack, sizeof(test_thread12_stack), 20, 20, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread13, "test thread 13", test_thread_entry1, 13, + status += tx_thread_create(&test_thread13, "test thread 13", test_thread_entry1, 13, test_thread13_stack, sizeof(test_thread13_stack), 20, 20, TX_NO_TIME_SLICE, TX_DONT_START); - status += tx_thread_create(&test_thread14, "test thread 14", test_thread_entry1, 14, + status += tx_thread_create(&test_thread14, "test thread 14", test_thread_entry1, 14, test_thread14_stack, sizeof(test_thread14_stack), 20, 20, TX_NO_TIME_SLICE, TX_DONT_START); status += tx_thread_smp_core_exclude(&test_thread4, 0xD); status += tx_thread_smp_core_exclude(&test_thread5, 0xD); @@ -604,29 +604,29 @@ TX_THREAD *thread_ptr; status += tx_thread_suspend(&test_thread4); /* Setup a pointer to the first unused memory. */ - pointer = (UCHAR *) &test_control_memory[0]; //first_unused_memory; + pointer = (UCHAR *) &test_control_memory[0]; //first_unused_memory; /* Create the test control thread. */ - tx_thread_create(&test_control_thread, "test control thread", test_control_thread_entry, 0, - pointer, TEST_STACK_SIZE, + tx_thread_create(&test_control_thread, "test control thread", test_control_thread_entry, 0, + pointer, TEST_STACK_SIZE, 17, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE; /* Create the test thread. */ - tx_thread_create(&test_thread, "test thread", test_thread_entry, 0, - pointer, TEST_STACK_SIZE, + tx_thread_create(&test_thread, "test thread", test_thread_entry, 0, + pointer, TEST_STACK_SIZE, 15, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE; /* Create the second test thread. */ - tx_thread_create(&test_thread1, "test thread 1", test_thread_entry1, 0, - pointer, TEST_STACK_SIZE, + tx_thread_create(&test_thread1, "test thread 1", test_thread_entry1, 0, + pointer, TEST_STACK_SIZE, 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE; /* Suspend the test thread temporarily. */ tx_thread_suspend(&test_thread); - + /* Resume the test thread again to exercise the resume code fully. */ tx_thread_resume(&test_thread); @@ -645,26 +645,26 @@ TX_THREAD *thread_ptr; test_mutex_from_init += tx_mutex_get(&init_mutex_inherit, TX_NO_WAIT); test_mutex_from_init += tx_mutex_put(&init_mutex_inherit); test_mutex_from_init += tx_mutex_put(&init_mutex_inherit); - + #ifndef TX_DISABLE_ERROR_CHECKING /* Test timer create from initialization. */ test_block_pool_create_init = tx_block_pool_create(&init_block_pool, "init block pool", 10, init_block_pool_area, sizeof(init_block_pool_area)); - + /* Test byte pool create from initialization. */ test_byte_pool_create_init = tx_byte_pool_create(&init_byte_pool, "init byte pool", init_byte_pool_area, sizeof(init_byte_pool_area)); test_byte_pool_create_init += tx_byte_allocate(&init_byte_pool, (VOID **) &pointer, 20, TX_NO_WAIT); test_byte_pool_create_init += tx_byte_release(pointer); - + /* Test event flag create from initialization. */ test_event_flags_from_init = tx_event_flags_create(&init_event_flags, "init events"); - + /* Test queue create from initialization. */ test_queue_from_init = tx_queue_create(&init_queue, "init queue", TX_1_ULONG, init_queue_area, sizeof(init_queue_area)); - + /* Test semaphore create from initialization. */ test_semaphore_from_init = tx_semaphore_create(&init_semaphore, "init semaphore", 0); - + /* Test timer creat from initialization. */ test_timer_create_init = tx_timer_create(&init_timer, "init timer", init_timer_entry, 0x5678, 100, 200, TX_AUTO_ACTIVATE); @@ -675,7 +675,7 @@ TX_THREAD *thread_ptr; /* Remember the free memory pointer. */ test_free_memory_ptr = &tests_memory[0]; //pointer; - + /* Clear the ISR dispatch. */ test_isr_dispatch = TX_NULL; @@ -685,12 +685,12 @@ TX_THREAD *thread_ptr; /* Test to make sure _tx_thread_time_slice can handle a none-ready thread. */ init_test_thread.tx_thread_state = TX_IO_DRIVER; init_test_thread.tx_thread_new_time_slice = 0; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_TRUE; - _tx_thread_current_ptr[0] = &init_test_thread; + _tx_thread_current_ptr[0] = &init_test_thread; _tx_thread_time_slice(); - + /* Test to make sure _tx_thread_time_slice can handle preemption-threshold set. */ init_test_thread.tx_thread_state = TX_READY; init_test_thread.tx_thread_new_time_slice = 0; @@ -706,7 +706,7 @@ TX_THREAD *thread_ptr; temp_thread = _tx_thread_execute_ptr[0]; _tx_thread_mutex_release = TX_NULL; init_test_thread.tx_thread_state = TX_READY; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_new_time_slice = 0; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_FALSE; @@ -715,15 +715,15 @@ TX_THREAD *thread_ptr; _tx_thread_current_ptr[0] = &init_test_thread; _tx_thread_execute_ptr[0] = &init_test_thread; _tx_thread_entry_exit_notify(&init_test_thread, test_exit_notify); - _tx_thread_shell_entry(); + _tx_thread_shell_entry(); _tx_thread_current_ptr[0] = TX_NULL; _tx_thread_execute_ptr[0] = temp_thread; _tx_thread_mutex_release = temp_mutex_release; /* Recover Mutex release pointer. */ - + /* Test _tx_thread_system_suspend when not current, preemption is needed but disabled. */ temp_thread = _tx_thread_execute_ptr[0]; init_test_thread.tx_thread_state = TX_READY; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_new_time_slice = 0; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_FALSE; @@ -733,13 +733,13 @@ TX_THREAD *thread_ptr; #ifndef TX_NOT_INTERRUPTABLE _tx_thread_preempt_disable++; #endif - _tx_thread_system_suspend(&init_test_thread); + _tx_thread_system_suspend(&init_test_thread); _tx_thread_execute_ptr[0] = temp_thread; - + /* Test _tx_thread_system_resume when not current, suspending and in a COMPLETED state. */ temp_thread = _tx_thread_execute_ptr[0]; init_test_thread.tx_thread_state = TX_COMPLETED; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_new_time_slice = 0; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_TRUE; @@ -749,14 +749,14 @@ TX_THREAD *thread_ptr; _tx_thread_preempt_disable++; #endif _tx_thread_execute_ptr[0] = &init_test_thread; - _tx_thread_system_resume(&init_test_thread); + _tx_thread_system_resume(&init_test_thread); _tx_thread_execute_ptr[0] = temp_thread; - + /* Test _tx_thread_system_resume when not current, not suspending and already in a TX_READY state. */ temp_thread = _tx_thread_execute_ptr[0]; init_test_thread.tx_thread_state = TX_READY; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_new_time_slice = 0; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_FALSE; @@ -766,13 +766,13 @@ TX_THREAD *thread_ptr; _tx_thread_preempt_disable++; #endif _tx_thread_execute_ptr[0] = &init_test_thread; - _tx_thread_system_resume(&init_test_thread); + _tx_thread_system_resume(&init_test_thread); _tx_thread_execute_ptr[0] = temp_thread; /* Test _tx_thread_system_resume when not current, suspending and in a TERMINATED state. */ temp_thread = _tx_thread_execute_ptr[0]; init_test_thread.tx_thread_state = TX_TERMINATED; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_new_time_slice = 0; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_TRUE; @@ -782,9 +782,9 @@ TX_THREAD *thread_ptr; _tx_thread_preempt_disable++; #endif _tx_thread_execute_ptr[0] = &init_test_thread; - _tx_thread_system_resume(&init_test_thread); + _tx_thread_system_resume(&init_test_thread); _tx_thread_execute_ptr[0] = temp_thread; - + /* Test tx_thread_resume to test the saved_thread_ptr being NULL. */ temp_thread = _tx_thread_execute_ptr[0]; _tx_thread_execute_ptr[0] = TX_NULL; @@ -794,7 +794,7 @@ TX_THREAD *thread_ptr; /* Test preemption change when the new priority is the same as the threshold. */ init_test_thread.tx_thread_state = TX_SUSPENDED; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_new_time_slice = 0; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_FALSE; @@ -805,9 +805,9 @@ TX_THREAD *thread_ptr; init_test_thread.tx_thread_preempt_threshold = 10; init_test_thread.tx_thread_entry = test_thread_entry1; _tx_thread_preemption_change(&init_test_thread, 10, &old_preemption); - + #ifndef TX_NOT_INTERRUPTABLE - + /* Test semaphore cleanup with an invalid semaphore ID. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_semaphore; init_test_thread.tx_thread_suspend_cleanup = &(_tx_semaphore_cleanup); @@ -823,7 +823,7 @@ TX_THREAD *thread_ptr; cleanup_semaphore.tx_semaphore_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_semaphore_cleanup(&init_test_thread, 1); - + /* Test semaphore cleanup with a NULL semaphore pointer. */ init_test_thread.tx_thread_suspend_control_block = TX_NULL; init_test_thread.tx_thread_suspend_cleanup = &(_tx_semaphore_cleanup); @@ -871,7 +871,7 @@ TX_THREAD *thread_ptr; cleanup_queue.tx_queue_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_queue_cleanup(&init_test_thread, 1); - + /* Test queue cleanup with an valid queue ID but a suspension count of 0. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_queue; init_test_thread.tx_thread_suspend_cleanup = &(_tx_queue_cleanup); @@ -911,7 +911,7 @@ TX_THREAD *thread_ptr; cleanup_mutex.tx_mutex_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_mutex_cleanup(&init_test_thread, 1); - + /* Test mutex cleanup with an valid mutex ID but a suspension count of 0. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_mutex; init_test_thread.tx_thread_suspend_cleanup = &(_tx_mutex_cleanup); @@ -919,7 +919,7 @@ TX_THREAD *thread_ptr; cleanup_mutex.tx_mutex_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_mutex_cleanup(&init_test_thread, 0); - + /* Test event flag cleanup with a NULL cleanup pointer. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_event_flags; init_test_thread.tx_thread_suspend_cleanup = TX_NULL; @@ -943,7 +943,7 @@ TX_THREAD *thread_ptr; cleanup_event_flags.tx_event_flags_group_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_event_flags_cleanup(&init_test_thread, 0); - + /* Test event flag cleanup with an invalid suspension sequence. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_event_flags; init_test_thread.tx_thread_suspend_cleanup = &(_tx_event_flags_cleanup); @@ -959,7 +959,7 @@ TX_THREAD *thread_ptr; cleanup_event_flags.tx_event_flags_group_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_event_flags_cleanup(&init_test_thread, 0); - + /* Test block pool cleanup with a NULL cleanup pointer. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_block_pool; init_test_thread.tx_thread_suspend_cleanup = TX_NULL; @@ -991,7 +991,7 @@ TX_THREAD *thread_ptr; cleanup_block_pool.tx_block_pool_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_block_pool_cleanup(&init_test_thread, 1); - + /* Test block pool cleanup with an valid ID but a suspension count of 0. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_block_pool; init_test_thread.tx_thread_suspend_cleanup = &(_tx_block_pool_cleanup); @@ -1031,7 +1031,7 @@ TX_THREAD *thread_ptr; cleanup_byte_pool.tx_byte_pool_suspended_count = 0; init_test_thread.tx_thread_suspension_sequence = 0; _tx_byte_pool_cleanup(&init_test_thread, 1); - + /* Test byte pool cleanup with an valid ID but a suspension count of 0. */ init_test_thread.tx_thread_suspend_control_block = (VOID *) &cleanup_byte_pool; init_test_thread.tx_thread_suspend_cleanup = &(_tx_byte_pool_cleanup); @@ -1040,7 +1040,7 @@ TX_THREAD *thread_ptr; init_test_thread.tx_thread_suspension_sequence = 0; _tx_byte_pool_cleanup(&init_test_thread, 0); #endif - + #ifndef TX_ENABLE_EVENT_TRACE /* Call ISR trace events when trace is not enabled. */ @@ -1071,10 +1071,10 @@ TX_THREAD *thread_ptr; _tx_timer_delete(&test_timer); /* Test the stack analyze function with a dummy thread. */ - + /* Clear the test stack analyze flag. */ test_stack_analyze_flag = 0; - + /* Make a fake thread with a fake stack. */ test_thread2.tx_thread_id = TX_THREAD_ID; #if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING) @@ -1091,30 +1091,30 @@ TX_THREAD *thread_ptr; /* Set the fake thread stack to the fill pattern. */ test_thread2_stack[i] = TX_STACK_FILL; } - + /* Setup index to last point. */ i = (sizeof(test_thread2_stack)/sizeof(ULONG)) - 1; - + /* Setup the stack start and end pointers. */ test_thread2.tx_thread_stack_start = &(test_thread2_stack[0]); test_thread2.tx_thread_stack_end = &(test_thread2_stack[i]); test_thread2.tx_thread_stack_size = sizeof(test_thread2_stack); test_thread2.tx_thread_stack_highest_ptr = test_thread2.tx_thread_stack_end; test_thread2.tx_thread_stack_ptr = test_thread2.tx_thread_stack_start; - + /* Fill 20 words of stack. */ for (j = 0; j < 20; j++) { /* Fill the stack with 0s. */ test_thread2_stack[i--] = 0; } - + /* Call the analyze stack function. */ _tx_thread_stack_analyze(&test_thread2); - + /* Call it again for no change coverage. */ _tx_thread_stack_analyze(&test_thread2); - + /* Fill 99 words of stack. */ for (j = 0; j < 99; j++) { @@ -1124,40 +1124,40 @@ TX_THREAD *thread_ptr; /* Call the analyze stack function. */ _tx_thread_stack_analyze(&test_thread2); - + /* Call it again for no change coverage. */ _tx_thread_stack_analyze(&test_thread2); #ifndef TX_MANUAL_TEST - + /* Now set the flag to 1 to cause the thread ID to be cleared. */ test_stack_analyze_flag = 1; - + /* Call stack analyze with an ID that is cleared in the middle. */ _tx_thread_stack_analyze(&test_thread2); - + /* Restore the ID. */ test_thread2.tx_thread_id = TX_THREAD_ID; - + /* Now set the flag to 2 to cause the stack ptr to be equal to the start of the stack. */ test_stack_analyze_flag = 2; - + /* Call stack analyze with an ID that is cleared in the middle. */ _tx_thread_stack_analyze(&test_thread2); test_thread2.tx_thread_stack_highest_ptr = test_thread2.tx_thread_stack_end; /* Now set the flag to 3 to cause the stack pointer to not have the fill pattern. */ test_stack_analyze_flag = 3; - + /* Call stack analyze with an ID that is cleared in the middle. */ _tx_thread_stack_analyze(&test_thread2); #endif - + /* Test error condition on _tx_queue_flush. */ test_queue.tx_queue_enqueued = 1; test_queue.tx_queue_suspended_count = 1; test_queue.tx_queue_suspension_list = TX_NULL; - + /* Call _tx_queue_flush to test the thread NULL check. */ _tx_queue_flush(&test_queue); @@ -1168,8 +1168,8 @@ TX_THREAD *thread_ptr; /* Increment the preempt disable flag. */ _tx_thread_preempt_disable++; - - /* Build a thread control block with fake info. */ + + /* Build a thread control block with fake info. */ test_thread3.tx_thread_suspending = TX_TRUE; test_thread3.tx_thread_state = TX_SUSPENDED; test_thread3.tx_thread_delayed_suspend = TX_FALSE; @@ -1186,25 +1186,25 @@ TX_THREAD *thread_ptr; /* Increment the preempt disable flag. */ _tx_thread_preempt_disable++; - + /* Test block pool suspenson safeguard. */ fake_block_pool.tx_block_pool_available = 0; status = _tx_block_allocate(&fake_block_pool, (VOID **) &pointer, TX_WAIT_FOREVER); if (status != TX_NO_MEMORY) - test_control_system_errors++; + test_control_system_errors++; /* Test byte pool suspension safeguard. */ fake_byte_pool.tx_byte_pool_fragments = 2; fake_byte_pool.tx_byte_pool_available = 0; status = _tx_byte_allocate(&fake_byte_pool, (VOID **) &pointer, 1000, TX_WAIT_FOREVER); if (status != TX_NO_MEMORY) - test_control_system_errors++; + test_control_system_errors++; /* Test event flags suspension safeguard. */ fake_event_flags.tx_event_flags_group_current = 0; status = _tx_event_flags_get(&fake_event_flags, 1, TX_AND, &flags, TX_WAIT_FOREVER); if (status != TX_NO_EVENTS) - test_control_system_errors++; + test_control_system_errors++; /* Test mutex suspension safeguard. */ fake_mutex.tx_mutex_ownership_count = 1; @@ -1212,31 +1212,31 @@ TX_THREAD *thread_ptr; fake_mutex.tx_mutex_owner = &init_test_thread; status = _tx_mutex_get(&fake_mutex, TX_WAIT_FOREVER); if (status != TX_NOT_AVAILABLE) - test_control_system_errors++; + test_control_system_errors++; /* Test queue front send suspension safeguard. */ fake_queue.tx_queue_available_storage = 0; status = _tx_queue_front_send(&fake_queue, (VOID *) pointer, TX_WAIT_FOREVER); if (status != TX_QUEUE_FULL) - test_control_system_errors++; - + test_control_system_errors++; + /* Test queue receive suspension safeguard. */ fake_queue.tx_queue_enqueued = 0; status = _tx_queue_receive(&fake_queue, (VOID **) &pointer, TX_WAIT_FOREVER); if (status != TX_QUEUE_EMPTY) - test_control_system_errors++; + test_control_system_errors++; /* Test queue send suspension safeguard. */ fake_queue.tx_queue_available_storage = 0; status = _tx_queue_send(&fake_queue, (VOID *) pointer, TX_WAIT_FOREVER); if (status != TX_QUEUE_FULL) - test_control_system_errors++; - + test_control_system_errors++; + /* Test semaphore suspension safeguard. */ fake_semaphore.tx_semaphore_count = 0; status = _tx_semaphore_get(&fake_semaphore, TX_WAIT_FOREVER); if (status != TX_NO_INSTANCE) - test_control_system_errors++; + test_control_system_errors++; /* Test thread sleep suspension safeguard. */ _tx_thread_current_ptr[0] = &init_test_thread; @@ -1244,13 +1244,13 @@ TX_THREAD *thread_ptr; _tx_thread_system_state[0] = 0; status = _tx_thread_sleep(10); if (status != TX_CALLER_ERROR) - test_control_system_errors++; + test_control_system_errors++; /* Test thread suspend suspension safeguard. */ init_test_thread.tx_thread_state = TX_READY; status = _tx_thread_suspend(&init_test_thread); if (status != TX_SUSPEND_ERROR) - test_control_system_errors++; + test_control_system_errors++; _tx_thread_system_state[0] = temp; _tx_thread_current_ptr[0] = TX_NULL; @@ -1261,9 +1261,9 @@ TX_THREAD *thread_ptr; /* Move the test thread form core 0. */ tx_thread_smp_core_exclude(&test_thread, 0x1); - /* Restore the core exclusion for the test thread. */ + /* Restore the core exclusion for the test thread. */ tx_thread_smp_core_exclude(&test_thread, temp); - + /* Test some code paths in the tx_thread_smp_utilities file. */ temp_thread = _tx_thread_current_ptr[3]; _tx_thread_current_ptr[3] = &init_test_thread; @@ -1275,7 +1275,7 @@ TX_THREAD *thread_ptr; _tx_thread_execute_ptr[0] = temp_thread; _tx_thread_smp_schedule_list[0] = TX_NULL; _tx_thread_smp_remap_solution_find(&init_test_thread, 1, 1, 1); - + /* Test a corner case in time-slice change. */ init_test_thread.tx_thread_smp_core_mapped = TX_THREAD_SMP_MAX_CORES; _tx_thread_time_slice_change(&init_test_thread, 3, &old_time_slice); @@ -1298,7 +1298,7 @@ TX_THREAD *thread_ptr; _tx_timer_time_slice[2] = 0; _tx_timer_time_slice[3] = 1; _tx_thread_time_slice(); - + _tx_timer_time_slice[0] = 1; _tx_timer_time_slice[1] = 0; _tx_timer_time_slice[2] = 0; @@ -1317,14 +1317,14 @@ TX_THREAD *thread_ptr; _tx_thread_current_ptr[0] = temp_thread; _tx_thread_time_slice(); _tx_thread_current_ptr[0] = TX_NULL; - + /* Decrement the preempt disable flag. */ _tx_thread_preempt_disable--; } -/* Define the test control thread. This thread is responsible for dispatching all of the +/* Define the test control thread. This thread is responsible for dispatching all of the tests in the ThreadX test suite. */ void test_control_thread_entry(ULONG thread_input) @@ -1363,7 +1363,7 @@ UINT i; /* Suspend control test to allow test to run. */ tx_thread_suspend(&test_control_thread); - + /* Test finished, cleanup in preparation for the next test. */ test_control_cleanup(); } @@ -1375,7 +1375,7 @@ UINT i; exit(test_control_failed_tests + test_control_system_errors); #else external_exit(test_control_failed_tests + test_control_system_errors); -#endif +#endif } @@ -1404,11 +1404,11 @@ UINT old_posture = TX_INT_ENABLE; /* Get protection for examination of preempt disable and system state variables. */ TX_DISABLE - + /* Is preempt disable flag set? */ if (_tx_thread_preempt_disable) { - + /* System error - preempt disable should never be set inside of a thread! */ printf(" ***** SYSTEM ERROR ***** _tx_thread_preempt_disable is non-zero!\n"); test_control_system_errors++; @@ -1417,7 +1417,7 @@ UINT old_posture = TX_INT_ENABLE; /* Is system state set? */ if (_tx_thread_system_state[0]) { - + /* System error - system state should never be set inside of a thread! */ printf(" ***** SYSTEM ERROR ***** _tx_thread_system_state is non-zero!\n"); test_control_system_errors++; @@ -1426,10 +1426,10 @@ UINT old_posture = TX_INT_ENABLE; /* Release protection. */ TX_RESTORE - /* Are interrupts disabled? */ + /* Are interrupts disabled? */ if (old_posture == TX_INT_DISABLE) { - + /* System error - interrupts should alwasy be enabled in our test threads! */ printf(" ***** SYSTEM ERROR ***** test returned with interrupts disabled!\n"); test_control_system_errors++; @@ -1580,16 +1580,16 @@ void test_thread_entry(ULONG thread_input) /* Suspend this thread but with preemption disabled, so we will actually return. */ _tx_thread_preempt_disable++; tx_thread_suspend(&test_thread); - + /* Now perform a fake thread resume to cause preemption and exercise the path in _tx_thread_system_resume that returns to the scheduler. */ init_test_thread.tx_thread_state = TX_TERMINATED; - init_test_thread.tx_thread_suspend_cleanup = TX_NULL; + init_test_thread.tx_thread_suspend_cleanup = TX_NULL; init_test_thread.tx_thread_new_time_slice = 0; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_suspending = TX_TRUE; init_test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; init_test_thread.tx_thread_entry = test_thread_entry1; - _tx_thread_system_resume(&init_test_thread); + _tx_thread_system_resume(&init_test_thread); #ifdef TX_NOT_INTERRUPTABLE _tx_thread_preempt_disable--; #endif @@ -1607,7 +1607,7 @@ void test_exit_notify(TX_THREAD *thread_ptr, UINT type) { /* Clear the suspending flag to short-circuit the suspension. */ - thread_ptr -> tx_thread_suspending = TX_FALSE; + thread_ptr -> tx_thread_suspending = TX_FALSE; } __attribute__((weak)) void abort_all_threads_suspended_on_mutex(void) |
