diff options
| author | Frédéric Desbiens <[email protected]> | 2026-03-06 19:27:49 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-06 19:27:49 +0100 |
| commit | 3726d7906b4808bfec7855fc088e073199df9120 (patch) | |
| tree | 8789bfd03d1d49e1967e80d04aa4ff606fda43eb /test/tx | |
| parent | 4b6e8100d932a3a67b34c6eb17f84f3bffb9e2ae (diff) | |
| parent | c3259a216026372e3833dd8996a68f77e8595fbd (diff) | |
Merge pull request #510 from eclipse-threadx/devv6.5.0.202601_rel
Merge changes ahead of the v6.5.0.202601 release
Diffstat (limited to 'test/tx')
97 files changed, 1874 insertions, 1874 deletions
diff --git a/test/tx/regression/testcontrol.c b/test/tx/regression/testcontrol.c index 8203ece5..3d33bc7f 100644 --- a/test/tx/regression/testcontrol.c +++ b/test/tx/regression/testcontrol.c @@ -21,7 +21,7 @@ #error "THREADX_MAJOR_VERSION" #endif /* Check THREADX_MAJOR_VERSION */ -#if defined(EXPECTED_MINOR_VERSION) && ( !defined(THREADX_MINOR_VERSION) || THREADX_MINOR_VERSION != EXPECTED_MINOR_VERSION) +#if defined(EXPECTED_MINOR_VERSION) && ( !defined(THREADX_MINOR_VERSION) || THREADX_MINOR_VERSION != EXPECTED_MINOR_VERSION) #error "THREADX_MINOR_VERSION" #endif /* Check THREADX_MINOR_VERSION */ @@ -64,7 +64,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; @@ -236,7 +236,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, @@ -256,7 +256,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, @@ -339,14 +339,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 @@ -411,7 +411,7 @@ void test_interrupt_dispatch(void) if (test_isr_dispatch) { - (test_isr_dispatch)(); + (test_isr_dispatch)(); } } @@ -449,7 +449,7 @@ void main() /* Test the pre-initialize path through _tx_initialize_kernel_enter. */ _tx_thread_system_state = 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; @@ -490,29 +490,29 @@ TX_THREAD *thread_ptr; test_control_system_errors = 0; /* 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); @@ -531,26 +531,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); @@ -561,7 +561,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; @@ -571,12 +571,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 = &init_test_thread; + _tx_thread_current_ptr = &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; @@ -592,7 +592,7 @@ TX_THREAD *thread_ptr; temp_thread = _tx_thread_execute_ptr; _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; @@ -601,15 +601,15 @@ TX_THREAD *thread_ptr; _tx_thread_current_ptr = &init_test_thread; _tx_thread_execute_ptr = &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 = TX_NULL; _tx_thread_execute_ptr = 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; 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; @@ -619,13 +619,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 = temp_thread; - + /* Test _tx_thread_system_resume when not current, suspending and in a COMPLETED state. */ temp_thread = _tx_thread_execute_ptr; 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; @@ -633,14 +633,14 @@ TX_THREAD *thread_ptr; init_test_thread.tx_thread_entry = test_thread_entry1; _tx_thread_preempt_disable++; _tx_thread_execute_ptr = &init_test_thread; - _tx_thread_system_resume(&init_test_thread); + _tx_thread_system_resume(&init_test_thread); _tx_thread_execute_ptr = 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; 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; @@ -648,13 +648,13 @@ TX_THREAD *thread_ptr; init_test_thread.tx_thread_entry = test_thread_entry1; _tx_thread_preempt_disable++; _tx_thread_execute_ptr = &init_test_thread; - _tx_thread_system_resume(&init_test_thread); + _tx_thread_system_resume(&init_test_thread); _tx_thread_execute_ptr = temp_thread; /* Test _tx_thread_system_resume when not current, suspending and in a TERMINATED state. */ temp_thread = _tx_thread_execute_ptr; 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; @@ -662,9 +662,9 @@ TX_THREAD *thread_ptr; init_test_thread.tx_thread_entry = test_thread_entry1; _tx_thread_preempt_disable++; _tx_thread_execute_ptr = &init_test_thread; - _tx_thread_system_resume(&init_test_thread); + _tx_thread_system_resume(&init_test_thread); _tx_thread_execute_ptr = temp_thread; - + /* Test tx_thread_resume to test the saved_thread_ptr being NULL. */ temp_thread = _tx_thread_execute_ptr; _tx_thread_execute_ptr = TX_NULL; @@ -674,7 +674,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; @@ -685,9 +685,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); @@ -703,7 +703,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); @@ -751,7 +751,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); @@ -791,7 +791,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); @@ -799,7 +799,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; @@ -823,7 +823,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); @@ -839,7 +839,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; @@ -871,7 +871,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); @@ -911,7 +911,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); @@ -920,7 +920,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. */ @@ -945,10 +945,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) @@ -965,30 +965,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++) { @@ -998,40 +998,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); @@ -1042,8 +1042,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; @@ -1060,25 +1060,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; @@ -1086,31 +1086,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 = &init_test_thread; @@ -1118,24 +1118,24 @@ TX_THREAD *thread_ptr; _tx_thread_system_state = 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 = temp; _tx_thread_current_ptr = 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) @@ -1174,7 +1174,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(); } @@ -1186,7 +1186,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 } @@ -1210,11 +1210,11 @@ UINT old_posture = TX_INT_ENABLE; test_control_successful_tests++; /* Now check for system errors. */ - + /* 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++; @@ -1223,16 +1223,16 @@ UINT old_posture = TX_INT_ENABLE; /* Is system state set? */ if (_tx_thread_system_state) { - + /* 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++; } - /* 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++; @@ -1383,18 +1383,18 @@ 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); - /* We should not get back here! */ + /* We should not get back here! */ } @@ -1409,7 +1409,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; } diff --git a/test/tx/regression/threadx_block_memory_basic_test.c b/test/tx/regression/threadx_block_memory_basic_test.c index 5f2afa01..12e301d1 100644 --- a/test/tx/regression/threadx_block_memory_basic_test.c +++ b/test/tx/regression/threadx_block_memory_basic_test.c @@ -1,4 +1,4 @@ -/* This test is designed to test simple memory block pool creation, deletion, and +/* This test is designed to test simple memory block pool creation, deletion, and allocates and releases. */ #include <stdio.h> @@ -79,7 +79,7 @@ CHAR *pointer; /* Determine if calling block pool create from initialization was successful. */ if (test_block_pool_create_init != TX_SUCCESS) { - + /* Error! */ error++; } @@ -87,7 +87,7 @@ CHAR *pointer; /* Attempt to create a block pool from a timer. */ pointer = (CHAR *) 0x30000; status = tx_block_pool_create(&pool_3, "pool 3", 100, pointer, 320); - + /* Check status. */ if (status != TX_CALLER_ERROR) { @@ -98,7 +98,7 @@ CHAR *pointer; /* Attempt to delete a block pool. */ status = tx_block_pool_delete(&pool_0); - + /* Check status. */ if (status != TX_CALLER_ERROR) { @@ -106,7 +106,7 @@ CHAR *pointer; /* Error! */ error++; } - + timer_executed = 1; /* Attempt to allocate a block with suspension from a timer. */ @@ -190,8 +190,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -203,8 +203,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -278,7 +278,7 @@ unsigned long fake_block[20]; block_memory.second_middle= 0x61718191; block_memory.next_to_last = 0x99aabbcc; block_memory.last = 0xddeeff00; - + /* Create the block pool. */ status = tx_block_pool_create(&block_memory.pool, "pool memory", 16, &block_memory.pool_area[0], (2048*sizeof(ULONG))/sizeof(ULONG)); tx_block_pool_delete(&block_memory.pool); @@ -304,7 +304,7 @@ unsigned long fake_block[20]; fake_block[0] = 0; fake_block[1] = 0; status = tx_block_release(&fake_block[2]); - + /* Check status. */ if (status != TX_PTR_ERROR) { @@ -318,7 +318,7 @@ unsigned long fake_block[20]; fake_block[0] = 0; fake_block[1] = (unsigned long) &fake_block[0]; status = tx_block_release(&fake_block[2]); - + /* Check status. */ if (status != TX_PTR_ERROR) { @@ -328,7 +328,7 @@ unsigned long fake_block[20]; test_control_return(1); } #endif - + /* Allocate first block from the pool. */ status = tx_block_allocate(&pool_0, (VOID **) &pointer_1, TX_NO_WAIT); @@ -504,10 +504,10 @@ unsigned long fake_block[20]; /* Sleep for a bit... */ tx_thread_sleep(3); - + /* Now resume the background thread. */ tx_thread_resume(&thread_1); - + /* Sleep for a bit... */ tx_thread_sleep(3); @@ -517,7 +517,7 @@ unsigned long fake_block[20]; /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Block memory error. */ printf("ERROR #20\n"); test_control_return(1); @@ -549,7 +549,7 @@ unsigned long fake_block[20]; } else { - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); @@ -562,7 +562,7 @@ static void thread_1_entry(ULONG thread_input) while(1) { - - tx_thread_relinquish(); + + tx_thread_relinquish(); } } diff --git a/test/tx/regression/threadx_block_memory_error_detection_test.c b/test/tx/regression/threadx_block_memory_error_detection_test.c index de28012f..7b7f2f61 100644 --- a/test/tx/regression/threadx_block_memory_error_detection_test.c +++ b/test/tx/regression/threadx_block_memory_error_detection_test.c @@ -1,5 +1,5 @@ /* This test is designed to test error detection for simple memory block operations. */ - + #include <stdio.h> #include "tx_api.h" @@ -43,8 +43,8 @@ INT status; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -160,7 +160,7 @@ INT i; printf("ERROR #8\n"); test_control_return(1); } - + /* Allocate with bad pool pointer. */ pool_2.tx_block_pool_id = 0; status = tx_block_allocate(&pool_2, (VOID **) TX_NULL, TX_NO_WAIT); @@ -379,7 +379,7 @@ INT i; thread_0_counter++; #endif /* TX_DISABLE_ERROR_CHECKING */ - + /* All is good! */ printf("SUCCESS!\n"); test_control_return(0); diff --git a/test/tx/regression/threadx_block_memory_information_test.c b/test/tx/regression/threadx_block_memory_information_test.c index d6416bc2..20e34d88 100644 --- a/test/tx/regression/threadx_block_memory_information_test.c +++ b/test/tx/regression/threadx_block_memory_information_test.c @@ -39,7 +39,7 @@ static TX_THREAD thread_6; static TX_BLOCK_POOL block_pool_0; static TX_BLOCK_POOL block_pool_2; -#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO +#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO static TX_BLOCK_POOL block_pool_1; #endif @@ -57,8 +57,8 @@ static void thread_5_entry(ULONG thread_input); static void thread_6_entry(ULONG thread_input); /* Direct core function to bypass the error checking shell. */ -UINT _tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks, - ULONG *total_blocks, TX_THREAD **first_suspended, +UINT _tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks, + ULONG *total_blocks, TX_THREAD **first_suspended, ULONG *suspended_count, TX_BLOCK_POOL **next_pool); /* Prototype for test control return. */ @@ -78,7 +78,7 @@ static void test_isr(void) tx_thread_wait_abort(&thread_3); /* End the ISR processing. */ - test_status = 2; + test_status = 2; test_isr_dispatch = TX_NULL; } } @@ -103,8 +103,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -116,8 +116,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -129,8 +129,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -142,8 +142,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -155,8 +155,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -168,8 +168,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -181,8 +181,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -197,7 +197,7 @@ CHAR *pointer; /* Create the block_pool with one block. */ status = tx_block_pool_create(&block_pool_0, "block_pool 0", 30, pointer, 40); pointer = pointer + 40; - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -282,7 +282,7 @@ ULONG timeouts; tx_thread_resume(&thread_4); tx_thread_resume(&thread_5); tx_thread_resume(&thread_6); - + /* Prioritize the block pool suspension list. */ status = tx_block_pool_prioritize(&block_pool_0); @@ -294,10 +294,10 @@ ULONG timeouts; printf("ERROR #12\n"); test_control_return(1); } - + /* Now loop to test the interrupt of the prioritize loop logic. */ test_status = 1; - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; do { @@ -314,10 +314,10 @@ ULONG timeouts; } } while (test_status == 1); - + /* Now determine if thread 4 is at the front of the list... It should be! */ if (block_pool_0.tx_block_pool_suspension_list != &thread_4) - { + { /* Block Pool error. */ printf("ERROR #14\n"); @@ -352,13 +352,13 @@ ULONG timeouts; } #endif - + /* Now use the information services in order to test them. */ status = tx_block_pool_info_get(&block_pool_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_block_pool_info_get(&block_pool_0, &name, &available, &total_blocks, &first_suspended, &suspended_count, &next_pool); - + /* Check for an error condition. */ - if ((status) || (available != block_pool_0.tx_block_pool_available) || (total_blocks != block_pool_0.tx_block_pool_total) || + if ((status) || (available != block_pool_0.tx_block_pool_available) || (total_blocks != block_pool_0.tx_block_pool_total) || (first_suspended != &thread_4) || (suspended_count != block_pool_0.tx_block_pool_suspended_count) || (next_pool != &block_pool_0)) { @@ -367,11 +367,11 @@ ULONG timeouts; test_control_return(1); } -#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO +#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO /* Call the core block pool info get function with a NULL pointer. */ status = _tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check for the proper error code. */ if (status != TX_PTR_ERROR) { @@ -383,7 +383,7 @@ ULONG timeouts; /* Call the core block pool info get function with a non-initialized pool. */ status = _tx_block_pool_performance_info_get(&block_pool_1, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check for the proper error code. */ if (status != TX_PTR_ERROR) { @@ -396,11 +396,11 @@ ULONG timeouts; /* Now get the pool performance information. */ status = tx_block_pool_performance_info_get(&block_pool_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_block_pool_performance_info_get(&block_pool_0, &allocates, &releases, &suspensions, &timeouts); - + /* Check for an error condition. */ - if ((status) || (allocates != block_pool_0.tx_block_pool_performance_allocate_count) || - (releases != block_pool_0.tx_block_pool_performance_release_count) || - (suspensions != block_pool_0.tx_block_pool_performance_suspension_count) || + if ((status) || (allocates != block_pool_0.tx_block_pool_performance_allocate_count) || + (releases != block_pool_0.tx_block_pool_performance_release_count) || + (suspensions != block_pool_0.tx_block_pool_performance_suspension_count) || (timeouts != block_pool_0.tx_block_pool_performance_timeout_count)) { @@ -412,9 +412,9 @@ ULONG timeouts; /* Now get the system pool performance information. */ status = tx_block_pool_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_block_pool_performance_system_info_get(&allocates, &releases, &suspensions, &timeouts); - + /* Check for an error condition. */ - if ((status) || (allocates != _tx_block_pool_performance_allocate_count) || (releases != _tx_block_pool_performance_release_count) || + if ((status) || (allocates != _tx_block_pool_performance_allocate_count) || (releases != _tx_block_pool_performance_release_count) || (suspensions != _tx_block_pool_performance_suspension_count) || (timeouts != _tx_block_pool_performance_timeout_count)) { @@ -433,7 +433,7 @@ ULONG timeouts; /* Call the block pool performance info get function. */ status = tx_block_pool_performance_info_get(&block_pool_0, &allocates, &releases, &suspensions, &timeouts); - + /* Check for the proper error code. */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -445,7 +445,7 @@ ULONG timeouts; /* Call the block pool performance info get function. */ status = tx_block_pool_performance_info_get(TX_NULL, &allocates, &releases, &suspensions, &timeouts); - + /* Check for the proper error code. */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -457,7 +457,7 @@ ULONG timeouts; /* Call the block pool performance info get function. */ status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, &releases, &suspensions, &timeouts); - + /* Check for the proper error code. */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -469,7 +469,7 @@ ULONG timeouts; /* Call the block pool performance info get function. */ status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, &suspensions, &timeouts); - + /* Check for the proper error code. */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -481,7 +481,7 @@ ULONG timeouts; /* Call the block pool performance info get function. */ status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts); - + /* Check for the proper error code. */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -493,7 +493,7 @@ ULONG timeouts; /* Call the block pool performance info get function. */ status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check for the proper error code. */ if (status != TX_FEATURE_NOT_ENABLED) { diff --git a/test/tx/regression/threadx_block_memory_prioritize_test.c b/test/tx/regression/threadx_block_memory_prioritize_test.c index 274daa01..6238aef8 100644 --- a/test/tx/regression/threadx_block_memory_prioritize_test.c +++ b/test/tx/regression/threadx_block_memory_prioritize_test.c @@ -76,12 +76,12 @@ static void test_isr(void) } else { - + /* Abort the wait of thread 5. */ tx_thread_wait_abort(&thread_5); /* End the ISR processing. */ - test_status = 2; + test_status = 2; test_isr_dispatch = TX_NULL; } } @@ -107,8 +107,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -120,8 +120,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -133,8 +133,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -146,8 +146,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -159,8 +159,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -172,8 +172,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -185,8 +185,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -201,7 +201,7 @@ CHAR *pointer; /* Create the block_pool with one block. */ status = tx_block_pool_create(&block_pool_0, "block_pool 0", 30, pointer, 40); pointer = pointer + 40; - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -229,7 +229,7 @@ VOID *pointer; /* Attempt to prioritize with a NULL pointer. */ status = tx_block_pool_prioritize(TX_NULL); - + /* Check for an error condition. */ if (status != TX_POOL_ERROR) { @@ -242,7 +242,7 @@ VOID *pointer; /* Attempt to prioritize with a bad pool pointer. */ block_pool_1.tx_block_pool_id = 0; status = tx_block_pool_prioritize(&block_pool_1); - + /* Check for an error condition. */ if (status != TX_POOL_ERROR) { @@ -296,7 +296,7 @@ VOID *pointer; printf("ERROR #13\n"); test_control_return(1); } - + /* Call block pool prioritize again to test the don't-do-anything path in tx_block_pool_prioritize. */ status += tx_block_pool_prioritize(&block_pool_0); @@ -307,7 +307,7 @@ VOID *pointer; tx_thread_resume(&thread_4); tx_thread_resume(&thread_5); tx_thread_resume(&thread_6); - + /* Prioritize the block pool suspension list. */ status = tx_block_pool_prioritize(&block_pool_0); @@ -319,10 +319,10 @@ VOID *pointer; printf("ERROR #14\n"); test_control_return(1); } - + /* Now loop to test the interrupt of the prioritize loop logic. */ test_status = 1; - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; do { @@ -339,10 +339,10 @@ VOID *pointer; } } while (test_status == 1); - + /* Now determine if thread 4 is at the front of the list... It should be! */ if (block_pool_0.tx_block_pool_suspension_list != &thread_4) - { + { /* Block Pool error. */ printf("ERROR #16\n"); diff --git a/test/tx/regression/threadx_block_memory_suspension_test.c b/test/tx/regression/threadx_block_memory_suspension_test.c index 6f2d635c..da14f454 100644 --- a/test/tx/regression/threadx_block_memory_suspension_test.c +++ b/test/tx/regression/threadx_block_memory_suspension_test.c @@ -43,8 +43,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -56,8 +56,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -69,8 +69,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -186,7 +186,7 @@ CHAR *pointer_3; } /* At this point the other thread has run and there is one block free. */ - + /* Get the last block again. */ status = tx_block_allocate(&pool_0, (VOID **) &pointer_3, TX_NO_WAIT); @@ -201,13 +201,13 @@ CHAR *pointer_3; /* Set all the memory of the blocks. */ TX_MEMSET(pointer_3, (CHAR) 0xEF, 100); - + /* Resume the second thread. */ tx_thread_resume(&thread_2); - + /* Let both threads suspend on the block pool via relinquish. */ tx_thread_relinquish(); - + /* Now release the block. */ status = tx_block_release(pointer_3); @@ -219,13 +219,13 @@ CHAR *pointer_3; printf("ERROR #10\n"); test_control_return(1); } - + /* Let thread 1 release the block. */ tx_thread_relinquish(); - + /* Let thread 2 get the block and release the block. */ tx_thread_relinquish(); - + /* Check status and run counter. */ if ((thread_1_counter != 3) || (thread_2_counter != 1)) { diff --git a/test/tx/regression/threadx_block_memory_suspension_timeout_test.c b/test/tx/regression/threadx_block_memory_suspension_timeout_test.c index f290f01a..dc460662 100644 --- a/test/tx/regression/threadx_block_memory_suspension_timeout_test.c +++ b/test/tx/regression/threadx_block_memory_suspension_timeout_test.c @@ -44,8 +44,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -57,8 +57,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -70,8 +70,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -116,7 +116,7 @@ CHAR *pointer_3; status = tx_block_allocate(&pool_0, (VOID **) &pointer_1, TX_NO_WAIT); status += tx_block_allocate(&pool_0, (VOID **) &pointer_2, TX_NO_WAIT); status += tx_block_allocate(&pool_0, (VOID **) &pointer_3, TX_NO_WAIT); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -152,7 +152,7 @@ CHAR *pointer_3; } else { - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); diff --git a/test/tx/regression/threadx_block_memory_thread_terminate_test.c b/test/tx/regression/threadx_block_memory_thread_terminate_test.c index c9221af9..6064891d 100644 --- a/test/tx/regression/threadx_block_memory_thread_terminate_test.c +++ b/test/tx/regression/threadx_block_memory_thread_terminate_test.c @@ -42,8 +42,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -55,8 +55,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -101,7 +101,7 @@ CHAR *pointer_3; status = tx_block_allocate(&pool_0, (VOID **) &pointer_1, TX_NO_WAIT); status += tx_block_allocate(&pool_0, (VOID **) &pointer_2, TX_NO_WAIT); status += tx_block_allocate(&pool_0, (VOID **) &pointer_3, TX_NO_WAIT); - + /* Increment the run counter. */ thread_0_counter++; @@ -118,7 +118,7 @@ CHAR *pointer_3; TX_MEMSET(pointer_1, (CHAR) 0xEF, 100); TX_MEMSET(pointer_2, (CHAR) 0xEF, 100); TX_MEMSET(pointer_3, (CHAR) 0xEF, 100); - + /* Let other thread suspend on block pool. */ tx_thread_relinquish(); diff --git a/test/tx/regression/threadx_byte_memory_basic_test.c b/test/tx/regression/threadx_byte_memory_basic_test.c index 9fffc840..36f41331 100644 --- a/test/tx/regression/threadx_byte_memory_basic_test.c +++ b/test/tx/regression/threadx_byte_memory_basic_test.c @@ -1,4 +1,4 @@ -/* This test is designed to test simple memory byte pool creation, deletion, and +/* This test is designed to test simple memory byte pool creation, deletion, and allocates and releases. */ #include <stdio.h> @@ -84,7 +84,7 @@ CHAR *pointer; /* Determine if calling byte pool create from initialization was successful. */ if (test_byte_pool_create_init != TX_SUCCESS) { - + /* Error! */ error++; } @@ -92,7 +92,7 @@ CHAR *pointer; /* Attempt to create a byte pool from a timer. */ pointer = (CHAR *) 0x30000; status = tx_byte_pool_create(&pool_2, "pool 2", pointer, 108); - + /* Check status. */ if (status != TX_CALLER_ERROR) { @@ -138,14 +138,14 @@ CHAR *pointer; /* Attempt to release byte memory from timer. */ pointer = (CHAR *) 0x30000; status = tx_byte_release(pointer); - + /* Check for error status! */ if (status != TX_CALLER_ERROR) { - + /* Error! */ error++; - } + } timer_executed = 1; #endif @@ -209,14 +209,14 @@ UINT status; /* Attempt to release byte memory from ISR. */ pointer = (CHAR *) 0x30000; status = tx_byte_release(pointer); - + /* Check for error status! */ if (status != TX_CALLER_ERROR) { - + /* Error! */ error++; - } + } isr_executed = 1; #endif @@ -235,15 +235,15 @@ void threadx_byte_memory_basic_application_define(void *first_unused_memory) UINT status; CHAR *pointer; - + /* Put first available memory address into a character pointer. */ pointer = (CHAR *) first_unused_memory; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -290,44 +290,44 @@ CHAR *pointer; printf("Running Byte Memory Basic Test...................................... ERROR #3a\n"); test_control_return(1); } - + /* Allocate first block. */ status += tx_byte_allocate(&pool_4, (VOID **) &block_0, 80, TX_NO_WAIT); - + /* Save next search pointer. */ search_ptr_1 = pool_4.tx_byte_pool_search; - + /* Clear the allocatged memory. */ TX_MEMSET(block_0, 0, 80); - + /* Allocate another block. */ status += tx_byte_allocate(&pool_4, (VOID **) &block_1, 80, TX_NO_WAIT); - + /* Clear the allocated block. */ TX_MEMSET(block_1, 0, 80); - + /* Allocate the third and final block. */ status += tx_byte_allocate(&pool_4, (VOID **) &block_2, 80, TX_NO_WAIT); - + /* Clear the allocated block. */ TX_MEMSET(block_2, 0, 80); /* Release the first block. */ status += tx_byte_release(block_0); - + /* Release the second block. */ status += tx_byte_release(block_1); - + /* Manually move the search pointer to create the case where the search wraps and a merge happens on the search pointer necessitating its update. */ pool_4.tx_byte_pool_search = search_ptr_1; /* Point to the middle block. */ /* Allocate a larger block that will wrap the search and require moving as well as an update of the search pointer. */ status += tx_byte_allocate(&pool_4, (VOID **) &block_3, 120, TX_NO_WAIT); - - /* Clear the newly allocated block. */ + + /* Clear the newly allocated block. */ TX_MEMSET(block_3, 0, 120); - + /* At this point, verify the search pointer was properly updated in the previous allocation. */ status += tx_byte_allocate(&pool_4, (VOID **) &block_4, 40, TX_NO_WAIT); /* Should fail since search pointer is now invalid! */ @@ -367,7 +367,7 @@ UCHAR *save_search; byte_memory.second_middle= 0x61718191; byte_memory.next_to_last = 0x99aabbcc; byte_memory.last = 0xddeeff00; - + /* Create the byte pool. */ status = tx_byte_pool_create(&byte_memory.pool, "pool memory", &byte_memory.pool_area[0], (2048*sizeof(ULONG))/sizeof(ULONG)); tx_byte_pool_delete(&byte_memory.pool); @@ -477,7 +477,7 @@ UCHAR *save_search; printf("ERROR #11\n"); test_control_return(1); } - + /* Test non-created pool pointer. */ pool_2.tx_byte_pool_id = 0; status = tx_byte_allocate(&pool_2, (VOID **) &pointer_1, 24, TX_NO_WAIT); @@ -530,15 +530,15 @@ UCHAR *save_search; /* Test NULL pointer release. */ status = tx_byte_release(TX_NULL); - + /* Check for error status! */ if (status != TX_PTR_ERROR) { - + /* Byte memory error. */ printf("ERROR #16\n"); test_control_return(1); - } + } /* Allocate memory from the pool. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer_1, 24, TX_NO_WAIT); @@ -599,30 +599,30 @@ UCHAR *save_search; /* Test the byte release with a bad block pointer. */ status = _tx_byte_release(TX_NULL); - + /* Check for error status! */ if (status != TX_PTR_ERROR) { - + /* Byte memory error. */ printf("ERROR #21\n"); test_control_return(1); - } + } /* Test another bad block release... no pool pointer! */ array[0] = 0; array[1] = 0; array[2] = 0; status = _tx_byte_release(&array[2]); - + /* Check for error status! */ if (status != TX_PTR_ERROR) { - + /* Byte memory error. */ printf("ERROR #22\n"); test_control_return(1); - } + } /* Test another bad block release.... pool pointer is not a valid pool! */ array[0] = 0; @@ -630,16 +630,16 @@ UCHAR *save_search; array[2] = 0; array[3] = 0; status = _tx_byte_release(&array[2]); - + /* Check for error status! */ if (status != TX_PTR_ERROR) { - + /* Byte memory error. */ printf("ERROR #22\n"); test_control_return(1); - } - + } + /* Now release each of the blocks. */ status = tx_byte_release(pointer_1); @@ -776,7 +776,7 @@ UCHAR *save_search; test_control_return(1); } - /* Now allocate a block that should cause all of the blocks to merge + /* Now allocate a block that should cause all of the blocks to merge together. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer_3, 88, TX_NO_WAIT); @@ -813,9 +813,9 @@ UCHAR *save_search; printf("ERROR #36\n"); test_control_return(1); } - + /* Now ensure the search pointer update in the byte search algorithm is updated. */ - + /* Allocate memory from the pool. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer_1, 24, TX_NO_WAIT); @@ -851,10 +851,10 @@ UCHAR *save_search; printf("ERROR #39\n"); test_control_return(1); } - + /* Release the middle block. */ - status = tx_byte_release(pointer_2); - + status = tx_byte_release(pointer_2); + /* Check status. */ if (status != TX_SUCCESS) { @@ -883,7 +883,7 @@ UCHAR *save_search; status = tx_byte_release(pointer_3); status += tx_byte_release(pointer_2); status += tx_byte_release(pointer_1); - + /* Move the search pointer to the third block to exercise that code in the byte search algorithm. */ pool_0.tx_byte_pool_search = (UCHAR *) pointer_3-8; @@ -898,8 +898,8 @@ UCHAR *save_search; printf("ERROR #42\n"); test_control_return(1); } - - + + #ifndef TX_DISABLE_ERROR_CHECKING /* Create a timer for the test. */ @@ -917,14 +917,14 @@ UCHAR *save_search; /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Byte memory error. */ printf("ERROR #43\n"); test_control_return(1); } #endif - + /* Delete both byte pools. */ status = tx_byte_pool_delete(&pool_0); @@ -950,7 +950,7 @@ UCHAR *save_search; /* Delete pool 4. */ status = tx_byte_pool_delete(&pool_4); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -959,10 +959,10 @@ UCHAR *save_search; printf("ERROR #46\n"); test_control_return(1); } - + /* Create pool 4. */ status = tx_byte_pool_create(&pool_4, "pool 4", pool_4_memory, 300); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -985,15 +985,15 @@ UCHAR *save_search; printf("ERROR #48\n"); test_control_return(1); } - + /* At this point, there should be three allocated blocks and the reserved block at the end. */ - + /* Now release all the blocks in reverse order. This should leave the search pointer at the last block. */ status = tx_byte_release(pointer_3); save_search = pool_4.tx_byte_pool_search; status += tx_byte_release(pointer_2); status += tx_byte_release(pointer_1); - + /* Move the search pointer back to the last block. */ pool_4.tx_byte_pool_search = save_search; @@ -1004,12 +1004,12 @@ UCHAR *save_search; /* Byte memory error. */ printf("ERROR #49\n"); test_control_return(1); - } + } - /* Now attempt to allocate a block that requires a merge, which should exercise the branch in byte search that does not + /* Now attempt to allocate a block that requires a merge, which should exercise the branch in byte search that does not result in a search pointer change. */ status = tx_byte_allocate(&pool_4, (VOID **) &pointer_1, 168, TX_NO_WAIT); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -1017,21 +1017,21 @@ UCHAR *save_search; /* Byte memory error. */ printf("ERROR #50\n"); test_control_return(1); - } - + } + /* Release the last block. */ status = tx_byte_release(pointer_1); - + /* Allocate all the blocks. */ status = tx_byte_allocate(&pool_4, (VOID **) &pointer_1, 84, TX_NO_WAIT); status += tx_byte_allocate(&pool_4, (VOID **) &pointer_2, 84, TX_NO_WAIT); status += tx_byte_allocate(&pool_4, (VOID **) &pointer_3, 84, TX_NO_WAIT); - + /* Release all of the blocks in order. */ status += tx_byte_release(pointer_1); status += tx_byte_release(pointer_2); status += tx_byte_release(pointer_3); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -1039,7 +1039,7 @@ UCHAR *save_search; /* Byte memory error. */ printf("ERROR #50\n"); test_control_return(1); - } + } /* Now setup a special test to exercise the examine blocks equal to 0 path in the byte pool search. */ pool_4.tx_byte_pool_search = save_search; @@ -1047,7 +1047,7 @@ UCHAR *save_search; /* Call byte allocate to execise the examine blocks equal to 0 path on non-merge block condition. */ status = tx_byte_allocate(&pool_4, (VOID **) &pointer_1, 168, TX_NO_WAIT); - + /* Check status. */ if (status != TX_NO_MEMORY) { @@ -1055,8 +1055,8 @@ UCHAR *save_search; /* Byte memory error. */ printf("ERROR #51\n"); test_control_return(1); - } - + } + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); diff --git a/test/tx/regression/threadx_byte_memory_information_test.c b/test/tx/regression/threadx_byte_memory_information_test.c index 2d1c20bc..8a619269 100644 --- a/test/tx/regression/threadx_byte_memory_information_test.c +++ b/test/tx/regression/threadx_byte_memory_information_test.c @@ -76,7 +76,7 @@ static void test_isr(void) tx_thread_wait_abort(&thread_3); /* End the ISR processing. */ - test_status = 2; + test_status = 2; test_isr_dispatch = TX_NULL; } } @@ -101,8 +101,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -114,8 +114,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -127,8 +127,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -140,8 +140,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -153,8 +153,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -166,8 +166,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -179,8 +179,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -195,7 +195,7 @@ CHAR *pointer; /* Create the byte_pool with one byte. */ status = tx_byte_pool_create(&byte_pool_0, "byte_pool 0", pointer, 100); pointer = pointer + 100; - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -274,7 +274,7 @@ ULONG timeouts; printf("ERROR #11\n"); test_control_return(1); } - + /* At this point we are going to get more than 2 threads suspended. */ tx_thread_resume(&thread_1); tx_thread_resume(&thread_2); @@ -285,7 +285,7 @@ ULONG timeouts; /* Prioritize the byte pool suspension list. */ status = tx_byte_pool_prioritize(&byte_pool_0); - + /* Check status and make sure thread 3 is now at the front of the suspension list. */ if ((status != TX_SUCCESS) || (byte_pool_0.tx_byte_pool_suspension_list != &thread_3)) { @@ -297,7 +297,7 @@ ULONG timeouts; /* Now loop to test the interrupt of the prioritize loop logic. */ test_status = 1; - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; do { @@ -357,7 +357,7 @@ ULONG timeouts; status += tx_byte_pool_info_get(&byte_pool_0, &name, &available, &fragments, &first_suspended, &suspended_count, &next_pool); /* Check the status. */ - if ((status != TX_SUCCESS) || (available != byte_pool_0.tx_byte_pool_available) || (fragments != byte_pool_0.tx_byte_pool_fragments) || + if ((status != TX_SUCCESS) || (available != byte_pool_0.tx_byte_pool_available) || (fragments != byte_pool_0.tx_byte_pool_fragments) || (first_suspended != &thread_4) || (suspended_count != byte_pool_0.tx_byte_pool_suspended_count) || (next_pool != &byte_pool_0)) { @@ -371,7 +371,7 @@ ULONG timeouts; /* Get the byte pool performance information. */ status = tx_byte_pool_performance_info_get(TX_NULL, &allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts); - + /* Check the status. */ if (status != TX_PTR_ERROR) { @@ -380,10 +380,10 @@ ULONG timeouts; printf("ERROR #18\n"); test_control_return(1); } - + /* Get the byte pool performance information. */ status = tx_byte_pool_performance_info_get(&byte_pool_1, &allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts); - + /* Check the status. */ if (status != TX_PTR_ERROR) { @@ -395,11 +395,11 @@ ULONG timeouts; /* Get the byte pool performance information. */ status = tx_byte_pool_performance_info_get(&byte_pool_0, &allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts); - + /* Check the status. */ - if ((status != TX_SUCCESS) || (allocates != byte_pool_0.tx_byte_pool_performance_allocate_count) || (releases != byte_pool_0.tx_byte_pool_performance_release_count) || - (fragments_searched != byte_pool_0.tx_byte_pool_performance_search_count) || (merges != byte_pool_0.tx_byte_pool_performance_merge_count) || - (splits != byte_pool_0.tx_byte_pool_performance_split_count) || (suspensions != byte_pool_0.tx_byte_pool_performance_suspension_count) || + if ((status != TX_SUCCESS) || (allocates != byte_pool_0.tx_byte_pool_performance_allocate_count) || (releases != byte_pool_0.tx_byte_pool_performance_release_count) || + (fragments_searched != byte_pool_0.tx_byte_pool_performance_search_count) || (merges != byte_pool_0.tx_byte_pool_performance_merge_count) || + (splits != byte_pool_0.tx_byte_pool_performance_split_count) || (suspensions != byte_pool_0.tx_byte_pool_performance_suspension_count) || (timeouts != byte_pool_0.tx_byte_pool_performance_timeout_count)) { @@ -410,11 +410,11 @@ ULONG timeouts; /* Get the byte pool system performance information. */ status = tx_byte_pool_performance_system_info_get(&allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts); - + /* Check the status. */ - if ((status != TX_SUCCESS) || (allocates != _tx_byte_pool_performance_allocate_count) || (releases != _tx_byte_pool_performance_release_count) || - (fragments_searched != _tx_byte_pool_performance_search_count) || (merges != _tx_byte_pool_performance_merge_count) || - (splits != _tx_byte_pool_performance_split_count) || (suspensions != _tx_byte_pool_performance_suspension_count) || + if ((status != TX_SUCCESS) || (allocates != _tx_byte_pool_performance_allocate_count) || (releases != _tx_byte_pool_performance_release_count) || + (fragments_searched != _tx_byte_pool_performance_search_count) || (merges != _tx_byte_pool_performance_merge_count) || + (splits != _tx_byte_pool_performance_split_count) || (suspensions != _tx_byte_pool_performance_suspension_count) || (timeouts != _tx_byte_pool_performance_timeout_count)) { diff --git a/test/tx/regression/threadx_byte_memory_prioritize_test.c b/test/tx/regression/threadx_byte_memory_prioritize_test.c index f06d5cd3..29407135 100644 --- a/test/tx/regression/threadx_byte_memory_prioritize_test.c +++ b/test/tx/regression/threadx_byte_memory_prioritize_test.c @@ -74,12 +74,12 @@ static void test_isr(void) } else { - + /* Abort the wait of thread 5. */ tx_thread_wait_abort(&thread_5); /* End the ISR processing. */ - test_status = 2; + test_status = 2; test_isr_dispatch = TX_NULL; } } @@ -105,8 +105,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -118,8 +118,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -131,8 +131,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -144,8 +144,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -157,8 +157,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -170,8 +170,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -183,8 +183,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -199,7 +199,7 @@ CHAR *pointer; /* Create the byte_pool with one byte. */ status = tx_byte_pool_create(&byte_pool_0, "byte_pool 0", pointer, 100); pointer = pointer + 100; - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -296,7 +296,7 @@ VOID *pointer; /* Call byte pool prioritize again to test the don't-do-anything path in tx_byte_pool_prioritize. */ status += tx_byte_pool_prioritize(&byte_pool_0); - + /* At this point we are going to get more than 2 threads suspended. */ tx_thread_resume(&thread_1); tx_thread_resume(&thread_2); @@ -307,7 +307,7 @@ VOID *pointer; /* Prioritize the byte pool suspension list. */ status = tx_byte_pool_prioritize(&byte_pool_0); - + /* Check status and make sure thread 3 is now at the front of the suspension list. */ if ((status != TX_SUCCESS) || (byte_pool_0.tx_byte_pool_suspension_list != &thread_3)) { @@ -319,7 +319,7 @@ VOID *pointer; /* Now loop to test the interrupt of the prioritize loop logic. */ test_status = 1; - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; do { diff --git a/test/tx/regression/threadx_byte_memory_suspension_test.c b/test/tx/regression/threadx_byte_memory_suspension_test.c index 069410c5..ba159894 100644 --- a/test/tx/regression/threadx_byte_memory_suspension_test.c +++ b/test/tx/regression/threadx_byte_memory_suspension_test.c @@ -43,12 +43,12 @@ UCHAR *search_ptr; /* Adjust the search pointer to avoid the search pointer change for this test. */ search_ptr = pool_0.tx_byte_pool_search; while (search_ptr >= pool_0.tx_byte_pool_search) - + { search_ptr = *((UCHAR **) ((VOID *) search_ptr)); } pool_0.tx_byte_pool_search = search_ptr; - + tx_thread_wait_abort(&thread_3); tx_thread_resume(&thread_3); } @@ -77,8 +77,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -90,8 +90,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -103,12 +103,12 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -146,7 +146,7 @@ CHAR *pointer; /* Inform user. */ printf("Running Byte Memory Suspension Test................................. "); - + /* Increment the thread counter. */ thread_0_counter++; @@ -188,7 +188,7 @@ CHAR *pointer; printf("ERROR #7\n"); test_control_return(1); } - + /* Now allocate the memory again. Only one block of this size will fit. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_NO_WAIT); @@ -200,15 +200,15 @@ CHAR *pointer; printf("ERROR #8\n"); test_control_return(1); } - + /* Resume the second thread. */ tx_thread_resume(&thread_2); - + /* Now relinquish to let both thread 1 and 2 suspend. */ tx_thread_relinquish(); - + /* At this point both threads should be suspended on the byte pool. */ - + /* Release the memory again. */ status = tx_byte_release(pointer); @@ -220,11 +220,11 @@ CHAR *pointer; printf("ERROR #9\n"); test_control_return(1); } - + /* Now relinquish to get the other threads to run once. */ tx_thread_relinquish(); tx_thread_relinquish(); - + /* At this point both threads 1 and 2 are suspended on the byte pool again. */ if ((thread_1_counter != 3) && (thread_2_counter != 1)) { @@ -233,7 +233,7 @@ CHAR *pointer; printf("ERROR #10\n"); test_control_return(1); } - + /* Now allocate the memory again. Only one block of this size will fit. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_NO_WAIT); @@ -245,25 +245,25 @@ CHAR *pointer; printf("ERROR #10a\n"); test_control_return(1); } - + /* Resume thread 3 to get it suspended on the the pool. */ tx_thread_resume(&thread_3); #ifdef TX_MANUAL_TEST /* Set BP hear. Now release the memory and step into the code. After byte search issue IRQ2 mannually, which will - make thread 3 abort the first request and make another request of a different size. This is the path we are trying + make thread 3 abort the first request and make another request of a different size. This is the path we are trying to generate in the test. */ status = tx_byte_release(pointer); #else - /* Set the flag that will make thread 3 abort the first request and make another request of a different size. This tests the memory size change path + /* Set the flag that will make thread 3 abort the first request and make another request of a different size. This tests the memory size change path in the byte release loop logic. */ threadx_byte_release_loop_test = 1; status = tx_byte_release(pointer); #endif - + /* Check status. */ if (status != TX_SUCCESS) { @@ -273,7 +273,7 @@ CHAR *pointer; test_control_return(1); } else - { + { /* Successful test. */ printf("SUCCESS!\n"); @@ -307,7 +307,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* Let thread 0 run again. */ tx_thread_relinquish(); } @@ -339,7 +339,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* Let thread 0 run again. */ tx_thread_relinquish(); } @@ -370,7 +370,7 @@ CHAR *pointer; threadx_byte_allocate_loop_test = 1; status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 90, TX_WAIT_FOREVER); #endif - + /* Check for status. */ if (status != TX_SUCCESS) return; @@ -384,7 +384,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* suspend this thread. */ tx_thread_suspend(&thread_3); } diff --git a/test/tx/regression/threadx_byte_memory_suspension_timeout_test.c b/test/tx/regression/threadx_byte_memory_suspension_timeout_test.c index ed122dab..5e94df97 100644 --- a/test/tx/regression/threadx_byte_memory_suspension_timeout_test.c +++ b/test/tx/regression/threadx_byte_memory_suspension_timeout_test.c @@ -44,8 +44,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -57,8 +57,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -71,8 +71,8 @@ CHAR *pointer; } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -110,7 +110,7 @@ CHAR *pointer; /* Inform user. */ printf("Running Byte Memory Suspension Timeout Test......................... "); - + /* Increment the thread counter. */ thread_0_counter++; @@ -126,7 +126,7 @@ CHAR *pointer; test_control_return(1); } - /* Sleep to allow the other thread to suspend and timeout on the memory + /* Sleep to allow the other thread to suspend and timeout on the memory pool once. */ tx_thread_sleep(64); @@ -140,7 +140,7 @@ CHAR *pointer; } else { - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); diff --git a/test/tx/regression/threadx_byte_memory_thread_contention_test.c b/test/tx/regression/threadx_byte_memory_thread_contention_test.c index a3e689c8..da2634e3 100644 --- a/test/tx/regression/threadx_byte_memory_thread_contention_test.c +++ b/test/tx/regression/threadx_byte_memory_thread_contention_test.c @@ -1,6 +1,6 @@ /* This test is designed to test contention of two threads on a single memory byte pool. */ - + #include <stdio.h> #include "tx_api.h" @@ -49,8 +49,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 1, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -62,8 +62,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 1, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -75,8 +75,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 1, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -91,7 +91,7 @@ CHAR *pointer; /* Create byte pool 0. */ status = tx_byte_pool_create(&pool_0, "pool 0", pointer, 108); pointer = pointer + 108; - + /* Save off the intial pool size. */ initial_pool_size = pool_0.tx_byte_pool_available; @@ -128,7 +128,7 @@ CHAR *pointer; { /* Allocate memory from the pool. This size will cause merge activity - because the search pointer will sit in this large block about half + because the search pointer will sit in this large block about half the time. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_WAIT_FOREVER); @@ -158,7 +158,7 @@ CHAR *pointer; /* Check the time. */ if (tx_time_get() > 128) - break; + break; /* Increment the thread counter. */ thread_0_counter++; @@ -166,7 +166,7 @@ CHAR *pointer; /* Set the done flag. */ test_done = TX_TRUE; - + /* Sleep to let the other threads finish up! */ tx_thread_sleep(2); @@ -215,7 +215,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* Increment the thread counter. */ thread_1_counter++; } @@ -248,7 +248,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* Increment the thread counter. */ thread_2_counter++; } diff --git a/test/tx/regression/threadx_byte_memory_thread_terminate_test.c b/test/tx/regression/threadx_byte_memory_thread_terminate_test.c index 29fec0c0..4805ba57 100644 --- a/test/tx/regression/threadx_byte_memory_thread_terminate_test.c +++ b/test/tx/regression/threadx_byte_memory_thread_terminate_test.c @@ -41,8 +41,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -54,8 +54,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -96,7 +96,7 @@ CHAR *pointer; /* Increment the thread counter. */ thread_0_counter++; - + /* Allocate memory from the pool. Only one block of this size will fit. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_NO_WAIT); @@ -114,7 +114,7 @@ CHAR *pointer; /* Terminate the other thread. */ status = tx_thread_terminate(&thread_1); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -147,7 +147,7 @@ CHAR *pointer; printf("ERROR #7\n"); test_control_return(1); } - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); diff --git a/test/tx/regression/threadx_event_flag_basic_test.c b/test/tx/regression/threadx_event_flag_basic_test.c index 9c19f9bd..3261f67f 100644 --- a/test/tx/regression/threadx_event_flag_basic_test.c +++ b/test/tx/regression/threadx_event_flag_basic_test.c @@ -75,14 +75,14 @@ ULONG actual_events; /* Determine if calling event flag create from initialization was successful. */ if (test_event_flags_from_init != TX_SUCCESS) { - + /* Error! */ error++; } /* Attempt to create an event flag group from a timer. */ status = tx_event_flags_create(&group_2, "group 2"); - + /* Check status. */ if (status != TX_CALLER_ERROR) { @@ -185,8 +185,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -198,8 +198,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -213,7 +213,7 @@ CHAR *pointer; /* Create event flag group 0 and 1. */ status = tx_event_flags_create(&group_0, "group 0"); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -231,7 +231,7 @@ CHAR *pointer; printf("Running Event Flag Basic Test....................................... ERROR #4\n"); test_control_return(1); } - + /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); @@ -278,7 +278,7 @@ CHAR *pointer; test_control_return(1); } #endif - + } @@ -300,11 +300,11 @@ ULONG actual_events; event_flag_memory.second = 0x55667788; event_flag_memory.next_to_last = 0x99aabbcc; event_flag_memory.last = 0xddeeff00; - + /* Create the event flag group. */ status = tx_event_flags_create(&event_flag_memory.event_flags, "group memory"); tx_event_flags_delete(&event_flag_memory.event_flags); - + /* Check for status. */ if ((status != TX_SUCCESS) || (event_flag_memory.first != 0x11223344) || @@ -312,7 +312,7 @@ ULONG actual_events; (event_flag_memory.next_to_last != 0x99aabbcc) || (event_flag_memory.last != 0xddeeff00)) { - + /* Event flag error. */ printf("ERROR #7\n"); test_control_return(1); @@ -324,7 +324,7 @@ ULONG actual_events; /* Try to create with a NULL pointer. */ status = tx_event_flags_create(TX_NULL, "group 0"); - + /* Check status. */ if (status != TX_GROUP_ERROR) { @@ -333,10 +333,10 @@ ULONG actual_events; printf("ERROR #8\n"); test_control_return(1); } - + /* Try to create with a bad size. */ status = _txe_event_flags_create(&group_3, "group 3", (sizeof(TX_EVENT_FLAGS_GROUP)+1)); - + /* Check status. */ if (status != TX_GROUP_ERROR) { @@ -345,10 +345,10 @@ ULONG actual_events; printf("ERROR #9\n"); test_control_return(1); } - + /* Try to create an already created group. */ status = tx_event_flags_create(&group_0, "group 0"); - + /* Check status. */ if (status != TX_GROUP_ERROR) { @@ -369,7 +369,7 @@ ULONG actual_events; printf("ERROR #11\n"); test_control_return(1); } - + /* Delete with a non-created pointer. */ group_2.tx_event_flags_group_id = 0; status = tx_event_flags_delete(&group_2); @@ -518,7 +518,7 @@ ULONG actual_events; printf("ERROR #23\n"); test_control_return(1); } - + /* Attempt to get events from an empty event flag group. AND CLEAR option. */ status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT); @@ -604,7 +604,7 @@ ULONG actual_events; printf("ERROR #30\n"); test_control_return(1); } - + /* Attempt to get events from event flag group. AND CLEAR option. */ status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT); @@ -691,7 +691,7 @@ ULONG actual_events; /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Block memory error. */ printf("ERROR #36\n"); test_control_return(1); @@ -737,7 +737,7 @@ static void thread_1_entry(ULONG thread_input) while(1) { - tx_thread_relinquish(); + tx_thread_relinquish(); } } diff --git a/test/tx/regression/threadx_event_flag_information_test.c b/test/tx/regression/threadx_event_flag_information_test.c index 1f03fdf3..d2404081 100644 --- a/test/tx/regression/threadx_event_flag_information_test.c +++ b/test/tx/regression/threadx_event_flag_information_test.c @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -69,7 +69,7 @@ CHAR *pointer; /* Create event flag group 0 and 1. */ status = tx_event_flags_create(&group_0, "group 0"); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -87,10 +87,10 @@ CHAR *pointer; printf("Running Event Flag Information Test................................. ERROR #3\n"); test_control_return(1); } - + /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ @@ -162,7 +162,7 @@ ULONG timeouts; printf("ERROR #7\n"); test_control_return(1); } - + /* Attempt to get events from an empty event flag group. AND CLEAR option. */ status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT); @@ -248,7 +248,7 @@ ULONG timeouts; printf("ERROR #14\n"); test_control_return(1); } - + /* Attempt to get events from event flag group. AND CLEAR option. */ status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT); @@ -343,7 +343,7 @@ ULONG timeouts; /* Get information about the event flag group. */ status = tx_event_flags_info_get(&group_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_event_flags_info_get(&group_0, &name, ¤t_flags, &first_suspended, &suspended_count, &next_group); - + /* Check the status. */ if ((status != TX_SUCCESS) || (current_flags != group_0.tx_event_flags_group_current) || (first_suspended != TX_NULL) || (suspended_count != 0) || (next_group != &group_1)) { @@ -357,7 +357,7 @@ ULONG timeouts; /* Get performance information with NULL pointer. */ status = _tx_event_flags_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check the status. */ if (status != TX_PTR_ERROR) { @@ -370,9 +370,9 @@ ULONG timeouts; /* Get performance information on the event flag group. */ status = tx_event_flags_performance_info_get(&group_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_event_flags_performance_info_get(&group_0, &sets, &gets, &suspensions, &timeouts); - + /* Check the status. */ - if ((status != TX_SUCCESS) || (sets != group_0.tx_event_flags_group_performance_set_count) || (gets != group_0.tx_event_flags_group__performance_get_count) || + if ((status != TX_SUCCESS) || (sets != group_0.tx_event_flags_group_performance_set_count) || (gets != group_0.tx_event_flags_group__performance_get_count) || (suspensions != group_0.tx_event_flags_group___performance_suspension_count) || (timeouts != group_0.tx_event_flags_group____performance_timeout_count)) { @@ -384,9 +384,9 @@ ULONG timeouts; /* Get system performance information on all event flags groups. */ status = tx_event_flags_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_event_flags_performance_system_info_get(&sets, &gets, &suspensions, &timeouts); - + /* Check the status. */ - if ((status != TX_SUCCESS) || (sets != _tx_event_flags_performance_set_count) || (gets != _tx_event_flags_performance_get_count) || + if ((status != TX_SUCCESS) || (sets != _tx_event_flags_performance_set_count) || (gets != _tx_event_flags_performance_get_count) || (suspensions != _tx_event_flags_performance_suspension_count) || (timeouts != _tx_event_flags_performance_timeout_count)) { diff --git a/test/tx/regression/threadx_event_flag_isr_set_clear_test.c b/test/tx/regression/threadx_event_flag_isr_set_clear_test.c index 2d2f28af..7f89a06f 100644 --- a/test/tx/regression/threadx_event_flag_isr_set_clear_test.c +++ b/test/tx/regression/threadx_event_flag_isr_set_clear_test.c @@ -65,7 +65,7 @@ static volatile UINT miss_count = 0; condition_count++; } - /* + /* It is possible for this test to get into a resonance condition in which the ISR never occurs while preemption is disabled (especially if the ISR is installed in the periodic timer interrupt handler, which is @@ -89,10 +89,10 @@ static volatile UINT miss_count = 0; /* Setup some event flags just so we can clear them. */ status += tx_event_flags_set(&event_flags_0, 0x30000, TX_OR); - + /* Clear the same flags immediately. */ status += tx_event_flags_set(&event_flags_0, 0xFFFEFFFF, TX_AND); - + /* Clear the same flags immediately. */ status += tx_event_flags_set(&event_flags_0, 0xFFFDFFFC, TX_AND); @@ -102,11 +102,11 @@ static volatile UINT miss_count = 0; /* Get the events from an ISR. */ status = tx_event_flags_get(&event_flags_0, 0x30000, TX_OR, &actual, TX_NO_WAIT); - + /* Check to make sure this results in an error. */ if (status != TX_NO_EVENTS) return; - + /* Do a set and a get consume from an ISR. */ status = tx_event_flags_set(&event_flags_0, 0x000000C0, TX_OR); @@ -142,8 +142,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -155,8 +155,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -168,8 +168,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -183,7 +183,7 @@ CHAR *pointer; /* Create event flags group. */ status = tx_event_flags_create(&event_flags_0, "event_flags 0"); - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -202,7 +202,7 @@ CHAR *pointer; printf("Running Event Flag Set/Clear from ISR Test.......................... ERROR #5\n"); test_control_return(1); } - + /* Register the event set notify function. */ status = tx_event_flags_set_notify(&event_flags_0, event_set_notify); @@ -243,7 +243,7 @@ ULONG actual; printf("Running Event Flag Set/Clear from ISR Test.......................... "); /* Setup the test ISR. */ - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; /* Loop to exploit the probability window inside tx_event_flags_set call. */ while (condition_count < 40) @@ -253,7 +253,7 @@ ULONG actual; status = tx_event_flags_get(&event_flags_0, 2, TX_OR_CLEAR, &actual, 4); /* Determine if we have an unexpected result. */ - if (status != TX_SUCCESS) + if (status != TX_SUCCESS) { /* Test error! */ @@ -280,7 +280,7 @@ ULONG actual; } /* Setup the test ISR. */ - test_isr_dispatch = TX_NULL; + test_isr_dispatch = TX_NULL; /* Let the other threads run once more... */ tx_thread_relinquish(); @@ -319,7 +319,7 @@ ULONG actual; status = tx_event_flags_get(&event_flags_0, 1, TX_OR_CLEAR, &actual, 4); /* Determine if we have an unexpected result. */ - if (status != TX_SUCCESS) + if (status != TX_SUCCESS) { break; diff --git a/test/tx/regression/threadx_event_flag_isr_wait_abort_test.c b/test/tx/regression/threadx_event_flag_isr_wait_abort_test.c index 1c9bf5d2..e1ec4e7c 100644 --- a/test/tx/regression/threadx_event_flag_isr_wait_abort_test.c +++ b/test/tx/regression/threadx_event_flag_isr_wait_abort_test.c @@ -64,7 +64,7 @@ static volatile UINT miss_count = 0; condition_count++; } - /* + /* It is possible for this test to get into a resonance condition in which the ISR never occurs while preemption is disabled (especially if the ISR is installed in the periodic timer interrupt handler, which is @@ -86,10 +86,10 @@ static volatile UINT miss_count = 0; /* Abort the threads 1 and 2. */ status += tx_thread_wait_abort(&thread_0); status += tx_thread_wait_abort(&thread_1); - + if (status == TX_SUCCESS) { - + event_flags_wait_abort_counter++; } } @@ -115,8 +115,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -128,8 +128,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -141,8 +141,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -156,7 +156,7 @@ CHAR *pointer; /* Create event flags group. */ status = tx_event_flags_create(&event_flags_0, "event_flags 0"); - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -175,10 +175,10 @@ CHAR *pointer; printf("Running Event Flag Wait Abort from ISR Test......................... ERROR #5\n"); test_control_return(1); } - + /* Register the event set notify function. */ status = tx_event_flags_set_notify(&event_flags_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ @@ -217,7 +217,7 @@ ULONG actual; printf("Running Event Flag Wait Abort from ISR Test......................... "); /* Setup the test ISR. */ - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; /* Loop to exploit the probability window inside tx_event_flags_set call. */ while (condition_count < 40) @@ -227,7 +227,7 @@ ULONG actual; status = tx_event_flags_get(&event_flags_0, 2, TX_OR_CLEAR, &actual, 4); /* Determine if we have an unexpected result. */ - if (status != TX_WAIT_ABORTED) + if (status != TX_WAIT_ABORTED) { /* Test error! */ @@ -254,7 +254,7 @@ ULONG actual; } /* Setup the test ISR. */ - test_isr_dispatch = TX_NULL; + test_isr_dispatch = TX_NULL; /* Let the other threads run once more... */ tx_thread_relinquish(); @@ -293,7 +293,7 @@ ULONG actual; status = tx_event_flags_get(&event_flags_0, 1, TX_OR_CLEAR, &actual, 4); /* Determine if we have an unexpected result. */ - if (status != TX_WAIT_ABORTED) + if (status != TX_WAIT_ABORTED) { break; diff --git a/test/tx/regression/threadx_event_flag_single_thread_terminate_test.c b/test/tx/regression/threadx_event_flag_single_thread_terminate_test.c index a5db6e41..86675890 100644 --- a/test/tx/regression/threadx_event_flag_single_thread_terminate_test.c +++ b/test/tx/regression/threadx_event_flag_single_thread_terminate_test.c @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -67,8 +67,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -80,8 +80,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -106,7 +106,7 @@ CHAR *pointer; /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ @@ -160,7 +160,7 @@ UINT status; printf("ERROR #7\n"); test_control_return(1); } - + /* Now terminate thread 1. */ status = tx_thread_terminate(&thread_1); @@ -206,9 +206,9 @@ UINT status; test_control_return(1); } - /* At this point, thread 2 is suspended on the flags again. Or some flags that are + /* At this point, thread 2 is suspended on the flags again. Or some flags that are not needed. */ - + /* Set an event flag that is not needed. */ status = tx_event_flags_set(&group_0, 0x00000001, TX_OR); @@ -231,7 +231,7 @@ UINT status; tx_thread_sleep(5); /* Check status and run counters. */ - if ((status != TX_SUCCESS) || (thread_1_counter != 1) || (thread_2_counter != 3) || + if ((status != TX_SUCCESS) || (thread_1_counter != 1) || (thread_2_counter != 3) || (_tx_thread_preempt_disable)) { @@ -280,7 +280,7 @@ UINT status; /* Check status. */ if (status != TX_SUCCESS) { - thread_1_counter = 0; /* Make an error! */ + thread_1_counter = 0; /* Make an error! */ return; } } diff --git a/test/tx/regression/threadx_event_flag_suspension_consume_test.c b/test/tx/regression/threadx_event_flag_suspension_consume_test.c index b83a8123..aae8f1b9 100644 --- a/test/tx/regression/threadx_event_flag_suspension_consume_test.c +++ b/test/tx/regression/threadx_event_flag_suspension_consume_test.c @@ -55,8 +55,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -68,8 +68,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -81,8 +81,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -94,8 +94,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -120,7 +120,7 @@ CHAR *pointer; /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ diff --git a/test/tx/regression/threadx_event_flag_suspension_different_bits_consume_test.c b/test/tx/regression/threadx_event_flag_suspension_different_bits_consume_test.c index fa4a985a..595e60ed 100644 --- a/test/tx/regression/threadx_event_flag_suspension_different_bits_consume_test.c +++ b/test/tx/regression/threadx_event_flag_suspension_different_bits_consume_test.c @@ -51,8 +51,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -64,8 +64,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -78,8 +78,8 @@ CHAR *pointer; } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -101,10 +101,10 @@ CHAR *pointer; printf("Running Event Flag Suspension/Consumption Unique Bit Test........... ERROR #4\n"); test_control_return(1); } - + /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ @@ -140,7 +140,7 @@ UINT status; /* Inform user. */ printf("Running Event Flag Suspension/Consumption Unique Bit Test........... "); - + /* Increment run counter. */ thread_0_counter++; diff --git a/test/tx/regression/threadx_event_flag_suspension_different_bits_test.c b/test/tx/regression/threadx_event_flag_suspension_different_bits_test.c index 92505744..f9e43cad 100644 --- a/test/tx/regression/threadx_event_flag_suspension_different_bits_test.c +++ b/test/tx/regression/threadx_event_flag_suspension_different_bits_test.c @@ -51,8 +51,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -64,8 +64,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -78,8 +78,8 @@ CHAR *pointer; } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -104,7 +104,7 @@ CHAR *pointer; /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ @@ -140,7 +140,7 @@ UINT status; /* Inform user. */ printf("Running Event Flag Suspension Unique Bit Test....................... "); - + /* Increment run counter. */ thread_0_counter++; diff --git a/test/tx/regression/threadx_event_flag_suspension_test.c b/test/tx/regression/threadx_event_flag_suspension_test.c index 3587fadd..915e33db 100644 --- a/test/tx/regression/threadx_event_flag_suspension_test.c +++ b/test/tx/regression/threadx_event_flag_suspension_test.c @@ -58,8 +58,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -71,8 +71,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -84,8 +84,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -97,8 +97,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -110,8 +110,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -136,7 +136,7 @@ CHAR *pointer; /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ @@ -223,11 +223,11 @@ int i; /* Resume thread 4 so it can suspend on the event flag group too. */ status += tx_thread_resume(&thread_4); - + /* Determine if there was an error. */ if ((status != TX_SUCCESS) || (thread_4_counter != 1)) { - + /* Event flag error. */ printf("ERROR #11\n"); test_control_return(1); @@ -239,7 +239,7 @@ int i; /* Determine if there was an error. */ if ((status != TX_SUCCESS) || (thread_4_counter != 2)) { - + /* Event flag error. */ printf("ERROR #12\n"); test_control_return(1); diff --git a/test/tx/regression/threadx_event_flag_suspension_timeout_test.c b/test/tx/regression/threadx_event_flag_suspension_timeout_test.c index c689c755..149cb58f 100644 --- a/test/tx/regression/threadx_event_flag_suspension_timeout_test.c +++ b/test/tx/regression/threadx_event_flag_suspension_timeout_test.c @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -67,12 +67,12 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -84,8 +84,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -110,7 +110,7 @@ CHAR *pointer; /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check status. */ @@ -140,7 +140,7 @@ CHAR *pointer; static void thread_0_entry(ULONG thread_input) { - + ULONG actual_events; UINT status; @@ -209,7 +209,7 @@ UINT status; ULONG actual_events; - + /* Wait for event flags. */ while(1) { diff --git a/test/tx/regression/threadx_event_flag_thread_terminate_test.c b/test/tx/regression/threadx_event_flag_thread_terminate_test.c index eecb76e6..166711f5 100644 --- a/test/tx/regression/threadx_event_flag_thread_terminate_test.c +++ b/test/tx/regression/threadx_event_flag_thread_terminate_test.c @@ -52,8 +52,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -65,8 +65,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -78,8 +78,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -101,7 +101,7 @@ CHAR *pointer; printf("Running Event Flag Thread Terminate Test............................ ERROR #4\n"); test_control_return(1); } - + /* Register the event set notify function. */ status = tx_event_flags_set_notify(&group_0, event_set_notify); diff --git a/test/tx/regression/threadx_initialize_kernel_setup_test.c b/test/tx/regression/threadx_initialize_kernel_setup_test.c index f248694d..2ef8e158 100644 --- a/test/tx/regression/threadx_initialize_kernel_setup_test.c +++ b/test/tx/regression/threadx_initialize_kernel_setup_test.c @@ -10,7 +10,7 @@ TEST_FLAG test_forced_mutex_timeout; TEST_FLAG threadx_mutex_suspension_put_test; TEST_FLAG threadx_mutex_suspension_priority_test; TEST_FLAG threadx_byte_allocate_loop_test; -TEST_FLAG test_initialize_flag; +TEST_FLAG test_initialize_flag; TEST_FLAG threadx_byte_release_loop_test; TEST_FLAG test_stack_analyze_flag; diff --git a/test/tx/regression/threadx_interrupt_control_test.c b/test/tx/regression/threadx_interrupt_control_test.c index d58ceba3..c573c098 100644 --- a/test/tx/regression/threadx_interrupt_control_test.c +++ b/test/tx/regression/threadx_interrupt_control_test.c @@ -1,4 +1,4 @@ -/* This test is designed to test the interrupt control service call avaialbe to the +/* This test is designed to test the interrupt control service call avaialbe to the application. */ #include <stdio.h> @@ -36,8 +36,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_mutex_basic_test.c b/test/tx/regression/threadx_mutex_basic_test.c index 2e784961..419813d3 100644 --- a/test/tx/regression/threadx_mutex_basic_test.c +++ b/test/tx/regression/threadx_mutex_basic_test.c @@ -77,7 +77,7 @@ UINT status; /* Attempt to create a mutex from a timer. */ status = tx_mutex_create(&mutex_4, "mutex 4", TX_NO_INHERIT); - + /* Check status. */ if (status != TX_CALLER_ERROR) { @@ -96,7 +96,7 @@ UINT status; /* Error! */ error++; } - + /* Attempt to get from mutex from a timer with suspension. */ status = tx_mutex_get(&mutex_2, 100); @@ -124,7 +124,7 @@ UINT status; /* Attempt to create a mutex from an ISR. */ status = tx_mutex_create(&mutex_4, "mutex 4", TX_NO_INHERIT); - + /* Check status. */ if (status != TX_CALLER_ERROR) { @@ -201,29 +201,29 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -309,11 +309,11 @@ UINT status; mutex_memory.second = 0x55667788; mutex_memory.next_to_last = 0x99aabbcc; mutex_memory.last = 0xddeeff00; - + /* Create the semaphore. */ status = tx_mutex_create(&mutex_memory.mutex, "mutex memory", TX_INHERIT); tx_mutex_delete(&mutex_memory.mutex); - + /* Check for status. */ if ((status != TX_SUCCESS) || (mutex_memory.first != 0x11223344) || @@ -326,7 +326,7 @@ UINT status; printf("ERROR #6\n"); test_control_return(1); } - + /* Increment thread 0 counter. */ thread_0_counter++; @@ -334,7 +334,7 @@ UINT status; /* Attempt to create a mutex with a NULL pointer. */ status = tx_mutex_create(TX_NULL, "mutex 2", TX_INHERIT); - + /* Check status. */ if (status != TX_MUTEX_ERROR) { @@ -346,7 +346,7 @@ UINT status; /* Attempt to create a mutex with a bad size. */ status = _txe_mutex_create(&mutex_5, "mutex 5", TX_INHERIT, (sizeof(TX_MUTEX)+1)); - + /* Check status. */ if (status != TX_MUTEX_ERROR) { @@ -358,7 +358,7 @@ UINT status; /* Attempt to create a mutex that has already been created. */ status = tx_mutex_create(&mutex_2, "mutex 2", TX_INHERIT); - + /* Check status. */ if (status != TX_MUTEX_ERROR) { @@ -370,7 +370,7 @@ UINT status; /* Attempt to create a mutex with a bad inheritance option. */ status = tx_mutex_create(&mutex_4, "mutex 4", 14); - + /* Check status. */ if (status != TX_INHERIT_ERROR) { @@ -509,7 +509,7 @@ UINT status; /* Attempt to get the mutex. Should be unsuccessful. */ status = tx_mutex_get(&mutex_1, TX_NO_WAIT); - + /* Check status. */ if (status != TX_NOT_AVAILABLE) { @@ -535,7 +535,7 @@ UINT status; } status = tx_mutex_delete(&mutex_1); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -592,7 +592,7 @@ UINT status; /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Block memory error. */ printf("ERROR #26\n"); test_control_return(1); @@ -603,7 +603,7 @@ UINT status; /* Release mutex multiple times. */ status = tx_mutex_put(&mutex_2); status += tx_mutex_put(&mutex_2); - + /* Check status. */ if (status != TX_NOT_OWNED) { @@ -624,7 +624,7 @@ UINT status; printf("ERROR #28\n"); test_control_return(1); } - + /* Delete mutex. */ status = tx_mutex_delete(&mutex_2); @@ -639,14 +639,14 @@ UINT status; /* Get mutex 8. */ status = tx_mutex_get(&mutex_8, TX_WAIT_FOREVER); - + /* Start thread 3 and 4. */ status += tx_thread_resume(&thread_3); status += tx_thread_resume(&thread_4); - + /* Sleep to let thread 3 suspend on the mutex. */ tx_thread_sleep(2); - + /* Now, put the mutex to give it to thread 3. */ status += tx_mutex_put(&mutex_8); @@ -660,7 +660,7 @@ UINT status; } status = tx_mutex_delete(&mutex_3); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -713,14 +713,14 @@ UINT status; test_control_return(1); } - /* Create and obtain a couple mutexes so the thread completion can release them. */ + /* Create and obtain a couple mutexes so the thread completion can release them. */ status = tx_mutex_create(&mutex_6, "mutex 6", TX_NO_INHERIT); status += tx_mutex_create(&mutex_7, "mutex 7", TX_NO_INHERIT); status += tx_mutex_get(&mutex_6, TX_NO_WAIT); status += tx_mutex_get(&mutex_7, TX_NO_WAIT); status += tx_mutex_get(&mutex_6, TX_NO_WAIT); status += tx_mutex_get(&mutex_7, TX_NO_WAIT); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -738,7 +738,7 @@ static void thread_2_entry(ULONG thread_input) while(1) { - tx_thread_relinquish(); + tx_thread_relinquish(); } } @@ -748,7 +748,7 @@ static void thread_3_entry(ULONG thread_input) while(1) { - + tx_mutex_get(&mutex_8, TX_WAIT_FOREVER); tx_mutex_put(&mutex_8); } @@ -760,7 +760,7 @@ static void thread_4_entry(ULONG thread_input) while(1) { - + tx_mutex_get(&mutex_8, TX_WAIT_FOREVER); tx_mutex_put(&mutex_8); } diff --git a/test/tx/regression/threadx_mutex_delete_test.c b/test/tx/regression/threadx_mutex_delete_test.c index 28676f4b..af501488 100644 --- a/test/tx/regression/threadx_mutex_delete_test.c +++ b/test/tx/regression/threadx_mutex_delete_test.c @@ -47,8 +47,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -60,8 +60,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -73,8 +73,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_mutex_information_test.c b/test/tx/regression/threadx_mutex_information_test.c index e95c16c6..55503002 100644 --- a/test/tx/regression/threadx_mutex_information_test.c +++ b/test/tx/regression/threadx_mutex_information_test.c @@ -50,14 +50,14 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -196,7 +196,7 @@ ULONG inheritances; /* Attempt to get the mutex. Should be unsuccessful. */ status = tx_mutex_get(&mutex_1, TX_NO_WAIT); - + /* Check status. */ if (status != TX_NOT_AVAILABLE) { @@ -222,7 +222,7 @@ ULONG inheritances; } status = tx_mutex_delete(&mutex_1); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -289,7 +289,7 @@ ULONG inheritances; status += tx_mutex_info_get(&mutex_2, &name, &count, &owner, &first_suspended, &suspended_count, &next_mutex); /* Check status. */ - if ((status != TX_SUCCESS) || (count != mutex_2.tx_mutex_ownership_count) || (owner != mutex_2.tx_mutex_owner) || + if ((status != TX_SUCCESS) || (count != mutex_2.tx_mutex_ownership_count) || (owner != mutex_2.tx_mutex_owner) || (first_suspended != mutex_2.tx_mutex_suspension_list) || (suspended_count != mutex_2.tx_mutex_suspended_count) || (next_mutex != mutex_2.tx_mutex_created_next)) { @@ -314,7 +314,7 @@ ULONG inheritances; /* Now get the performance inforamtion. */ status = tx_mutex_performance_info_get(&mutex_2, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); - + /* Check status. */ if ((status != TX_SUCCESS) || (puts != mutex_2.tx_mutex_performance_put_count) || (gets != mutex_2.tx_mutex_performance_get_count) || (suspensions != mutex_2.tx_mutex_performance_suspension_count) || (timeouts != mutex_2.tx_mutex_performance_timeout_count) || @@ -325,10 +325,10 @@ ULONG inheritances; printf("ERROR #19\n"); test_control_return(1); } - + /* Now get the system performance inforamtion. */ status = tx_mutex_performance_system_info_get(&puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); - + /* Check status. */ if ((status != TX_SUCCESS) || (puts != _tx_mutex_performance_put_count) || (gets != _tx_mutex_performance_get_count) || (suspensions != _tx_mutex_performance_suspension_count) || (timeouts != _tx_mutex_performance_timeout_count) || @@ -537,7 +537,7 @@ ULONG inheritances; } status = tx_mutex_delete(&mutex_3); - + /* Check status. */ if (status != TX_SUCCESS) { diff --git a/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c b/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c index 7397b4e2..1439ca85 100644 --- a/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c +++ b/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c @@ -9,7 +9,7 @@ /* Define the ThreadX object control blocks... */ static TX_THREAD thread_0; -#ifndef TX_DISABLE_PREEMPTION_THRESHOLD +#ifndef TX_DISABLE_PREEMPTION_THRESHOLD static TX_THREAD thread_1; static TX_THREAD thread_2; static TX_THREAD thread_3; @@ -37,7 +37,7 @@ static ULONG thread_6_counter; /* Define thread prototypes. */ static void thread_0_entry(ULONG thread_input); -#ifndef TX_DISABLE_PREEMPTION_THRESHOLD +#ifndef TX_DISABLE_PREEMPTION_THRESHOLD static void thread_1_entry(ULONG thread_input); static void thread_2_entry(ULONG thread_input); static void thread_3_entry(ULONG thread_input); @@ -66,8 +66,8 @@ UINT status; pointer = (CHAR *) first_unused_memory; /* Create thread. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 16, 1, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + DEMO_STACK_SIZE; @@ -79,11 +79,11 @@ UINT status; test_control_return(1); } -#ifndef TX_DISABLE_PREEMPTION_THRESHOLD - +#ifndef TX_DISABLE_PREEMPTION_THRESHOLD + /* Create thread. */ - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + DEMO_STACK_SIZE; @@ -96,8 +96,8 @@ UINT status; } /* Create thread. */ - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + DEMO_STACK_SIZE; @@ -110,8 +110,8 @@ UINT status; } /* Create thread. */ - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, DEMO_STACK_SIZE, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, DEMO_STACK_SIZE, 30, 1, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + DEMO_STACK_SIZE; @@ -124,8 +124,8 @@ UINT status; } /* Create thread. */ - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, DEMO_STACK_SIZE, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + DEMO_STACK_SIZE; @@ -138,8 +138,8 @@ UINT status; } /* Create thread. */ - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + DEMO_STACK_SIZE; @@ -152,8 +152,8 @@ UINT status; } /* Create thread. */ - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, DEMO_STACK_SIZE, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, DEMO_STACK_SIZE, 30, 30, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + DEMO_STACK_SIZE; @@ -188,7 +188,7 @@ UINT status; static void thread_0_entry(ULONG thread_input) { -#ifdef TX_DISABLE_PREEMPTION_THRESHOLD +#ifdef TX_DISABLE_PREEMPTION_THRESHOLD /* Preemption threshold is not enabled, skip this test. */ @@ -196,8 +196,8 @@ static void thread_0_entry(ULONG thread_input) printf("Running Mutex Nested Priority Inheritance Test...................... SUCCESS!\n"); test_control_return(0); -#else - +#else + UINT test_case = 0; UINT loop_count = 0; UINT priority; @@ -238,7 +238,7 @@ UINT status; test_control_return(1); } - /* Release the mutexes... Depending on the order they are released should dictate + /* Release the mutexes... Depending on the order they are released should dictate the thread's returned to priority. */ if (test_case == 0) { @@ -267,7 +267,7 @@ UINT status; } tx_mutex_put(&mutex_0); - + /* No change. */ if (thread_0.tx_thread_priority != 15) { @@ -281,7 +281,7 @@ UINT status; { priority = thread_0.tx_thread_priority; - tx_mutex_put(&mutex_0); + tx_mutex_put(&mutex_0); /* Should have no change in priority since nothing was inherited for this mutex. */ if (thread_0.tx_thread_priority != priority) @@ -292,7 +292,7 @@ UINT status; test_control_return(4); } - tx_mutex_put(&mutex_1); + tx_mutex_put(&mutex_1); /* Should not do anything since mutex 2 elevated to a higher priority. */ if (thread_0.tx_thread_priority != priority) @@ -303,7 +303,7 @@ UINT status; test_control_return(5); } - tx_mutex_put(&mutex_2); + tx_mutex_put(&mutex_2); /* Should go back to priority 15. */ if (thread_0.tx_thread_priority != 15) @@ -317,7 +317,7 @@ UINT status; else if (test_case == 2) { - tx_mutex_put(&mutex_2); + tx_mutex_put(&mutex_2); /* Should go back to priority 8. */ if (thread_0.tx_thread_priority != 8) @@ -328,7 +328,7 @@ UINT status; test_control_return(7); } - tx_mutex_put(&mutex_0); + tx_mutex_put(&mutex_0); /* Should not do anything. */ if (thread_0.tx_thread_priority != 8) @@ -339,7 +339,7 @@ UINT status; test_control_return(8); } - tx_mutex_put(&mutex_1); + tx_mutex_put(&mutex_1); /* Should go back to priority 15. */ if (thread_0.tx_thread_priority != 15) @@ -354,7 +354,7 @@ UINT status; { priority = thread_0.tx_thread_priority; - tx_mutex_put(&mutex_1); + tx_mutex_put(&mutex_1); /* Should not do anything since mutex 2 is still owned. */ if (thread_0.tx_thread_priority != priority) @@ -366,7 +366,7 @@ UINT status; } tx_mutex_put(&mutex_0); - + /* Should not do anything. */ if (thread_0.tx_thread_priority != priority) { @@ -376,7 +376,7 @@ UINT status; test_control_return(11); } - tx_mutex_put(&mutex_2); + tx_mutex_put(&mutex_2); /* Should finally go back to priority 15. */ if (thread_0.tx_thread_priority != 15) @@ -391,7 +391,7 @@ UINT status; { priority = thread_0.tx_thread_priority; - tx_mutex_put(&mutex_1); + tx_mutex_put(&mutex_1); /* Should not do anything since mutex 2 is still owned. */ if (thread_0.tx_thread_priority != priority) @@ -402,7 +402,7 @@ UINT status; test_control_return(13); } - tx_mutex_put(&mutex_2); + tx_mutex_put(&mutex_2); /* Should reurn us back to priority 15. */ if (thread_0.tx_thread_priority != 15) @@ -413,7 +413,7 @@ UINT status; test_control_return(14); } - tx_mutex_put(&mutex_0); + tx_mutex_put(&mutex_0); /* Should not do anything. */ if (thread_0.tx_thread_priority != 15) @@ -428,7 +428,7 @@ UINT status; { priority = thread_0.tx_thread_priority; - tx_mutex_put(&mutex_0); + tx_mutex_put(&mutex_0); /* Should not do anything since mutex 2 is still owned. */ if (thread_0.tx_thread_priority != priority) @@ -439,7 +439,7 @@ UINT status; test_control_return(16); } - tx_mutex_put(&mutex_2); + tx_mutex_put(&mutex_2); /* Should reurn us back to priority 8. */ if (thread_0.tx_thread_priority != 8) @@ -451,7 +451,7 @@ UINT status; } tx_mutex_put(&mutex_1); - + /* Should return us back to priority 15. */ if (thread_0.tx_thread_priority != 15) { @@ -470,60 +470,60 @@ UINT status; /* Check for thread 3 running... this should not happen! */ if (thread_3_counter != 50) { - + printf("ERROR #25\n"); test_control_return(19); } /* At this point, mutex 3 owned by this thread. */ - + /* Resume thread 6, lowest priority thread. */ status = tx_thread_resume(&thread_6); - + /* Check for an error. */ if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 15) || (thread_6_counter != 0)) { - + printf("ERROR #27\n"); test_control_return(19); } - + /* Now resume thread 4. */ status = tx_thread_resume(&thread_4); - + /* Check for an error. */ if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 4) || (thread_6_counter != 0)) { - + printf("ERROR #28\n"); test_control_return(19); } - + /* Now resume thread 5. */ status = tx_thread_resume(&thread_5); - + /* Check for an error. */ if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 2) || (thread_6_counter != 0)) { - + printf("ERROR #29\n"); test_control_return(19); } - + /* Sleep to let thread 6 run, which is lower priority. */ tx_thread_sleep(1); - + /* Now release the mutex. */ status = tx_mutex_put(&mutex_3); /* Check for an error. */ if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 15) || (thread_6_counter != 0) || (thread_4_counter != 1) || (thread_5_counter != 1)) { - + printf("ERROR #30\n"); test_control_return(19); } - + /* Sleep to let thread 6 run and release the mutex. */ tx_thread_sleep(2); @@ -534,7 +534,7 @@ UINT status; #endif } -#ifndef TX_DISABLE_PREEMPTION_THRESHOLD +#ifndef TX_DISABLE_PREEMPTION_THRESHOLD static void thread_1_entry(ULONG thread_input) { @@ -551,8 +551,8 @@ UINT old_threshold; /* Update the thread priority and thread preemption-threshold of thread 0. */ tx_thread_priority_change(&thread_0, 15, &old_priority); - tx_thread_preemption_change(&thread_0, 14, &old_threshold); - + tx_thread_preemption_change(&thread_0, 14, &old_threshold); + /* Get mutex. */ tx_mutex_get(&mutex_1, TX_WAIT_FOREVER); tx_mutex_put(&mutex_1); @@ -564,8 +564,8 @@ UINT old_threshold; /* Update the thread priority and thread preemption-threshold of thread 0. */ tx_thread_priority_change(&thread_0, 15, &old_priority); - tx_thread_preemption_change(&thread_0, 8, &old_threshold); - + tx_thread_preemption_change(&thread_0, 8, &old_threshold); + /* Get mutex. */ tx_mutex_get(&mutex_1, TX_WAIT_FOREVER); tx_mutex_put(&mutex_1); @@ -638,7 +638,7 @@ static void thread_4_entry(ULONG thread_input) while(1) { - + /* Get priority inherit mutex. */ tx_mutex_get(&mutex_3, TX_WAIT_FOREVER); diff --git a/test/tx/regression/threadx_mutex_no_preemption_test.c b/test/tx/regression/threadx_mutex_no_preemption_test.c index c26c3651..3cc21b62 100644 --- a/test/tx/regression/threadx_mutex_no_preemption_test.c +++ b/test/tx/regression/threadx_mutex_no_preemption_test.c @@ -43,8 +43,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -56,8 +56,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_mutex_preemption_test.c b/test/tx/regression/threadx_mutex_preemption_test.c index 238dda03..495ae13c 100644 --- a/test/tx/regression/threadx_mutex_preemption_test.c +++ b/test/tx/regression/threadx_mutex_preemption_test.c @@ -43,8 +43,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -56,8 +56,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_mutex_priority_inheritance_test.c b/test/tx/regression/threadx_mutex_priority_inheritance_test.c index 68a7f0ce..0b76aba6 100644 --- a/test/tx/regression/threadx_mutex_priority_inheritance_test.c +++ b/test/tx/regression/threadx_mutex_priority_inheritance_test.c @@ -1,4 +1,4 @@ -/* This test is designed to test the mutex suspension and priority inheritance with another +/* This test is designed to test the mutex suspension and priority inheritance with another thread resuming the higher priority thread by doing a mutex put. Higher-priority thread should preempt. */ #include <stdio.h> @@ -74,16 +74,16 @@ CHAR *pointer; /* Test for an error creating/using a mutex from initialization. */ if (test_mutex_from_init != TX_SUCCESS) { - + printf("Running Mutex Priority Inheritance Test............................. ERROR #0\n"); test_control_return(1); - } + } /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -95,8 +95,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -108,8 +108,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 14, 14, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -123,8 +123,8 @@ CHAR *pointer; /* Create a high-priority thread that will get all the priority inheritance mutexes and return from it's entry function in order to test the auto delete feature. */ - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 10, 10, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -137,8 +137,8 @@ CHAR *pointer; } /* Create a higher-priority thread that is used to get thread 4 into a priority inheritance state. */ - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 8, 8, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -152,8 +152,8 @@ CHAR *pointer; /* Create a higher-priority thread that is used to suspend on priority inheritance mutex 3. */ - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -167,8 +167,8 @@ CHAR *pointer; /* Create a higher-priority thread that is used to suspend on priority inheritance mutex 3. */ - status = tx_thread_create(&thread_7, "thread 7", thread_7_entry, 7, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_7, "thread 7", thread_7_entry, 7, + pointer, TEST_STACK_SIZE_PRINTF, 7, 7, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -246,7 +246,7 @@ UINT status; /* Resume thread 4 to test the automatic release of the mutexes. */ tx_thread_resume(&thread_4); - + /* Determine if thread 4 was able to get the mutexes before completion... and have its original priority restored after the priority inheritance. */ if ((thread_4_counter != 1) || (thread_5_counter != 1) || (thread_4.tx_thread_priority != 10) || @@ -274,10 +274,10 @@ UINT status; printf("ERROR #13\n"); test_control_return(1); } - + /* Release mutex 2 to be compatible with original test. */ tx_mutex_put(&mutex_2); - + /* Now resume the higher priority thread to cause suspension. */ tx_thread_resume(&thread_1); @@ -314,8 +314,8 @@ UINT status; printf("ERROR #16\n"); test_control_return(1); } - - /* Now sleep for 20 ticks in order to test the priority inheritance change of a + + /* Now sleep for 20 ticks in order to test the priority inheritance change of a non-ready thread. */ tx_thread_sleep(20); @@ -330,10 +330,10 @@ UINT status; /* Resume thread 2 in order to get two threads suspended on the mutex. */ tx_thread_resume(&thread_2); - + /* Now do a mutex put to release both threads suspended on this mutex. */ status = tx_mutex_put(&mutex_0); - + /* The other thread should now be suspended on the mutex. */ if ((status != TX_SUCCESS) || (thread_1_counter != 4) || (thread_2_counter != 2) || (thread_0.tx_thread_priority != 16)) { @@ -342,7 +342,7 @@ UINT status; printf("ERROR #18\n"); test_control_return(1); } - + /* At this point, get the mutex again. */ status = tx_mutex_get(&mutex_0, TX_NO_WAIT); @@ -354,7 +354,7 @@ UINT status; printf("ERROR #19\n"); test_control_return(1); } - + /* Abort the sleep. */ tx_thread_wait_abort(&thread_1); tx_thread_wait_abort(&thread_2); @@ -362,10 +362,10 @@ UINT status; /* Now both threads are suspended again on mutex... and then terminate them. */ tx_thread_terminate(&thread_1); tx_thread_terminate(&thread_2); - + /* Now do a mutex put to release both threads suspended on this mutex. */ status = tx_mutex_put(&mutex_0); - + /* The other thread should now be suspended on the mutex. */ if ((status != TX_SUCCESS) || (thread_1_counter != 5) || (thread_2_counter != 3) || (thread_0.tx_thread_priority != 16)) { @@ -376,21 +376,21 @@ UINT status; } /* Now test the timeout on the suspension list of a priority inheritance mutex. */ - + /* First, obtain priority inheritance mutex 3. */ status = tx_mutex_get(&mutex_3, TX_WAIT_FOREVER); - + /* Next resume threads 6 and 7 so they will block on trying to get this mutex forever. */ status += tx_thread_resume(&thread_7); status += tx_thread_resume(&thread_6); - + /* Now set the flag which will cause the last thread in the suspension list to timeout (abort) resulting in a NULL suspension list and covering that branch condition in tx_mutex_put */ test_forced_mutex_timeout = 1; - + /* Perform a mutex put to release the mutex. */ status += tx_mutex_put(&mutex_3); - + /* Now check for errors. */ #ifndef TX_MISRA_ENABLE #ifndef TX_MANUAL_TEST @@ -404,9 +404,9 @@ UINT status; #endif #else if ((status != TX_SUCCESS) || (thread_6_counter != 1)) -#endif +#endif { - + /* Mutex error. */ printf("ERROR #21\n"); test_control_return(1); @@ -429,7 +429,7 @@ UINT status; while(1) { - + /* Increment thread run counter. */ thread_1_counter++; @@ -440,9 +440,9 @@ UINT status; /* Did we get the right status? */ if (status == TX_SUCCESS) thread_1_counter++; - + /* Sleep for 10 ticks... to delay. */ - tx_thread_sleep(10); + tx_thread_sleep(10); } } @@ -458,7 +458,7 @@ UINT status; while(1) { - + /* Increment thread run counter. */ thread_2_counter++; @@ -469,9 +469,9 @@ UINT status; /* Did we get the right status? */ if (status == TX_SUCCESS) thread_2_counter++; - + /* Sleep for 10 ticks... to delay. */ - tx_thread_sleep(10); + tx_thread_sleep(10); } } @@ -481,7 +481,7 @@ static void thread_4_entry(ULONG thread_input) UINT status; - + /* Get mutex to cause additional ownership linked-list processing. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); status += tx_mutex_get(&mutex_1, TX_WAIT_FOREVER); @@ -492,7 +492,7 @@ UINT status; /* Resume thread 5 to get into priority inheritance. */ tx_thread_resume(&thread_5); - /* Determine if all the mutex gets were successful... and we have + /* Determine if all the mutex gets were successful... and we have inherited priority 8. */ if ((status == TX_SUCCESS) && (thread_4.tx_thread_priority == 8)) { @@ -501,7 +501,7 @@ UINT status; thread_4_counter++; } - /* Now fall through and make sure the mutex cleanup function + /* Now fall through and make sure the mutex cleanup function releases all the mutexes. */ } @@ -511,7 +511,7 @@ static void thread_5_entry(ULONG thread_input) UINT status; - + /* Get mutex to cause priority inheritance in thread 4. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); @@ -523,7 +523,7 @@ UINT status; thread_5_counter++; } - /* Now fall through and make sure the mutex cleanup function + /* Now fall through and make sure the mutex cleanup function releases all the mutexes. */ } @@ -533,7 +533,7 @@ static void thread_6_entry(ULONG thread_input) UINT status; - + /* Get mutex to cause priority inheritance in thread 0. */ status = tx_mutex_get(&mutex_3, TX_WAIT_FOREVER); @@ -545,7 +545,7 @@ UINT status; thread_6_counter++; } - /* Now fall through and make sure the mutex cleanup function + /* Now fall through and make sure the mutex cleanup function releases all the mutexes. */ } @@ -555,7 +555,7 @@ static void thread_7_entry(ULONG thread_input) UINT status; - + /* Get mutex to cause priority inheritance in thread 0. */ status = tx_mutex_get(&mutex_3, TX_WAIT_FOREVER); @@ -567,7 +567,7 @@ UINT status; thread_7_counter++; } - /* Now fall through and make sure the mutex cleanup function + /* Now fall through and make sure the mutex cleanup function releases all the mutexes. */ } diff --git a/test/tx/regression/threadx_mutex_proritize_test.c b/test/tx/regression/threadx_mutex_proritize_test.c index 4e25673f..bbc2845b 100644 --- a/test/tx/regression/threadx_mutex_proritize_test.c +++ b/test/tx/regression/threadx_mutex_proritize_test.c @@ -76,12 +76,12 @@ static void test_isr(void) } else { - + /* Abort the wait of thread 5. */ tx_thread_wait_abort(&thread_5); /* End the ISR processing. */ - test_status = 2; + test_status = 2; test_isr_dispatch = TX_NULL; } } @@ -107,8 +107,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -120,8 +120,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -133,8 +133,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 14, 14, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -146,8 +146,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -159,8 +159,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -172,8 +172,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -185,8 +185,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -323,7 +323,7 @@ UINT status; tx_thread_resume(&thread_4); tx_thread_resume(&thread_5); tx_thread_resume(&thread_6); - + /* Prioritize the block pool suspension list. */ status = tx_mutex_prioritize(&mutex_0); @@ -338,7 +338,7 @@ UINT status; /* Now loop to test the interrupt of the prioritize loop logic. */ test_status = 1; - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; do { @@ -355,10 +355,10 @@ UINT status; } } while (test_status == 1); - + /* Now determine if thread 4 is at the front of the list... It should be! */ if (mutex_0.tx_mutex_suspension_list != &thread_4) - { + { /* Mutex error. */ printf("ERROR #17\n"); @@ -382,19 +382,19 @@ UINT status; while (1) { - + /* Suspend on the mutex. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Release the mutex. */ status += tx_mutex_put(&mutex_0); - + /* Did we get the right status? */ if (status == TX_SUCCESS) thread_1_counter++; /* Self suspend. */ - tx_thread_suspend(&thread_1); + tx_thread_suspend(&thread_1); } } @@ -407,19 +407,19 @@ UINT status; while (1) { - + /* Suspend on the mutex. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Release the mutex. */ status += tx_mutex_put(&mutex_0); - + /* Did we get the right status? */ if (status == TX_SUCCESS) thread_2_counter++; /* Self suspend. */ - tx_thread_suspend(&thread_2); + tx_thread_suspend(&thread_2); } } @@ -432,19 +432,19 @@ UINT status; while (1) { - + /* Suspend on the mutex. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Release the mutex. */ status += tx_mutex_put(&mutex_0); - + /* Did we get the right status? */ if (status == TX_SUCCESS) thread_3_counter++; /* Self suspend. */ - tx_thread_suspend(&thread_3); + tx_thread_suspend(&thread_3); } } @@ -457,19 +457,19 @@ UINT status; while (1) { - + /* Suspend on the mutex. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Release the mutex. */ status += tx_mutex_put(&mutex_0); - + /* Did we get the right status? */ if (status == TX_SUCCESS) thread_4_counter++; /* Self suspend. */ - tx_thread_suspend(&thread_4); + tx_thread_suspend(&thread_4); } } @@ -482,19 +482,19 @@ UINT status; while (1) { - + /* Suspend on the mutex. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Release the mutex. */ status += tx_mutex_put(&mutex_0); - + /* Did we get the right status? */ if (status == TX_SUCCESS) thread_5_counter++; /* Self suspend. */ - tx_thread_suspend(&thread_5); + tx_thread_suspend(&thread_5); } } @@ -507,19 +507,19 @@ UINT status; while (1) { - + /* Suspend on the mutex. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Release the mutex. */ status += tx_mutex_put(&mutex_0); - + /* Did we get the right status? */ if (status == TX_SUCCESS) thread_6_counter++; /* Self suspend. */ - tx_thread_suspend(&thread_6); + tx_thread_suspend(&thread_6); } } diff --git a/test/tx/regression/threadx_mutex_suspension_timeout_test.c b/test/tx/regression/threadx_mutex_suspension_timeout_test.c index cae257b5..f1a9dfd0 100644 --- a/test/tx/regression/threadx_mutex_suspension_timeout_test.c +++ b/test/tx/regression/threadx_mutex_suspension_timeout_test.c @@ -44,7 +44,7 @@ extern TEST_FLAG threadx_mutex_suspension_priority_test; #endif -/* This test routine is used to get NULL suspension lists in various parts of tx_mutex_put. This is hooked up to IRQ 0 on this simulation and is entered manually at the +/* This test routine is used to get NULL suspension lists in various parts of tx_mutex_put. This is hooked up to IRQ 0 on this simulation and is entered manually at the correct time. */ void abort_all_threads_suspended_on_mutex(void) { @@ -56,7 +56,7 @@ TX_THREAD *thread_ptr; { if (thread_ptr -> tx_thread_state == TX_MUTEX_SUSP) tx_thread_wait_abort(thread_ptr); - + thread_ptr = thread_ptr -> tx_thread_created_next; if (thread_ptr == _tx_thread_created_ptr) break; @@ -64,7 +64,7 @@ TX_THREAD *thread_ptr; } -/* This test routine is used to get a thread of a non ready state into _tx_mutex_change, called froim _tx_mutex_put. This is hooked up to IRQ 1 on this simulation and is entered manually at the +/* This test routine is used to get a thread of a non ready state into _tx_mutex_change, called froim _tx_mutex_put. This is hooked up to IRQ 1 on this simulation and is entered manually at the correct time. */ void suspend_lowest_priority(void) { @@ -92,28 +92,28 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 1, 1, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 2, 2, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&low_priority, "low priority", low_priority_entry, 30, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&low_priority, "low priority", low_priority_entry, 30, + pointer, TEST_STACK_SIZE_PRINTF, 30, 30, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -176,7 +176,7 @@ UINT old_priority; /* Get the mutex. */ status = tx_mutex_get(&mutex_1, TX_WAIT_FOREVER); - + /* Make sure the three higher priority threads suspend on the mutex. */ tx_thread_resume(&thread_4); tx_thread_resume(&thread_3); @@ -196,48 +196,48 @@ UINT old_priority; #endif /* Now some hand testing for tx_mutex_priority_change. */ - - /* Resume the low priority thread. */ + + /* Resume the low priority thread. */ tx_thread_resume(&low_priority); - + /* Simulate a call from inside of mutex put, but doing it here makes life easier. */ _tx_thread_preempt_disable++; - + #ifdef TX_MANUAL_TEST /* Set BP here and step into code and step through the code until the internal thread resume function returns, then issue an IRQ 1 to cause an ISR to suspend the thread and test the first condition. */ _tx_mutex_priority_change(&low_priority, 30); #else - + /* Set the flag to suspend the thread and test the first condition after internal resume is called. */ threadx_mutex_suspension_priority_test = 1; _tx_mutex_priority_change(&low_priority, 30); #endif - - /* Resume the low priority thread. */ + + /* Resume the low priority thread. */ tx_thread_resume(&low_priority); /* Now call internal _tx_mutex_priority_change, this should test the preemption-threshold throw-away path. */ _tx_mutex_priority_change(&low_priority, 30); - + /* Now make it so we can have a higher-priority thread ready but not the execute pointer because of preemption-threshold. */ tx_thread_preemption_change(&thread_0, 10, &old_preempt); tx_thread_priority_change(&low_priority, 10, &old_priority); - + /* Now call the internal mutex priority change on this thread to get the throw-away path on original priority being the same when execute ptr is different. */ _tx_thread_execute_ptr = &low_priority; _tx_mutex_priority_change(&low_priority, 10); _tx_thread_execute_ptr = &thread_0; - + /* Now make the low priority thread lower again, but with a preemption-threshold equal to thread_0. This will test yet another throw away condition. */ low_priority.tx_thread_inherit_priority = ((UINT) TX_MAX_PRIORITIES); tx_thread_priority_change(&low_priority, 30, &old_priority); tx_thread_preemption_change(&low_priority, 10, &old_preempt); - + /* Now call the internal mutex priority change on this thread with the same priority. */ _tx_mutex_priority_change(&low_priority, 30); _tx_thread_preempt_disable--; - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); diff --git a/test/tx/regression/threadx_mutex_thread_terminate_test.c b/test/tx/regression/threadx_mutex_thread_terminate_test.c index 9b552f54..ef21b92d 100644 --- a/test/tx/regression/threadx_mutex_thread_terminate_test.c +++ b/test/tx/regression/threadx_mutex_thread_terminate_test.c @@ -47,8 +47,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -60,8 +60,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -73,8 +73,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_queue_basic_eight_word_test.c b/test/tx/regression/threadx_queue_basic_eight_word_test.c index c201fdee..fb4640cc 100644 --- a/test/tx/regression/threadx_queue_basic_eight_word_test.c +++ b/test/tx/regression/threadx_queue_basic_eight_word_test.c @@ -1,5 +1,5 @@ /* This test is designed to test immediate response queue services including create - and delete. This test is for queue sizes of 8 ULONG. Two queues are used one with + and delete. This test is for queue sizes of 8 ULONG. Two queues are used one with a capacity of 1 message and another with a capacity of 3 messages. */ #include <stdio.h> @@ -40,8 +40,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -111,9 +111,9 @@ ULONG expected_message[8]; printf("ERROR #4\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -163,9 +163,9 @@ ULONG expected_message[8]; printf("ERROR #8\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -218,7 +218,7 @@ ULONG expected_message[8]; status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT); source_message[0]++; source_message[7]++; - + if (status != TX_SUCCESS) { @@ -227,9 +227,9 @@ ULONG expected_message[8]; printf("ERROR #12\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -320,9 +320,9 @@ ULONG expected_message[8]; printf("ERROR #18\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) diff --git a/test/tx/regression/threadx_queue_basic_four_word_test.c b/test/tx/regression/threadx_queue_basic_four_word_test.c index 5e01bc5b..4c54d8bd 100644 --- a/test/tx/regression/threadx_queue_basic_four_word_test.c +++ b/test/tx/regression/threadx_queue_basic_four_word_test.c @@ -1,5 +1,5 @@ /* This test is designed to test immediate response queue services including create - and delete. This test is for queue sizes of 4 ULONG. Two queues are used one with + and delete. This test is for queue sizes of 4 ULONG. Two queues are used one with a capacity of 1 message and another with a capacity of 3 messages. */ #include <stdio.h> @@ -40,8 +40,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -111,9 +111,9 @@ ULONG expected_message[4]; printf("ERROR #4\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -163,9 +163,9 @@ ULONG expected_message[4]; printf("ERROR #8\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -218,7 +218,7 @@ ULONG expected_message[4]; status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT); source_message[0]++; source_message[3]++; - + if (status != TX_SUCCESS) { @@ -227,9 +227,9 @@ ULONG expected_message[4]; printf("ERROR #12\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -320,9 +320,9 @@ ULONG expected_message[4]; printf("ERROR #18\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) diff --git a/test/tx/regression/threadx_queue_basic_max_message_size_test.c b/test/tx/regression/threadx_queue_basic_max_message_size_test.c index 30afa190..d62e80ff 100644 --- a/test/tx/regression/threadx_queue_basic_max_message_size_test.c +++ b/test/tx/regression/threadx_queue_basic_max_message_size_test.c @@ -1,5 +1,5 @@ /* This test is designed to test immediate response queue services including create - and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with + and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with a capacity of 1 message and another with a capacity of 3 messages. */ #include <stdio.h> @@ -40,8 +40,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -110,9 +110,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE]; printf("ERROR #4\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -162,9 +162,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE]; printf("ERROR #8\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -217,7 +217,7 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE]; status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT); source_message[0]++; source_message[TX_QUEUE_MESSAGE_MAX_SIZE - 1]++; - + if (status != TX_SUCCESS) { @@ -226,9 +226,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE]; printf("ERROR #12\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -319,9 +319,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE]; printf("ERROR #18\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) diff --git a/test/tx/regression/threadx_queue_basic_one_word_test.c b/test/tx/regression/threadx_queue_basic_one_word_test.c index 142a9b60..0e2f1fbc 100644 --- a/test/tx/regression/threadx_queue_basic_one_word_test.c +++ b/test/tx/regression/threadx_queue_basic_one_word_test.c @@ -1,5 +1,5 @@ /* This test is designed to test immediate response queue services including create - and delete. This test is for queue sizes of 1 ULONG. Two queues are used one with + and delete. This test is for queue sizes of 1 ULONG. Two queues are used one with a capacity of 1 message and another with a capacity of 3 messages. */ #include <stdio.h> @@ -40,7 +40,7 @@ static void thread_0_entry(ULONG thread_input); static void thread_1_entry(ULONG thread_input); -UINT _txe_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size, +UINT _txe_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size, VOID *queue_start, ULONG queue_size, UINT queue_control_block_size); @@ -65,7 +65,7 @@ ULONG destination; /* Determine if calling queue create from initialization was successful. */ if (test_queue_from_init != TX_SUCCESS) { - + /* Error! */ error++; } @@ -84,7 +84,7 @@ ULONG destination; /* Attempt to delete a queue from a timer. */ status = tx_queue_delete(&queue_0); - + /* Check for status. */ if (status != TX_CALLER_ERROR) { @@ -95,7 +95,7 @@ ULONG destination; /* Attempt to send something with suspension from a timer. */ status = tx_queue_front_send(&queue_0, &source, 100); - + /* Check for status. */ if (status != TX_WAIT_ERROR) { @@ -106,7 +106,7 @@ ULONG destination; /* Attempt to send something with suspension from a timer. */ status = tx_queue_send(&queue_0, &source, 100); - + /* Check for status. */ if (status != TX_WAIT_ERROR) { @@ -117,7 +117,7 @@ ULONG destination; /* Attempt to receive something with suspension from a timer. */ status = tx_queue_receive(&queue_0, &destination, 100); - + /* Check for status. */ if (status != TX_WAIT_ERROR) { @@ -158,7 +158,7 @@ ULONG destination; /* Attempt to delete a queue from an ISR. */ status = tx_queue_delete(&queue_0); - + /* Check for status. */ if (status != TX_CALLER_ERROR) { @@ -169,7 +169,7 @@ ULONG destination; /* Attempt to send something with suspension from an ISR. */ status = tx_queue_front_send(&queue_0, &source, 100); - + /* Check for status. */ if (status != TX_WAIT_ERROR) { @@ -180,7 +180,7 @@ ULONG destination; /* Attempt to send something with suspension from an ISR. */ status = tx_queue_send(&queue_0, &source, 100); - + /* Check for status. */ if (status != TX_WAIT_ERROR) { @@ -191,7 +191,7 @@ ULONG destination; /* Attempt to receive something with suspension from an ISR. */ status = tx_queue_receive(&queue_0, &destination, 100); - + /* Check for status. */ if (status != TX_WAIT_ERROR) { @@ -224,13 +224,13 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -380,7 +380,7 @@ CHAR *pointer; /* Attempt to delete a NULL pointer. */ status = tx_queue_delete(TX_NULL); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -393,7 +393,7 @@ CHAR *pointer; /* Attempt to delete a non-created queue. */ queue_2.tx_queue_id = 0; status = tx_queue_delete(&queue_2); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -405,7 +405,7 @@ CHAR *pointer; /* Attempt to flush a NULL pointer. */ status = tx_queue_flush(TX_NULL); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -418,7 +418,7 @@ CHAR *pointer; /* Attempt to flush a non-created queue. */ queue_2.tx_queue_id = 0; status = tx_queue_flush(&queue_2); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -430,7 +430,7 @@ CHAR *pointer; /* Attempt to send something to the front of a non-queue. */ status = tx_queue_front_send(TX_NULL, &source_message, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -439,11 +439,11 @@ CHAR *pointer; printf("ERROR #15\n"); test_control_return(1); } - + /* Attempt to send something to the front of a non-created queue. */ queue_2.tx_queue_id = 0; status = tx_queue_front_send(&queue_2, &source_message, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -455,7 +455,7 @@ CHAR *pointer; /* Attempt to send something with a NULL source pointer. */ status = tx_queue_front_send(&queue_0, TX_NULL, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_PTR_ERROR) { @@ -467,7 +467,7 @@ CHAR *pointer; /* Attempt to send something to a non-queue. */ status = tx_queue_send(TX_NULL, &source_message, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -476,11 +476,11 @@ CHAR *pointer; printf("ERROR #18\n"); test_control_return(1); } - + /* Attempt to send something to a non-created queue. */ queue_2.tx_queue_id = 0; status = tx_queue_send(&queue_2, &source_message, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -492,7 +492,7 @@ CHAR *pointer; /* Attempt to send something with a NULL source pointer. */ status = tx_queue_send(&queue_0, TX_NULL, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_PTR_ERROR) { @@ -504,7 +504,7 @@ CHAR *pointer; /* Attempt to receive something from a non-queue. */ status = tx_queue_receive(TX_NULL, &dest_message, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -517,7 +517,7 @@ CHAR *pointer; /* Attempt to receive something from a non-created queue. */ queue_2.tx_queue_id = 0; status = tx_queue_receive(&queue_2, &dest_message, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_QUEUE_ERROR) { @@ -529,7 +529,7 @@ CHAR *pointer; /* Attempt to receive something to a NULL destination. */ status = tx_queue_receive(&queue_0, TX_NULL, TX_NO_WAIT); - + /* Check for status. */ if (status != TX_PTR_ERROR) { @@ -550,9 +550,9 @@ CHAR *pointer; printf("ERROR #24\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -602,7 +602,7 @@ CHAR *pointer; } /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -649,7 +649,7 @@ CHAR *pointer; source_message++; status += tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); source_message++; - + if (status != TX_SUCCESS) { @@ -657,9 +657,9 @@ CHAR *pointer; printf("ERROR #32\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -735,9 +735,9 @@ CHAR *pointer; printf("ERROR #38\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -810,7 +810,7 @@ CHAR *pointer; /* Resume thread 1 so that we can take an interrupt on top of it. */ tx_thread_resume(&thread_1); - + /* Sleep for a bit... */ tx_thread_sleep(3); @@ -820,7 +820,7 @@ CHAR *pointer; /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Queue error. */ printf("ERROR #44\n"); test_control_return(1); diff --git a/test/tx/regression/threadx_queue_basic_sixteen_word_test.c b/test/tx/regression/threadx_queue_basic_sixteen_word_test.c index 703a1cf4..de3ede98 100644 --- a/test/tx/regression/threadx_queue_basic_sixteen_word_test.c +++ b/test/tx/regression/threadx_queue_basic_sixteen_word_test.c @@ -1,5 +1,5 @@ /* This test is designed to test immediate response queue services including create - and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with + and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with a capacity of 1 message and another with a capacity of 3 messages. */ #include <stdio.h> @@ -40,8 +40,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -111,9 +111,9 @@ ULONG expected_message[16]; printf("ERROR #4\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -163,9 +163,9 @@ ULONG expected_message[16]; printf("ERROR #8\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -218,7 +218,7 @@ ULONG expected_message[16]; status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT); source_message[0]++; source_message[15]++; - + if (status != TX_SUCCESS) { @@ -227,9 +227,9 @@ ULONG expected_message[16]; printf("ERROR #12\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -320,9 +320,9 @@ ULONG expected_message[16]; printf("ERROR #18\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) diff --git a/test/tx/regression/threadx_queue_basic_two_word_test.c b/test/tx/regression/threadx_queue_basic_two_word_test.c index ab24d08e..46d85a6d 100644 --- a/test/tx/regression/threadx_queue_basic_two_word_test.c +++ b/test/tx/regression/threadx_queue_basic_two_word_test.c @@ -1,5 +1,5 @@ /* This test is designed to test immediate response queue services including create - and delete. This test is for queue sizes of 2 ULONG. Two queues are used one with + and delete. This test is for queue sizes of 2 ULONG. Two queues are used one with a capacity of 1 message and another with a capacity of 3 messages. */ #include <stdio.h> @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -116,7 +116,7 @@ ULONG expected_message[2]; queue_memory.second_middle= 0x61718191; queue_memory.next_to_last = 0x99aabbcc; queue_memory.last = 0xddeeff00; - + /* Create the queue. */ status = tx_queue_create(&queue_memory.queue, "queue memory", TX_2_ULONG, &queue_memory.queue_area[0], (2048*sizeof(ULONG))/sizeof(ULONG)); tx_queue_delete(&queue_memory.queue); @@ -151,9 +151,9 @@ ULONG expected_message[2]; printf("ERROR #5\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -203,9 +203,9 @@ ULONG expected_message[2]; printf("ERROR #9\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -258,7 +258,7 @@ ULONG expected_message[2]; status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT); source_message[0]++; source_message[1]++; - + if (status != TX_SUCCESS) { @@ -267,9 +267,9 @@ ULONG expected_message[2]; printf("ERROR #13\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -360,9 +360,9 @@ ULONG expected_message[2]; printf("ERROR #19\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) diff --git a/test/tx/regression/threadx_queue_empty_suspension_test.c b/test/tx/regression/threadx_queue_empty_suspension_test.c index 59d53e70..c63b1715 100644 --- a/test/tx/regression/threadx_queue_empty_suspension_test.c +++ b/test/tx/regression/threadx_queue_empty_suspension_test.c @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -67,8 +67,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -80,8 +80,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -107,7 +107,7 @@ CHAR *pointer; /* Setup queue send notification. */ status = tx_queue_send_notify(&queue_0, queue_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ @@ -117,7 +117,7 @@ CHAR *pointer; printf("Running Queue Empty Suspension Test................................. ERROR #5\n"); test_control_return(1); } - + #else /* Check for status. */ @@ -128,7 +128,7 @@ CHAR *pointer; test_control_return(1); } -#endif +#endif } @@ -193,12 +193,12 @@ ULONG source_message[2] = {0x12345678, 0}; /* Now resume thread 2 to get another thread suspended on an empty queue. */ tx_thread_resume(&thread_2); - + /* Now send 2 messages to wakeup both threads! */ source_message[0]++; status = tx_queue_send(&queue_0, &source_message[0], TX_NO_WAIT); status += tx_queue_send(&queue_0, &source_message[0], TX_NO_WAIT); - + /* Check status and run count of other thread - it should have got the message already. */ if ((status != TX_SUCCESS) || (thread_1_counter != 2) || (thread_2_counter != 1)) diff --git a/test/tx/regression/threadx_queue_flush_no_suspension_test.c b/test/tx/regression/threadx_queue_flush_no_suspension_test.c index 940259f2..95bd5fed 100644 --- a/test/tx/regression/threadx_queue_flush_no_suspension_test.c +++ b/test/tx/regression/threadx_queue_flush_no_suspension_test.c @@ -44,8 +44,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -73,7 +73,7 @@ CHAR *pointer; status = tx_queue_send_notify(&queue_0, queue_notify); #ifndef TX_DISABLE_NOTIFY_CALLBACKS - + /* Check for status. */ if (status != TX_SUCCESS) { diff --git a/test/tx/regression/threadx_queue_flush_test.c b/test/tx/regression/threadx_queue_flush_test.c index 6d65c971..77f8d2d5 100644 --- a/test/tx/regression/threadx_queue_flush_test.c +++ b/test/tx/regression/threadx_queue_flush_test.c @@ -52,8 +52,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -65,8 +65,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -78,8 +78,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -108,7 +108,7 @@ CHAR *pointer; status = tx_queue_send_notify(&queue_0, queue_notify); #ifndef TX_DISABLE_NOTIFY_CALLBACKS - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -203,7 +203,7 @@ UINT status; } else { - + /* Queue Flush error. */ printf("ERROR #11\n"); test_control_return(1); diff --git a/test/tx/regression/threadx_queue_front_send_test.c b/test/tx/regression/threadx_queue_front_send_test.c index 5329670b..d03e7ac2 100644 --- a/test/tx/regression/threadx_queue_front_send_test.c +++ b/test/tx/regression/threadx_queue_front_send_test.c @@ -60,8 +60,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -73,12 +73,12 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status = tx_thread_create(&thread_1a, "thread 1a", thread_1a_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1a, "thread 1a", thread_1a_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -90,12 +90,12 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status = tx_thread_create(&thread_2a, "thread 2a", thread_2a_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2a, "thread 2a", thread_2a_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -125,7 +125,7 @@ CHAR *pointer; status = tx_queue_send_notify(&queue_0, queue_notify); #ifndef TX_DISABLE_NOTIFY_CALLBACKS - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -164,7 +164,7 @@ ULONG temp[2]; printf("Running Queue Front Test............................................ "); /* Perform the 1 word queue front send test. */ - + /* Increment thread 0 counter. */ thread_0_counter++; @@ -178,7 +178,7 @@ ULONG temp[2]; printf("ERROR #7a\n"); test_control_return(1); } - + /* Place a new message on the front of the queue. */ temp[0] = 0xF000001; status = tx_queue_front_send(&queue_0a, &temp[0], TX_NO_WAIT); @@ -226,17 +226,17 @@ ULONG temp[2]; printf("ERROR #11a\n"); test_control_return(1); } - - /* At this point the queue is empty. Resume another thread to + + /* At this point the queue is empty. Resume another thread to suspend on an empty queue. */ tx_thread_resume(&thread_1a); - + /* Relinquish to get this thread suspended on the empty queue. */ tx_thread_relinquish(); - + /* Resume thread 2a to get another thread suspended on the empty queue. */ tx_thread_resume(&thread_2a); - + /* Now send something to the front of the queue, which will resume the first waiting thread. */ temp[0] = 0xFF00002; @@ -262,10 +262,10 @@ ULONG temp[2]; printf("ERROR #13a\n"); test_control_return(1); } - + /* Now relinquish again to let the other thread process the message. */ tx_thread_relinquish(); - + /* At this point, the other thread should have placed 2 messages on the queue so we will now send to the front, but without suspension. */ temp[0] = 0xFF00003; @@ -293,11 +293,11 @@ ULONG temp[2]; /* Now resume thread 2a to get another thread suspended on the queue. */ tx_thread_resume(&thread_2a); - + temp[0] = 0xFF00004; status = tx_queue_front_send(&queue_0a, &temp[0], TX_WAIT_FOREVER); - - /* When we get back, the other thread has received all the messages and + + /* When we get back, the other thread has received all the messages and verified they are in order AND relinquished. */ if ((status != TX_SUCCESS) || (thread_1a_counter != 1)) { @@ -307,7 +307,7 @@ ULONG temp[2]; test_control_return(1); } - + /* Perform the multiword queue front send test. */ @@ -328,7 +328,7 @@ ULONG temp[2]; printf("ERROR #7\n"); test_control_return(1); } - + /* Place a new message on the front of the queue. */ temp[0] = 0xF000001; status = tx_queue_front_send(&queue_0, &temp[0], TX_NO_WAIT); @@ -376,17 +376,17 @@ ULONG temp[2]; printf("ERROR #11\n"); test_control_return(1); } - - /* At this point the queue is empty. Resume another thread to + + /* At this point the queue is empty. Resume another thread to suspend on an empty queue. */ tx_thread_resume(&thread_1); - + /* Relinquish to get this thread suspended on the empty queue. */ tx_thread_relinquish(); - + /* Resume thread 2 to get another thread suspended on the empty queue. */ tx_thread_resume(&thread_2); - + /* Now send something to the front of the queue, which will resume the first waiting thread. */ temp[0] = 0xFF00002; @@ -412,10 +412,10 @@ ULONG temp[2]; printf("ERROR #13\n"); test_control_return(1); } - + /* Now relinquish again to let the other thread process the message. */ tx_thread_relinquish(); - + /* At this point, the other thread should have placed 2 messages on the queue so we will now send to the front, but without suspension. */ temp[0] = 0xFF00003; @@ -443,11 +443,11 @@ ULONG temp[2]; /* Now resume thread 2 to get another thread suspended on the queue. */ tx_thread_resume(&thread_2); - + temp[0] = 0xFF00004; status = tx_queue_front_send(&queue_0, &temp[0], TX_WAIT_FOREVER); - - /* When we get back, the other thread has received all the messages and + + /* When we get back, the other thread has received all the messages and verified they are in order AND relinquished. */ if ((status != TX_SUCCESS) || (thread_1_counter != 1)) { @@ -480,18 +480,18 @@ ULONG dest_message[2]; /* Determine if the message is good. */ if ((status != TX_SUCCESS) || (dest_message[0] != 0xFF00002)) return; - + /* Now fill the queue with two messages. */ status = tx_queue_send(&queue_0, &source_message[0], TX_WAIT_FOREVER); source_message[0]++; status += tx_queue_front_send(&queue_0, &source_message[0], TX_WAIT_FOREVER); - + if (status != TX_SUCCESS) return; /* Now let thread 0 send to the front of the queue with suspension. */ tx_thread_relinquish(); - + /* Attempt to receive three messages from the queue. */ status = tx_queue_receive(&queue_0, &dest_message[0], TX_NO_WAIT); @@ -518,10 +518,10 @@ ULONG dest_message[2]; status = tx_queue_send(&queue_0, &source_message[0], TX_WAIT_FOREVER); source_message[0]++; status += tx_queue_front_send(&queue_0, &source_message[0], TX_WAIT_FOREVER); - + if (status != TX_SUCCESS) return; - + /* Now let thread 0 send to the front of the queue with suspension. */ tx_thread_relinquish(); @@ -552,11 +552,11 @@ ULONG dest_message[2]; /* Should be an error. */ if ((status != TX_SUCCESS) || (dest_message[0] != 0xEE000003)) return; - + /* Increment this threads counter. */ thread_1_counter++; } - + static void thread_2_entry(ULONG thread_input) { @@ -567,7 +567,7 @@ ULONG destination_message[2]; /* Receive message. */ tx_queue_receive(&queue_0, &destination_message[0], TX_WAIT_FOREVER); - + /* Self suspend. */ tx_thread_suspend(&thread_2); @@ -590,18 +590,18 @@ ULONG dest_message[2]; /* Determine if the message is good. */ if ((status != TX_SUCCESS) || (dest_message[0] != 0xFF00002)) return; - + /* Now fill the queue with two messages. */ status = tx_queue_send(&queue_0a, &source_message[0], TX_WAIT_FOREVER); source_message[0]++; status += tx_queue_front_send(&queue_0a, &source_message[0], TX_WAIT_FOREVER); - + if (status != TX_SUCCESS) return; /* Now let thread 0 send to the front of the queue with suspension. */ tx_thread_relinquish(); - + /* Attempt to receive three messages from the queue. */ status = tx_queue_receive(&queue_0a, &dest_message[0], TX_NO_WAIT); @@ -628,10 +628,10 @@ ULONG dest_message[2]; status = tx_queue_send(&queue_0a, &source_message[0], TX_WAIT_FOREVER); source_message[0]++; status += tx_queue_front_send(&queue_0a, &source_message[0], TX_WAIT_FOREVER); - + if (status != TX_SUCCESS) return; - + /* Now let thread 0 send to the front of the queue with suspension. */ tx_thread_relinquish(); @@ -662,11 +662,11 @@ ULONG dest_message[2]; /* Should be an error. */ if ((status != TX_SUCCESS) || (dest_message[0] != 0xEE000003)) return; - + /* Increment this threads counter. */ thread_1a_counter++; } - + static void thread_2a_entry(ULONG thread_input) { @@ -677,7 +677,7 @@ ULONG destination_message[2]; /* Receive message. */ tx_queue_receive(&queue_0a, &destination_message[0], TX_WAIT_FOREVER); - + /* Self suspend. */ tx_thread_suspend(&thread_2a); diff --git a/test/tx/regression/threadx_queue_full_suspension_test.c b/test/tx/regression/threadx_queue_full_suspension_test.c index 556a4c77..687ef04a 100644 --- a/test/tx/regression/threadx_queue_full_suspension_test.c +++ b/test/tx/regression/threadx_queue_full_suspension_test.c @@ -66,8 +66,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -79,12 +79,12 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_1a, "thread 1a", thread_1a_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_1a, "thread 1a", thread_1a_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -96,12 +96,12 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_2a, "thread 2a", thread_2a_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_2a, "thread 2a", thread_2a_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -131,7 +131,7 @@ CHAR *pointer; status = tx_queue_send_notify(&queue_0, queue_notify); #ifndef TX_DISABLE_NOTIFY_CALLBACKS - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -167,7 +167,7 @@ ULONG dest_message[2]; /* Inform user. */ printf("Running Queue Full Suspension Test.................................. "); - + /* Perform the one word queue version. */ /* Suspend to get thread 1a to pend on the queue. */ @@ -179,14 +179,14 @@ ULONG dest_message[2]; tx_queue_delete(&queue_0a); status += tx_queue_create(&queue_0a, "queue 0a", TX_1_ULONG, queue_area, sizeof(queue_area)); - + /* Fill the queue with an initial 3 messages! */ status += tx_queue_send(&queue_0a, &source_message[0], TX_NO_WAIT); status += tx_queue_send(&queue_0a, &source_message[0], TX_NO_WAIT); status += tx_queue_send(&queue_0a, &source_message[0], TX_NO_WAIT); source_message[0]++; - /* Receive two of the messages back to put the first received message at the end + /* Receive two of the messages back to put the first received message at the end of the queue. */ status += tx_queue_receive(&queue_0a, &dest_message[0], TX_NO_WAIT); status += tx_queue_receive(&queue_0a, &dest_message[0], TX_NO_WAIT); @@ -219,12 +219,12 @@ ULONG dest_message[2]; test_control_return(1); } - /* Perform the two word queue version. */ - + /* Perform the two word queue version. */ + /* Reset the source message. */ source_message[0] = 0x12345678; - source_message[1] = 0; - + source_message[1] = 0; + /* Resume threads 1 and 2. */ tx_thread_resume(&thread_1); tx_thread_resume(&thread_2); @@ -235,7 +235,7 @@ ULONG dest_message[2]; status += tx_queue_send(&queue_0, &source_message[0], TX_NO_WAIT); source_message[0]++; - /* Receive two of the messages back to put the first received message at the end + /* Receive two of the messages back to put the first received message at the end of the queue. */ status += tx_queue_receive(&queue_0, &dest_message[0], TX_NO_WAIT); status += tx_queue_receive(&queue_0, &dest_message[0], TX_NO_WAIT); diff --git a/test/tx/regression/threadx_queue_information_test.c b/test/tx/regression/threadx_queue_information_test.c index c1db82ca..5fcdbb8f 100644 --- a/test/tx/regression/threadx_queue_information_test.c +++ b/test/tx/regression/threadx_queue_information_test.c @@ -43,8 +43,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -147,9 +147,9 @@ ULONG timeouts; printf("ERROR #5\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -199,7 +199,7 @@ ULONG timeouts; } /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -246,7 +246,7 @@ ULONG timeouts; source_message++; status += tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); source_message++; - + if (status != TX_SUCCESS) { @@ -254,9 +254,9 @@ ULONG timeouts; printf("ERROR #13\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -332,9 +332,9 @@ ULONG timeouts; printf("ERROR #19\n"); test_control_return(1); } - + /* Attempt to place something on a full queue. */ - status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); + status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT); /* Should be an error. */ if (status != TX_QUEUE_FULL) @@ -397,9 +397,9 @@ ULONG timeouts; status = tx_queue_info_get(&queue_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_queue_info_get(&queue_0, &name, &enqueued, &available_storage, &first_suspended, &suspended_count, &next_queue); - /* Check for errors. */ - if ((status != TX_SUCCESS) || (enqueued != queue_0.tx_queue_enqueued) || (available_storage != queue_0.tx_queue_available_storage) || - (first_suspended != queue_0.tx_queue_suspension_list) || (suspended_count != queue_0.tx_queue_suspended_count) || + /* Check for errors. */ + if ((status != TX_SUCCESS) || (enqueued != queue_0.tx_queue_enqueued) || (available_storage != queue_0.tx_queue_available_storage) || + (first_suspended != queue_0.tx_queue_suspension_list) || (suspended_count != queue_0.tx_queue_suspended_count) || (next_queue != queue_0.tx_queue_created_next)) { @@ -413,7 +413,7 @@ ULONG timeouts; /* Test null pointer for queue performance info get. */ status = _tx_queue_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_PTR_ERROR) { @@ -426,9 +426,9 @@ ULONG timeouts; status = tx_queue_performance_info_get(&queue_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_queue_performance_info_get(&queue_0, &messages_sent, &messages_received, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Check for errors. */ - if ((status != TX_SUCCESS) || (messages_sent != queue_0.tx_queue_performance_messages_sent_count) || (messages_received != queue_0.tx_queue_performance_messages_received_count) || - (empty_suspensions != queue_0.tx_queue_performance_empty_suspension_count) || (full_suspensions != queue_0.tx_queue_performance_full_suspension_count) || + /* Check for errors. */ + if ((status != TX_SUCCESS) || (messages_sent != queue_0.tx_queue_performance_messages_sent_count) || (messages_received != queue_0.tx_queue_performance_messages_received_count) || + (empty_suspensions != queue_0.tx_queue_performance_empty_suspension_count) || (full_suspensions != queue_0.tx_queue_performance_full_suspension_count) || (full_errors != queue_0.tx_queue_performance_full_error_count) || (timeouts != queue_0.tx_queue_performance_timeout_count)) { @@ -441,9 +441,9 @@ ULONG timeouts; status = tx_queue_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_queue_performance_system_info_get(&messages_sent, &messages_received, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Check for errors. */ - if ((status != TX_SUCCESS) || (messages_sent != _tx_queue_performance_messages_sent_count) || (messages_received != _tx_queue_performance__messages_received_count) || - (empty_suspensions != _tx_queue_performance_empty_suspension_count) || (full_suspensions != _tx_queue_performance_full_suspension_count) || + /* Check for errors. */ + if ((status != TX_SUCCESS) || (messages_sent != _tx_queue_performance_messages_sent_count) || (messages_received != _tx_queue_performance__messages_received_count) || + (empty_suspensions != _tx_queue_performance_empty_suspension_count) || (full_suspensions != _tx_queue_performance_full_suspension_count) || (full_errors != _tx_queue_performance_full_error_count) || (timeouts != _tx_queue_performance_timeout_count)) { @@ -457,7 +457,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(&queue_0, &messages_sent, &messages_received, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -469,7 +469,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(TX_NULL, &messages_sent, &messages_received, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -481,7 +481,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(TX_NULL, TX_NULL, &messages_received, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -493,7 +493,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(TX_NULL, TX_NULL, TX_NULL, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -505,7 +505,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -517,7 +517,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -529,7 +529,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -541,7 +541,7 @@ ULONG timeouts; /* Get performance information. */ status = tx_queue_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -553,7 +553,7 @@ ULONG timeouts; /* Get system performance information. */ status = tx_queue_performance_system_info_get(&messages_sent, &messages_received, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -565,7 +565,7 @@ ULONG timeouts; /* Get system performance information. */ status = tx_queue_performance_system_info_get(TX_NULL, &messages_received, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -577,7 +577,7 @@ ULONG timeouts; /* Get system performance information. */ status = tx_queue_performance_system_info_get(TX_NULL, TX_NULL, &empty_suspensions, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -589,7 +589,7 @@ ULONG timeouts; /* Get system performance information. */ status = tx_queue_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, &full_suspensions, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -601,7 +601,7 @@ ULONG timeouts; /* Get system performance information. */ status = tx_queue_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &full_errors, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -613,7 +613,7 @@ ULONG timeouts; /* Get system performance information. */ status = tx_queue_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { @@ -625,7 +625,7 @@ ULONG timeouts; /* Get system performance information. */ status = tx_queue_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - /* Should be an error! */ + /* Should be an error! */ if (status != TX_FEATURE_NOT_ENABLED) { diff --git a/test/tx/regression/threadx_queue_prioritize.c b/test/tx/regression/threadx_queue_prioritize.c index 7a9d2b44..53c19275 100644 --- a/test/tx/regression/threadx_queue_prioritize.c +++ b/test/tx/regression/threadx_queue_prioritize.c @@ -81,12 +81,12 @@ static void test_isr(void) } else { - + /* Abort the wait of thread 5. */ tx_thread_wait_abort(&thread_5); /* End the ISR processing. */ - test_status = 2; + test_status = 2; test_isr_dispatch = TX_NULL; } } @@ -112,8 +112,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -125,8 +125,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -138,8 +138,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -152,8 +152,8 @@ CHAR *pointer; } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -165,8 +165,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -178,8 +178,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -191,8 +191,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -220,7 +220,7 @@ CHAR *pointer; status = tx_queue_send_notify(&queue_0, queue_notify); #ifndef TX_DISABLE_NOTIFY_CALLBACKS - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -335,7 +335,7 @@ UINT status; printf("ERROR #15\n"); test_control_return(1); } - + /* At this point we are going to get more than 2 threads suspended. */ tx_thread_resume(&thread_1); tx_thread_resume(&thread_2); @@ -343,7 +343,7 @@ UINT status; tx_thread_resume(&thread_4); tx_thread_resume(&thread_5); tx_thread_resume(&thread_6); - + /* Prioritize the queue suspension list. */ status = tx_queue_prioritize(&queue_0); @@ -355,10 +355,10 @@ UINT status; printf("ERROR #16\n"); test_control_return(1); } - + /* Now loop to test the interrupt of the prioritize loop logic. */ test_status = 1; - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; do { @@ -375,10 +375,10 @@ UINT status; } } while (test_status == 1); - + /* Now determine if thread 4 is at the front of the list... It should be! */ if (queue_0.tx_queue_suspension_list != &thread_4) - { + { /* Queue error. */ printf("ERROR #18\n"); diff --git a/test/tx/regression/threadx_queue_suspension_timeout_test.c b/test/tx/regression/threadx_queue_suspension_timeout_test.c index a3c390ed..92dca991 100644 --- a/test/tx/regression/threadx_queue_suspension_timeout_test.c +++ b/test/tx/regression/threadx_queue_suspension_timeout_test.c @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -67,8 +67,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -80,8 +80,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -120,7 +120,7 @@ CHAR *pointer; status = tx_queue_send_notify(&queue_0, queue_notify); #ifndef TX_DISABLE_NOTIFY_CALLBACKS - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -184,7 +184,7 @@ ULONG source_message[2] = {0x12345678, 0}; printf("ERROR #9a\n"); test_control_return(1); } - + /* Send message that should cause this thread to suspend. The timeout should cause it to resume with a TX_QUEUE_FULL error code. */ status = tx_queue_send(&queue_0, &source_message[0], 32); @@ -217,7 +217,7 @@ ULONG dest_message[2]; { - /* Receive message from empty queue with suspension and timeout. + /* Receive message from empty queue with suspension and timeout. We should wakeup after the timeout expires with an empty status. */ status = tx_queue_receive(&queue_1, &dest_message[0], 20); @@ -241,7 +241,7 @@ ULONG dest_message[2]; { - /* Receive message from empty queue with suspension and timeout. + /* Receive message from empty queue with suspension and timeout. We should wakeup after the timeout expires with an empty status. */ status = tx_queue_receive(&queue_1, &dest_message[0], 20); diff --git a/test/tx/regression/threadx_queue_thread_terminate_test.c b/test/tx/regression/threadx_queue_thread_terminate_test.c index d0834704..97d8a569 100644 --- a/test/tx/regression/threadx_queue_thread_terminate_test.c +++ b/test/tx/regression/threadx_queue_thread_terminate_test.c @@ -48,8 +48,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -61,8 +61,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -85,10 +85,10 @@ CHAR *pointer; printf("Running Queue Thread Terminate Test................................. ERROR #3\n"); test_control_return(1); } - + /* Setup queue send notification. */ status = tx_queue_send_notify(&queue_0, queue_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ diff --git a/test/tx/regression/threadx_semaphore_basic_test.c b/test/tx/regression/threadx_semaphore_basic_test.c index f554257d..33ee3257 100644 --- a/test/tx/regression/threadx_semaphore_basic_test.c +++ b/test/tx/regression/threadx_semaphore_basic_test.c @@ -72,7 +72,7 @@ UINT status; /* Determine if calling semaphore create from initialization was successful. */ if (test_semaphore_from_init != TX_SUCCESS) { - + /* Error! */ error++; } @@ -182,13 +182,13 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -240,11 +240,11 @@ UINT status; semaphore_memory.second = 0x55667788; semaphore_memory.next_to_last = 0x99aabbcc; semaphore_memory.last = 0xddeeff00; - + /* Create the semaphore. */ status = tx_semaphore_create(&semaphore_memory.semaphore, "semaphore memory", 0); tx_semaphore_delete(&semaphore_memory.semaphore); - + /* Check for status. */ if ((status != TX_SUCCESS) || (semaphore_memory.first != 0x11223344) || @@ -463,7 +463,7 @@ UINT status; /* Attempt to get from semaphore with an instance. Should be successful. */ status = tx_semaphore_get(&semaphore_1, TX_NO_WAIT); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -496,7 +496,7 @@ UINT status; /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Semaphore error. */ printf("ERROR #22\n"); test_control_return(1); @@ -539,7 +539,7 @@ static void thread_1_entry(ULONG thread_input) while(1) { - + tx_thread_relinquish(); } }
\ No newline at end of file diff --git a/test/tx/regression/threadx_semaphore_ceiling_put_test.c b/test/tx/regression/threadx_semaphore_ceiling_put_test.c index 5364d2d9..7d4f5832 100644 --- a/test/tx/regression/threadx_semaphore_ceiling_put_test.c +++ b/test/tx/regression/threadx_semaphore_ceiling_put_test.c @@ -55,8 +55,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -68,8 +68,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -81,8 +81,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -108,7 +108,7 @@ CHAR *pointer; /* Setup the semaphore notify callback. */ status = tx_semaphore_put_notify(&semaphore_0, put_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ @@ -205,15 +205,15 @@ UINT status; /* At this point, we need to resume thread 2 and relinquish in order to get that thread suspended on the semaphore as well. */ tx_thread_resume(&thread_2); - tx_thread_relinquish(); - + tx_thread_relinquish(); + /* Perform 2 semaphore put operations to resume both threads. */ status = tx_semaphore_ceiling_put(&semaphore_0, 2); status += tx_semaphore_ceiling_put(&semaphore_0, 2); /* Let both threads run again. */ - tx_thread_relinquish(); - + tx_thread_relinquish(); + /* Check the status and the run counter of the other thread. */ if ((status != TX_SUCCESS) || (thread_1_counter != 5) || (thread_2_counter != 3)) { @@ -222,7 +222,7 @@ UINT status; printf("ERROR #11\n"); test_control_return(1); } - + /* Now turn off the semaphore notification. */ status = tx_semaphore_put_notify(&semaphore_0, TX_NULL); @@ -234,7 +234,7 @@ UINT status; /* Put a semaphore on a semaphore that does not have suspension. */ status += tx_semaphore_ceiling_put(&semaphore_1, 2); - + /* Repeat the semaphore ceiling put without notification process! */ /* Place an instance on the semaphore, this should resume the other thread @@ -265,15 +265,15 @@ UINT status; /* At this point, we need to resume thread 2 and relinquish in order to get that thread suspended on the semaphore as well. */ tx_thread_resume(&thread_2); - tx_thread_relinquish(); - + tx_thread_relinquish(); + /* Perform 2 semaphore put operations to resume both threads. */ status = tx_semaphore_ceiling_put(&semaphore_0, 2); status += tx_semaphore_ceiling_put(&semaphore_0, 2); /* Let both threads run again. */ - tx_thread_relinquish(); - + tx_thread_relinquish(); + /* Check the status and the run counter of the other thread. */ if ((status != TX_SUCCESS) || (thread_1_counter != 9) || (thread_2_counter != 5)) { @@ -281,7 +281,7 @@ UINT status; /* Semaphore error. */ printf("ERROR #11a\n"); test_control_return(1); - } + } else { @@ -299,7 +299,7 @@ UINT status; while(1) { - + /* Increment thread run counter. */ thread_1_counter++; @@ -320,7 +320,7 @@ UINT status; while(1) { - + /* Increment thread run counter. */ thread_2_counter++; diff --git a/test/tx/regression/threadx_semaphore_delete_test.c b/test/tx/regression/threadx_semaphore_delete_test.c index f18d31dc..2c9bc1aa 100644 --- a/test/tx/regression/threadx_semaphore_delete_test.c +++ b/test/tx/regression/threadx_semaphore_delete_test.c @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -67,8 +67,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -80,8 +80,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -106,7 +106,7 @@ CHAR *pointer; /* Setup the semaphore notify callback. */ status = tx_semaphore_put_notify(&semaphore_0, put_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ diff --git a/test/tx/regression/threadx_semaphore_information_test.c b/test/tx/regression/threadx_semaphore_information_test.c index a8f6d242..d2e9bd57 100644 --- a/test/tx/regression/threadx_semaphore_information_test.c +++ b/test/tx/regression/threadx_semaphore_information_test.c @@ -45,8 +45,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -185,7 +185,7 @@ ULONG timeouts; /* Attempt to get from semaphore with an instance. Should be successful. */ status = tx_semaphore_get(&semaphore_1, TX_NO_WAIT); - + /* Check status. */ if (status != TX_SUCCESS) { @@ -198,10 +198,10 @@ ULONG timeouts; /* Get semaphore information. */ status = tx_semaphore_info_get(&semaphore_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_semaphore_info_get(&semaphore_0, &name, ¤t_value, &first_suspended, &suspended_count, &next_semaphore); - + /* Check status. */ - if ((status != TX_SUCCESS) || (current_value != semaphore_0.tx_semaphore_count) || - (first_suspended != semaphore_0.tx_semaphore_suspension_list) || (suspended_count != semaphore_0.tx_semaphore_suspended_count) || + if ((status != TX_SUCCESS) || (current_value != semaphore_0.tx_semaphore_count) || + (first_suspended != semaphore_0.tx_semaphore_suspension_list) || (suspended_count != semaphore_0.tx_semaphore_suspended_count) || (next_semaphore != semaphore_0.tx_semaphore_created_next)) { @@ -227,9 +227,9 @@ ULONG timeouts; /* Get semaphore performance information. */ status = tx_semaphore_performance_info_get(&semaphore_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_semaphore_performance_info_get(&semaphore_0, &puts, &gets, &suspensions, &timeouts); - + /* Check status. */ - if ((status != TX_SUCCESS) || (puts != semaphore_0.tx_semaphore_performance_put_count) || (gets != semaphore_0.tx_semaphore_performance_get_count) || + if ((status != TX_SUCCESS) || (puts != semaphore_0.tx_semaphore_performance_put_count) || (gets != semaphore_0.tx_semaphore_performance_get_count) || (suspensions != semaphore_0.tx_semaphore_performance_suspension_count) || (timeouts != semaphore_0.tx_semaphore_performance_timeout_count)) { @@ -237,13 +237,13 @@ ULONG timeouts; printf("ERROR #13\n"); test_control_return(1); } - + /* Get semaphore system performance information. */ status = tx_semaphore_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_semaphore_performance_system_info_get(&puts, &gets, &suspensions, &timeouts); - + /* Check status. */ - if ((status != TX_SUCCESS) || (puts != _tx_semaphore_performance_put_count) || (gets != _tx_semaphore_performance_get_count) || + if ((status != TX_SUCCESS) || (puts != _tx_semaphore_performance_put_count) || (gets != _tx_semaphore_performance_get_count) || (suspensions != _tx_semaphore_performance_suspension_count) || (timeouts != _tx_semaphore_performance_timeout_count)) { diff --git a/test/tx/regression/threadx_semaphore_non_preemption_test.c b/test/tx/regression/threadx_semaphore_non_preemption_test.c index 40219546..c075b16c 100644 --- a/test/tx/regression/threadx_semaphore_non_preemption_test.c +++ b/test/tx/regression/threadx_semaphore_non_preemption_test.c @@ -55,8 +55,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -68,8 +68,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -81,8 +81,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -107,7 +107,7 @@ CHAR *pointer; /* Setup the semaphore notify callback. */ status = tx_semaphore_put_notify(&semaphore_0, put_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ @@ -201,15 +201,15 @@ UINT status; /* At this point, we need to resume thread 2 and relinquish in order to get that thread suspended on the semaphore as well. */ tx_thread_resume(&thread_2); - tx_thread_relinquish(); - + tx_thread_relinquish(); + /* Perform 2 semaphore put operations to resume both threads. */ status = tx_semaphore_put(&semaphore_0); status += tx_semaphore_put(&semaphore_0); /* Let both threads run again. */ - tx_thread_relinquish(); - + tx_thread_relinquish(); + /* Check the status and the run counter of the other thread. */ if ((status != TX_SUCCESS) || (thread_1_counter != 5) || (thread_2_counter != 3)) { @@ -235,7 +235,7 @@ UINT status; while(1) { - + /* Increment thread run counter. */ thread_1_counter++; @@ -256,7 +256,7 @@ UINT status; while(1) { - + /* Increment thread run counter. */ thread_2_counter++; diff --git a/test/tx/regression/threadx_semaphore_preemption_test.c b/test/tx/regression/threadx_semaphore_preemption_test.c index 347042bc..f14193a2 100644 --- a/test/tx/regression/threadx_semaphore_preemption_test.c +++ b/test/tx/regression/threadx_semaphore_preemption_test.c @@ -51,8 +51,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -64,8 +64,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -90,7 +90,7 @@ CHAR *pointer; /* Setup the semaphore notify callback. */ status = tx_semaphore_put_notify(&semaphore_0, put_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ diff --git a/test/tx/regression/threadx_semaphore_prioritize.c b/test/tx/regression/threadx_semaphore_prioritize.c index 79622667..6bee4656 100644 --- a/test/tx/regression/threadx_semaphore_prioritize.c +++ b/test/tx/regression/threadx_semaphore_prioritize.c @@ -75,12 +75,12 @@ static void test_isr(void) } else { - + /* Abort the wait of thread 5. */ tx_thread_wait_abort(&thread_5); /* End the ISR processing. */ - test_status = 2; + test_status = 2; test_isr_dispatch = TX_NULL; } } @@ -113,8 +113,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -126,8 +126,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -139,8 +139,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -152,8 +152,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 3, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -165,8 +165,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 4, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -178,8 +178,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -191,8 +191,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -206,7 +206,7 @@ CHAR *pointer; /* Create the semaphore with no instances. */ status = tx_semaphore_create(&semaphore_0, "semaphore 0", 0); - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -217,7 +217,7 @@ CHAR *pointer; /* Setup the semaphore notify callback. */ status = tx_semaphore_put_notify(&semaphore_0, put_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ @@ -334,7 +334,7 @@ UINT status; printf("ERROR #15a\n"); test_control_return(1); } - + /* At this point we are going to get more than 2 threads suspended. */ tx_thread_resume(&thread_1); tx_thread_resume(&thread_2); @@ -345,7 +345,7 @@ UINT status; /* Prioritize the semaphore suspension list. */ status = tx_semaphore_prioritize(&semaphore_0); - + /* Check status and make sure thread 3 is now at the front of the suspension list. */ if ((status != TX_SUCCESS) || (semaphore_0.tx_semaphore_suspension_list != &thread_3)) { @@ -354,10 +354,10 @@ UINT status; printf("ERROR #16\n"); test_control_return(1); } - + /* Now loop to test the interrupt of the prioritize loop logic. */ test_status = 1; - test_isr_dispatch = test_isr; + test_isr_dispatch = test_isr; do { diff --git a/test/tx/regression/threadx_semaphore_thread_terminate_test.c b/test/tx/regression/threadx_semaphore_thread_terminate_test.c index b8beeff2..a15f5963 100644 --- a/test/tx/regression/threadx_semaphore_thread_terminate_test.c +++ b/test/tx/regression/threadx_semaphore_thread_terminate_test.c @@ -55,8 +55,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -68,8 +68,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -81,8 +81,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -104,10 +104,10 @@ CHAR *pointer; printf("Running Semaphore Thread Terminate Test............................. ERROR #4\n"); test_control_return(1); } - + /* Setup the semaphore notify callback. */ status = tx_semaphore_put_notify(&semaphore_0, put_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ diff --git a/test/tx/regression/threadx_semaphore_timeout_test.c b/test/tx/regression/threadx_semaphore_timeout_test.c index ec16a7c0..96585337 100644 --- a/test/tx/regression/threadx_semaphore_timeout_test.c +++ b/test/tx/regression/threadx_semaphore_timeout_test.c @@ -45,8 +45,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -68,10 +68,10 @@ CHAR *pointer; printf("Running Semaphore Suspension Timeout Test........................... ERROR #2\n"); test_control_return(1); } - + /* Setup the semaphore notify callback. */ status = tx_semaphore_put_notify(&semaphore_0, put_notify); - + #ifndef TX_DISABLE_NOTIFY_CALLBACKS /* Check for status. */ diff --git a/test/tx/regression/threadx_thread_basic_execution_test.c b/test/tx/regression/threadx_thread_basic_execution_test.c index 7a5ae864..9949eac8 100644 --- a/test/tx/regression/threadx_thread_basic_execution_test.c +++ b/test/tx/regression/threadx_thread_basic_execution_test.c @@ -1,5 +1,5 @@ -/* This test is designed to see if one thread can be created and executed. - It thread_0_entry is hit, then the thread was successfully scheduled. +/* This test is designed to see if one thread can be created and executed. + It thread_0_entry is hit, then the thread was successfully scheduled. On success, thread_0_counter gets incremented. */ #include <stdio.h> @@ -56,10 +56,10 @@ static unsigned long isr_executed = 0; static void thread_0_entry(ULONG task_input); -UINT _txe_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, +UINT _txe_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, VOID (*entry_function)(ULONG), ULONG entry_input, - VOID *stack_start, ULONG stack_size, - UINT priority, UINT preempt_threshold, + VOID *stack_start, ULONG stack_size, + UINT priority, UINT preempt_threshold, ULONG time_slice, UINT auto_start, UINT thread_control_block_size); #ifndef TX_INLINE_THREAD_RESUME_SUSPEND @@ -92,8 +92,8 @@ CHAR *pointer; /* Attempt to create a thread from a timer. */ pointer = (CHAR *) 0x3000; - status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); /* Check for status. */ @@ -137,8 +137,8 @@ ULONG old_time_slice; /* Attempt to create a thread from a timer. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); /* Check for status. */ @@ -151,7 +151,7 @@ ULONG old_time_slice; /* Attempt to delete a thread from an ISR. */ status = tx_thread_delete(&thread_0); - + /* Check for status. */ if (status != TX_CALLER_ERROR) { @@ -162,7 +162,7 @@ ULONG old_time_slice; /* Attempt to change preemption from an ISR. */ status = tx_thread_preemption_change(&thread_0, 1, &old_value); - + /* Check for status. */ if (status != TX_CALLER_ERROR) { @@ -173,7 +173,7 @@ ULONG old_time_slice; /* Attempt to change priority from an ISR. */ status = tx_thread_priority_change(&thread_0, 1, &old_value); - + /* Check for status. */ if (status != TX_CALLER_ERROR) { @@ -235,7 +235,7 @@ ULONG old_time_slice; static void test_isr1(void) { - + UINT status; TX_THREAD *current_thread; @@ -247,31 +247,31 @@ TX_THREAD *current_thread; /* Pickup the current thread. */ current_thread = tx_thread_identify(); - + /* Determine if the condition is present. */ if ((current_thread == &thread_4) && (_tx_thread_preempt_disable) && (thread_4.tx_thread_state == TX_READY)) { - /* Suspend the currently running thread 4 with the preemption-threshold flag set to ensure tx_thread_suspend from an ISR works + /* Suspend the currently running thread 4 with the preemption-threshold flag set to ensure tx_thread_suspend from an ISR works in this case. */ status = tx_thread_suspend(&thread_4); - + /* Check for error. */ if (status != TX_SUCCESS) { - + /* Set error flag. */ error++; } /* Resume thread 4. */ tx_thread_resume(&thread_4); - + /* Indicate the test case has been found. */ test_case_found = TX_TRUE; - } + } } - + #endif #endif @@ -299,30 +299,30 @@ TX_THREAD fake_thread; /* Setup a pointer. */ pointer = (CHAR *) first_unused_memory; - + /* Adjust it forward just to make sure there is some space for the test below. */ pointer = pointer + 200; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - + #ifndef TX_INLINE_THREAD_RESUME_SUSPEND #ifndef TX_NOT_INTERRUPTABLE - status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - + #endif -#endif - - +#endif + + /* Check for status. */ if (status != TX_SUCCESS) { @@ -331,7 +331,7 @@ TX_THREAD fake_thread; test_control_return(1); } - + #ifndef TX_NOT_INTERRUPTABLE /* Now setup a fake thread to generate the other NULL pointer test in the cleanup routines. */ @@ -370,7 +370,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Setup test thread to make sure _tx_thread_wait_abort can handle a NULL cleanup. */ test_thread.tx_thread_state = TX_IO_DRIVER; - test_thread.tx_thread_suspend_cleanup = TX_NULL; + test_thread.tx_thread_suspend_cleanup = TX_NULL; test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; test_thread.tx_thread_suspending = TX_TRUE; test_thread.tx_thread_delayed_suspend = TX_TRUE; @@ -382,7 +382,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Setup test thread to make sure _tx_thread_timeout can handle a NULL cleanup. */ test_thread.tx_thread_state = TX_IO_DRIVER; - test_thread.tx_thread_suspend_cleanup = TX_NULL; + test_thread.tx_thread_suspend_cleanup = TX_NULL; test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; test_thread.tx_thread_suspending = TX_TRUE; test_thread.tx_thread_delayed_suspend = TX_TRUE; @@ -392,12 +392,12 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); temp_mutex_release = _tx_thread_mutex_release; _tx_thread_mutex_release = TX_NULL; test_thread.tx_thread_state = TX_TERMINATED; - test_thread.tx_thread_suspend_cleanup = TX_NULL; + test_thread.tx_thread_suspend_cleanup = TX_NULL; test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; test_thread.tx_thread_suspending = TX_TRUE; test_thread.tx_thread_timer.tx_timer_internal_list_head = TX_NULL; test_thread.tx_thread_delayed_suspend = TX_TRUE; - status = _tx_thread_terminate(&test_thread); + status = _tx_thread_terminate(&test_thread); _tx_thread_mutex_release = temp_mutex_release; /* Recover Mutex release pointer. */ /* Perform thread memory test. */ @@ -407,10 +407,10 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); thread_memory.second_middle= 0x61718191; thread_memory.next_to_last = 0x99aabbcc; thread_memory.last = 0xddeeff00; - + /* Create the thread. */ - status += tx_thread_create(&thread_memory.thread_block, "thread memory", thread_0_entry, 1, - &thread_memory.stack[0], (2048*sizeof(ULONG))/sizeof(ULONG), + status += tx_thread_create(&thread_memory.thread_block, "thread memory", thread_0_entry, 1, + &thread_memory.stack[0], (2048*sizeof(ULONG))/sizeof(ULONG), 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); tx_thread_delete(&thread_memory.thread_block); @@ -423,7 +423,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); (thread_memory.next_to_last != 0x99aabbcc) || (thread_memory.last != 0xddeeff00)) { - + /* Memory overwrite error. */ printf("ERROR #2\n"); test_control_return(1); @@ -435,8 +435,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread with a null pointer. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(TX_NULL, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(TX_NULL, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -449,8 +449,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread with a bad control block size. */ pointer = (CHAR *) not_used_stack; - status = _txe_thread_create(&thread_3, "thread 3", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = _txe_thread_create(&thread_3, "thread 3", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START, (sizeof(TX_THREAD)+1)); /* Check for status. */ @@ -463,8 +463,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread with a NULL entry function. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(&thread_3, "thread 3", TX_NULL, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", TX_NULL, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -477,8 +477,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread that has already been created. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -490,8 +490,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); } /* Attempt to create a thread with an overlapping stack. */ - status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, - thread_0.tx_thread_stack_ptr, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, + thread_0.tx_thread_stack_ptr, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -505,8 +505,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread with another variation of an overlapping stack. */ pointer = thread_0.tx_thread_stack_start; pointer = pointer - 20; - status = tx_thread_create(&thread_1, "thread 1", TX_NULL, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", TX_NULL, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -519,8 +519,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread an extra small stack. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, - pointer, 1, + status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, + pointer, 1, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -533,8 +533,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread with an invalid thread priority. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 5000, 5000, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -547,8 +547,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread with an invalid preemption-threshold. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 17, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -561,8 +561,8 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to create a thread with an invalid auto start. */ pointer = (CHAR *) not_used_stack; - status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, 3456); /* Check for status. */ @@ -598,7 +598,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to register a entry/exit callback on a non-thread. */ status = tx_thread_entry_exit_notify(TX_NULL, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -610,7 +610,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to register a entry/exit callback on a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_entry_exit_notify(&thread_2, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -621,7 +621,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to get info on a non-thread. */ status = tx_thread_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -633,7 +633,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to get info on a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_info_get(&thread_2, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -644,7 +644,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to change preemption of a non-thread. */ status = tx_thread_preemption_change(TX_NULL, 1, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -652,11 +652,11 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #19\n"); test_control_return(1); } - + /* Attempt to change preemption of a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_preemption_change(&thread_2, 1, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -667,7 +667,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to change preemption with a NULL return value. */ status = tx_thread_preemption_change(&thread_0, 1, TX_NULL); - + /* Check for status. */ if (status != TX_PTR_ERROR) { @@ -675,10 +675,10 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #21\n"); test_control_return(1); } - + /* Attempt to change preemption with a bad threshold value. */ status = tx_thread_preemption_change(&thread_0, 17, &old_value); - + /* Check for status. */ if (status != TX_THRESH_ERROR) { @@ -690,7 +690,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to change priority of a non-thread. */ status = tx_thread_priority_change(TX_NULL, 1, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -698,11 +698,11 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #23\n"); test_control_return(1); } - + /* Attempt to change priority of a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_priority_change(&thread_2, 1, TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -713,7 +713,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt to change priority with a NULL return value. */ status = tx_thread_priority_change(&thread_0, 1, TX_NULL); - + /* Check for status. */ if (status != TX_PTR_ERROR) { @@ -721,10 +721,10 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #25\n"); test_control_return(1); } - + /* Attempt to change priority with a bad priority value. */ status = tx_thread_priority_change(&thread_0, 2046, &old_value); - + /* Check for status. */ if (status != TX_PRIORITY_ERROR) { @@ -769,7 +769,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt a thread resume with a NULL pointer. */ status = tx_thread_resume(TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -777,11 +777,11 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #30\n"); test_control_return(1); } - + /* Attempt a thread resume on a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_resume(&thread_2); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -792,7 +792,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt a thread suspend with a NULL pointer. */ status = tx_thread_suspend(TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -800,11 +800,11 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #32\n"); test_control_return(1); } - + /* Attempt a thread suspend on a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_suspend(&thread_2); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -815,7 +815,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt a thread termiante with a NULL pointer. */ status = tx_thread_terminate(TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -823,11 +823,11 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #34\n"); test_control_return(1); } - + /* Attempt a thread terminate on a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_terminate(&thread_2); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -838,7 +838,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt a thread time-slice chagne with a NULL pointer. */ status = tx_thread_time_slice_change(TX_NULL, 1, &old_time_slice); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -846,11 +846,11 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #36\n"); test_control_return(1); } - + /* Attempt a thread time-slice change on a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_time_slice_change(&thread_2, 1, &old_time_slice); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -861,7 +861,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt a thread time-slice change with a null return pointer. */ status = tx_thread_time_slice_change(&thread_0, 1, TX_NULL); - + /* Check for status. */ if (status != TX_PTR_ERROR) { @@ -872,7 +872,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Attempt a thread wait abort with a NULL pointer. */ status = tx_thread_wait_abort(TX_NULL); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -880,11 +880,11 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); printf("ERROR #39\n"); test_control_return(1); } - + /* Attempt a thread wait abort on a non-created thread. */ thread_2.tx_thread_id = 0; status = tx_thread_wait_abort(&thread_2); - + /* Check for status. */ if (status != TX_THREAD_ERROR) { @@ -908,7 +908,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Thread error. */ printf("ERROR #41\n"); test_control_return(1); @@ -921,25 +921,25 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); /* At this point setup the ISR. */ test_isr_dispatch = test_isr1; - + /* Resume thread 4. */ - tx_thread_resume(&thread_4); - + tx_thread_resume(&thread_4); + /* Clear the ISR. */ - test_isr_dispatch = TX_NULL; - + test_isr_dispatch = TX_NULL; + /* Now check for an error. */ if ((error) || (test_case_found == TX_FALSE)) { - + /* Basic execution error. */ printf("ERROR #42\n"); test_control_return(1); } - + +#endif #endif -#endif - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); @@ -952,13 +952,13 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); static void thread_4_entry(ULONG thread_input) { -TX_INTERRUPT_SAVE_AREA +TX_INTERRUPT_SAVE_AREA /* Loop until we achieve as suspend request while inside of the tx_thread_resume API. */ while (test_case_found == TX_FALSE) { - + /* Temporarily disable preemption for the test. */ TX_DISABLE _tx_thread_preempt_disable++; @@ -966,7 +966,7 @@ TX_INTERRUPT_SAVE_AREA /* Increment the run counter for this test. */ thread_4_counter++; - + TX_DISABLE _tx_thread_preempt_disable--; TX_RESTORE @@ -974,6 +974,6 @@ TX_INTERRUPT_SAVE_AREA } #endif -#endif +#endif diff --git a/test/tx/regression/threadx_thread_basic_time_slice_test.c b/test/tx/regression/threadx_thread_basic_time_slice_test.c index 9da8350c..7c83a715 100644 --- a/test/tx/regression/threadx_thread_basic_time_slice_test.c +++ b/test/tx/regression/threadx_thread_basic_time_slice_test.c @@ -1,4 +1,4 @@ -/* This test is designed to see if a thread can be created with a time-slice. +/* This test is designed to see if a thread can be created with a time-slice. No time-slice occurs, only the processing to check for time-slicing. */ #include <stdio.h> @@ -30,8 +30,8 @@ UINT status; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - first_unused_memory, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + first_unused_memory, TEST_STACK_SIZE_PRINTF, 16, 16, 1, TX_AUTO_START); /* Check for status. */ diff --git a/test/tx/regression/threadx_thread_completed_test.c b/test/tx/regression/threadx_thread_completed_test.c index 068058d0..adaf1683 100644 --- a/test/tx/regression/threadx_thread_completed_test.c +++ b/test/tx/regression/threadx_thread_completed_test.c @@ -1,5 +1,5 @@ -/* This test is designed to see if one thread can be created, executed, and - return to the thread shell function. The thread shell function places +/* This test is designed to see if one thread can be created, executed, and + return to the thread shell function. The thread shell function places the thread in a finished state. */ #include <stdio.h> @@ -36,7 +36,7 @@ static void entry_exit_notify(TX_THREAD *thread_ptr, UINT type) /* Check for the appropriate thread. */ if (thread_ptr != &thread_0) return; - + /* Check for type. */ if (type == TX_THREAD_ENTRY) thread_0_enter++; @@ -64,8 +64,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -94,8 +94,8 @@ CHAR *pointer; #endif - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -107,8 +107,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -154,11 +154,11 @@ UINT status; /* Attempt to delete thread 2, which is in the wrong stat for deleting. */ status = tx_thread_delete(&thread_2); - + /* Check for the proper status. */ if (status != TX_DELETE_ERROR) { - + /* Thread delete error. */ printf("ERROR #5\n"); test_control_return(1); @@ -166,11 +166,11 @@ UINT status; /* Attempt to suspend thread 0, which is in a completed state. */ status = tx_thread_suspend(&thread_0); - + /* Check for the correct status. */ if (status != TX_SUSPEND_ERROR) { - + /* Thread suspend error. */ printf("ERROR #6\n"); test_control_return(1); @@ -178,11 +178,11 @@ UINT status; /* Attempt to delete thread 0. */ status = tx_thread_delete(&thread_0); - + /* Check for the proper status. */ if (status != TX_SUCCESS) { - + /* Thread delete error. */ printf("ERROR #7\n"); test_control_return(1); @@ -190,32 +190,32 @@ UINT status; /* Sleep to let thread 2 run. */ tx_thread_sleep(2); - + /* Save the created count. */ saved_count = _tx_thread_created_count; - + /* Now setup things so we can fake a delete of one thread. */ _tx_thread_created_ptr = &thread_2; thread_2.tx_thread_created_next = &thread_2; thread_2.tx_thread_created_previous = &thread_2; _tx_thread_created_count = 1; - + /* Attempt to delete thread 2. */ status = tx_thread_delete(&thread_2); - + /* Check for the proper status. */ if (status != TX_SUCCESS) { - + /* Thread delete error. */ printf("ERROR #8\n"); test_control_return(1); } - + /* if still okay, restore the saved thread pointer. */ if (saved_ptr -> tx_thread_id == TX_THREAD_ID) - { - /* Restore. */ + { + /* Restore. */ _tx_thread_created_ptr = saved_ptr; /* Setup the link pointers again. */ @@ -242,7 +242,7 @@ UINT status; } else { - + /* Thread Finish error. */ printf("ERROR #9\n"); test_control_return(1); diff --git a/test/tx/regression/threadx_thread_create_preemption_threshold_test.c b/test/tx/regression/threadx_thread_create_preemption_threshold_test.c index ad0d1d4e..58ce79fe 100644 --- a/test/tx/regression/threadx_thread_create_preemption_threshold_test.c +++ b/test/tx/regression/threadx_thread_create_preemption_threshold_test.c @@ -43,8 +43,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 0, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -56,8 +56,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 0, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -69,8 +69,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 0, 100, TX_DONT_START); status += tx_thread_resume(&thread_0); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_thread_delayed_suspension_test.c b/test/tx/regression/threadx_thread_delayed_suspension_test.c index 6d6d27d0..91128f83 100644 --- a/test/tx/regression/threadx_thread_delayed_suspension_test.c +++ b/test/tx/regression/threadx_thread_delayed_suspension_test.c @@ -97,7 +97,7 @@ ULONG i; if (loop_count < min_loop_count) min_loop_count = loop_count; if (loop_count > max_loop_count) - max_loop_count = loop_count; + max_loop_count = loop_count; lower_bound = loop_count - 1; upper_bound = loop_count + 1; @@ -108,38 +108,38 @@ ULONG i; if ((current_itterations < lower_bound) || (current_itterations > upper_bound)) current_itterations = lower_bound; - + #ifdef DEBUG_1 /* Last loop count. */ last_loop_count = loop_count; #endif - + /* Reset the loop count to all ones! */ loop_count = 0xFFFFFFFF; } count++; for (i = 0; i < (count%32); i++) - destination++; + destination++; /* Check to see if the interrupt occurred in the middle of the suspension. */ if ((thread_2.tx_thread_suspending) && (delayed_suspend_set == 0)) { - + /* Yes, we have taken the interrupt in the middle of a thread suspension. */ - + /* Indicate we have got the condition. */ delayed_suspend_set = 1; /* Capture the current thread 2 counter. */ thread_2_counter_capture = thread_2_counter; - + /* Now attempt to set the delayed suspension. */ tx_thread_suspend(&thread_2); - + /* Check for the delayed suspension flag being set. */ if (thread_2.tx_thread_delayed_suspend != 1) { - + /* Error! Setup the counters to indicate an error. */ thread_2_counter = 0xEEEEEEEE; thread_2_counter_capture = 0xFFFFFFFF; @@ -147,11 +147,11 @@ ULONG i; /* Now, abort the suspension for thread 2... the thread should switch to a pure suspended state. */ tx_thread_wait_abort(&thread_2); - + /* Check for the proper state. */ if (thread_2.tx_thread_state != TX_SUSPENDED) { - + /* Error! Setup the counters to indicate an error. */ thread_2_counter = 0xEEEEEEEE; thread_2_counter_capture = 0xFFFFFFFF; @@ -181,14 +181,14 @@ CHAR *pointer; create information. */ /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + DEMO_STACK_SIZE; /* Create threads 1 and 2. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + DEMO_STACK_SIZE; @@ -197,8 +197,8 @@ CHAR *pointer; #ifndef TX_NOT_INTERRUPTABLE - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + DEMO_STACK_SIZE; @@ -232,7 +232,7 @@ UINT status; tx_thread_relinquish(); /* At this point thread 1 has suspended on the semaphore. */ - + /* Suspend the already suspended thread. */ tx_thread_suspend(&thread_1); @@ -277,20 +277,20 @@ UINT status; /* Just relinquish. */ tx_thread_relinquish(); } - + /* Relinquish one more time to make sure thread 2 could run if it is ready. */ tx_thread_relinquish(); - + /* At this point, check for an error. */ if (thread_2_counter != thread_2_counter_capture) { - + /* Delayed suspension error... thread kept running! */ printf("ERROR #2\n"); test_control_return(1); } #endif - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); @@ -327,10 +327,10 @@ ULONG i; /* Callibrate the loop count from thread sleep. */ for (i = 0; i < 10; i++) { - + /* Sleep to get a fresh time. */ tx_thread_sleep(1); - + start_time = _tx_timer_system_clock; do { @@ -339,7 +339,7 @@ ULONG i; delay_function(); loop_count++; } while (start_time == _tx_timer_system_clock); - + /* Wait to reset the loop count. */ tx_thread_sleep(1); } @@ -358,7 +358,7 @@ ULONG i; /* Sleep to get a fresh starting time. */ tx_thread_sleep(1); - + loop_count = 0; start_time = _tx_timer_system_clock; do @@ -366,7 +366,7 @@ ULONG i; /* Call delay function. */ delay_function(); loop_count++; - } while (loop_count < current_itterations); + } while (loop_count < current_itterations); /* Suspend this thread. */ tx_semaphore_get(&semaphore_1, TX_WAIT_FOREVER); diff --git a/test/tx/regression/threadx_thread_information_test.c b/test/tx/regression/threadx_thread_information_test.c index b72a2363..19107742 100644 --- a/test/tx/regression/threadx_thread_information_test.c +++ b/test/tx/regression/threadx_thread_information_test.c @@ -31,8 +31,8 @@ INT status; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - first_unused_memory, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + first_unused_memory, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); /* Check for status. */ @@ -83,9 +83,9 @@ ULONG idle_returns; /* Get information about this thread. */ status = tx_thread_info_get(&thread_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_thread_info_get(&thread_0, &name, &state, &run_count, &priority, &preemption_threshold, &time_slice, &next_thread, &suspended_thread); - + /* Check for error status. */ - if ((status != TX_SUCCESS) || (state != TX_READY) || (run_count != thread_0.tx_thread_run_count) || (priority != 16) || (preemption_threshold != 16) || + if ((status != TX_SUCCESS) || (state != TX_READY) || (run_count != thread_0.tx_thread_run_count) || (priority != 16) || (preemption_threshold != 16) || (time_slice != 0) || (next_thread != thread_0.tx_thread_created_next) || (suspended_thread != thread_0.tx_thread_suspended_next)) { @@ -103,7 +103,7 @@ ULONG idle_returns; /* Check status. */ if (status != TX_PTR_ERROR) { - + /* Thread error. */ printf("ERROR #3\n"); test_control_return(1); @@ -111,7 +111,7 @@ ULONG idle_returns; /* Get the performance information about this thread. */ status = tx_thread_performance_info_get(&thread_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - status += tx_thread_performance_info_get(&thread_0, &resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status += tx_thread_performance_info_get(&thread_0, &resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check for error. */ @@ -129,7 +129,7 @@ ULONG idle_returns; /* Get the system performance information. */ status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - status += tx_thread_performance_system_info_get(&resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status += tx_thread_performance_system_info_get(&resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check for error. */ @@ -146,7 +146,7 @@ ULONG idle_returns; } else { - + /* Success! */ printf("SUCCESS!\n"); test_control_return(0); @@ -154,312 +154,312 @@ ULONG idle_returns; #else /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(&thread_0, &resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_info_get(&thread_0, &resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #6\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, &resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_info_get(TX_NULL, &resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #7\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #8\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #9\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #10\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &priority_inversions, &time_slices, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #11\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &time_slices, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &time_slices, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #12\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &relinquishes, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #13\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #14\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &wait_aborts, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #15\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &last_preempted_by); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #16\n"); test_control_return(1); } /* Get the performance information about this thread. */ - status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #17\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(&resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_system_info_get(&resumptions, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #18\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_system_info_get(TX_NULL, &suspensions, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #19\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, &solicited_preemptions, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #20\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, &interrupt_preemptions, &priority_inversions, &time_slices, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, &interrupt_preemptions, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #21\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &priority_inversions, &time_slices, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &priority_inversions, &time_slices, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #22\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &time_slices, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &time_slices, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #23\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &relinquishes, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #24\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #25\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &wait_aborts, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #26\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &non_idle_returns, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #27\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &idle_returns); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #28\n"); test_control_return(1); } /* Get the system performance information. */ - status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, + status = tx_thread_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Thread error. */ printf("ERROR #29\n"); test_control_return(1); diff --git a/test/tx/regression/threadx_thread_multi_level_preemption_threshold_test.c b/test/tx/regression/threadx_thread_multi_level_preemption_threshold_test.c index a65410fa..8944da46 100644 --- a/test/tx/regression/threadx_thread_multi_level_preemption_threshold_test.c +++ b/test/tx/regression/threadx_thread_multi_level_preemption_threshold_test.c @@ -1,4 +1,4 @@ -/* This test is designed to test multi-level preemption threshold. The protection placed +/* This test is designed to test multi-level preemption threshold. The protection placed by a thread must be preserved after higher-priority thread preemption that is above the threshold. */ #include <stdio.h> @@ -139,8 +139,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, (TX_MAX_PRIORITIES-1), (TX_MAX_PRIORITIES/2), TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -154,8 +154,8 @@ CHAR *pointer; #ifndef TX_DISABLE_PREEMPTION_THRESHOLD /* skip this test and pretend it passed */ - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, (TX_MAX_PRIORITIES/2), (TX_MAX_PRIORITIES/2), TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -167,8 +167,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 10, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -180,8 +180,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2a, "thread 2a", thread_2a_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2a, "thread 2a", thread_2a_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -193,8 +193,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 11, 11, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -206,8 +206,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 9, 9, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -221,8 +221,8 @@ CHAR *pointer; /* Create new cascading preemption-threshold test threads. */ - status = tx_thread_create(&thread_30_29, "thread 30-29", thread_30_29_entry, 30, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_30_29, "thread 30-29", thread_30_29_entry, 30, + pointer, TEST_STACK_SIZE_PRINTF, 30, 29, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -234,8 +234,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_28_27, "thread 28-27", thread_28_27_entry, 28, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_28_27, "thread 28-27", thread_28_27_entry, 28, + pointer, TEST_STACK_SIZE_PRINTF, 28, 27, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -247,8 +247,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_26_25, "thread 26-25", thread_26_25_entry, 26, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_26_25, "thread 26-25", thread_26_25_entry, 26, + pointer, TEST_STACK_SIZE_PRINTF, 26, 25, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -260,8 +260,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_24_23, "thread 24-23", thread_24_23_entry, 24, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_24_23, "thread 24-23", thread_24_23_entry, 24, + pointer, TEST_STACK_SIZE_PRINTF, 24, 23, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -273,8 +273,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_22_21, "thread 22-21", thread_22_21_entry, 22, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_22_21, "thread 22-21", thread_22_21_entry, 22, + pointer, TEST_STACK_SIZE_PRINTF, 22, 21, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -286,8 +286,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_20_19, "thread 20-19", thread_20_19_entry, 20, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_20_19, "thread 20-19", thread_20_19_entry, 20, + pointer, TEST_STACK_SIZE_PRINTF, 20,19, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -299,8 +299,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_18_17, "thread 18-17", thread_18_17_entry, 18, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_18_17, "thread 18-17", thread_18_17_entry, 18, + pointer, TEST_STACK_SIZE_PRINTF, 18, 17, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -312,8 +312,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_16_15, "thread 16-15", thread_16_15_entry, 16, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_16_15, "thread 16-15", thread_16_15_entry, 16, + pointer, TEST_STACK_SIZE_PRINTF, 16, 15, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -325,8 +325,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_14_13, "thread 14-13", thread_14_13_entry, 14, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_14_13, "thread 14-13", thread_14_13_entry, 14, + pointer, TEST_STACK_SIZE_PRINTF, 14, 13, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -338,8 +338,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_12_11, "thread 12-11", thread_12_11_entry, 12, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_12_11, "thread 12-11", thread_12_11_entry, 12, + pointer, TEST_STACK_SIZE_PRINTF, 12, 11, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -352,7 +352,7 @@ CHAR *pointer; } status = tx_thread_create(&thread_10_9, "thread 10-9", thread_10_9_entry, 10, - pointer, TEST_STACK_SIZE_PRINTF, + pointer, TEST_STACK_SIZE_PRINTF, 10, 9, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -364,8 +364,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_8_7, "thread 8-7", thread_8_7_entry, 8, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_8_7, "thread 8-7", thread_8_7_entry, 8, + pointer, TEST_STACK_SIZE_PRINTF, 8, 7, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -377,8 +377,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_6_5, "thread 6-5", thread_6_5_entry, 6, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_6_5, "thread 6-5", thread_6_5_entry, 6, + pointer, TEST_STACK_SIZE_PRINTF, 6, 5, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -390,8 +390,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4_3, "thread 4-3", thread_4_3_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4_3, "thread 4-3", thread_4_3_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 4, 3, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -403,8 +403,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3_2, "thread 3-2", thread_3_2_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3_2, "thread 3-2", thread_3_2_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 3, 2, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -416,8 +416,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2_1, "thread 2-1", thread_2_1_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2_1, "thread 2-1", thread_2_1_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 2, 1, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -429,8 +429,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1_0, "thread 1-0", thread_1_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1_0, "thread 1-0", thread_1_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 1, 1, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -443,7 +443,7 @@ CHAR *pointer; } status = tx_timer_create(&timer_0, "timer 0", timer_0_entry, 0, 1, 0, TX_NO_ACTIVATE); - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -451,7 +451,7 @@ CHAR *pointer; printf("Running Thread Multi-Level Preemption Threshold Test................ ERROR #24\n"); test_control_return(1); } - + #endif } @@ -522,7 +522,7 @@ UINT old_preempt; /* Set preemption threshold to keep new test threads from running. */ status = tx_thread_preemption_change(&thread_0, 17, &old_preempt); - + /* Now wakup the lowest priority preemption-threshold thread. */ status += tx_thread_resume(&thread_30_29); @@ -537,7 +537,7 @@ UINT old_preempt; /* Now, self suspend. */ status = tx_thread_suspend(&thread_0); - + /* Check to make sure all the preemption-threshold threads ran. */ if ((thread_1_0_counter != 1) || (thread_2_1_counter != 1) || @@ -606,7 +606,7 @@ UINT status; (thread_4_counter != 1)) return; - /* Relinquish to the other thread at this priority level. This should + /* Relinquish to the other thread at this priority level. This should clear the preemption threshold condition and allow thread 3 to run. */ tx_thread_relinquish(); @@ -648,7 +648,7 @@ static void timer_0_entry(ULONG id) /* Pretend like a preemption occurred on a thread priority of 1 with preemption-threshold set to 0. */ _tx_thread_preempted_maps[0] = _tx_thread_preempted_maps[0] | 2; - + /* Set the thread's preemption threshold as well. */ thread_1_0.tx_thread_preempt_threshold = 0; @@ -665,16 +665,16 @@ UINT status; /* Activate the timer to force a priority 0 thread to interrupt. */ status = tx_timer_activate(&timer_0); - + /* Loop to wait until timer 0 runs. */ while (timer_0_counter == 0) { } - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_1_0_counter++; } @@ -697,11 +697,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_1_0); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_3_2_counter++; } @@ -716,11 +716,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_2_1); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_4_3_counter++; } @@ -736,16 +736,16 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_4_3); - /* In this particular case, we have two different preemptions to make + /* In this particular case, we have two different preemptions to make sure we exercise all the code. */ /* Now resume next highest priority thread. */ status = tx_thread_resume(&thread_3_2); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_6_5_counter++; } @@ -760,11 +760,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_6_5); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_8_7_counter++; } @@ -779,11 +779,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_8_7); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_10_9_counter++; } @@ -797,11 +797,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_10_9); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_12_11_counter++; } @@ -816,11 +816,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_12_11); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_14_13_counter++; } @@ -835,11 +835,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_14_13); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_16_15_counter++; } @@ -854,11 +854,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_16_15); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_18_17_counter++; } @@ -873,11 +873,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_18_17); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_20_19_counter++; } @@ -892,11 +892,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_20_19); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_22_21_counter++; } @@ -911,11 +911,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_22_21); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_24_23_counter++; } @@ -929,11 +929,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_24_23); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_26_25_counter++; } @@ -947,11 +947,11 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_26_25); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_28_27_counter++; } @@ -965,15 +965,15 @@ UINT status; /* Resume next highest priority thread. */ status = tx_thread_resume(&thread_28_27); - + /* Check for good status. */ if (status == TX_SUCCESS) { - + /* Increment this thread's counter. */ thread_30_29_counter++; } - + /* Resume thread_0. */ tx_thread_resume(&thread_0); } diff --git a/test/tx/regression/threadx_thread_multiple_non_current_test.c b/test/tx/regression/threadx_thread_multiple_non_current_test.c index 51212b3b..50ed17a0 100644 --- a/test/tx/regression/threadx_thread_multiple_non_current_test.c +++ b/test/tx/regression/threadx_thread_multiple_non_current_test.c @@ -1,6 +1,6 @@ -/* This test is designed to see if multiple non-current threads can be suspended. - The order the suspension and resumption occurs makes sure everything is working - right. Thread execution should remain predictable even after suspension and +/* This test is designed to see if multiple non-current threads can be suspended. + The order the suspension and resumption occurs makes sure everything is working + right. Thread execution should remain predictable even after suspension and resumption of threads within a priority group. */ #include <stdio.h> @@ -54,8 +54,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -67,8 +67,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -80,8 +80,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -93,8 +93,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -106,8 +106,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_thread_multiple_sleep_test.c b/test/tx/regression/threadx_thread_multiple_sleep_test.c index 9a876295..f2ae3b99 100644 --- a/test/tx/regression/threadx_thread_multiple_sleep_test.c +++ b/test/tx/regression/threadx_thread_multiple_sleep_test.c @@ -43,8 +43,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -56,8 +56,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -69,8 +69,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -82,8 +82,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_thread_multiple_suspension_test.c b/test/tx/regression/threadx_thread_multiple_suspension_test.c index 0e4e5c06..01c42e8f 100644 --- a/test/tx/regression/threadx_thread_multiple_suspension_test.c +++ b/test/tx/regression/threadx_thread_multiple_suspension_test.c @@ -1,5 +1,5 @@ -/* This test is designed to see if multiple threads can be created and suspend. - The order the suspension and resumption occurs makes sure everything is working +/* This test is designed to see if multiple threads can be created and suspend. + The order the suspension and resumption occurs makes sure everything is working right. All the counters should increment at the same rate. */ #include <stdio.h> @@ -59,8 +59,8 @@ CHAR *pointer; create information. */ /* Create thread 0. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 13, 13, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -73,8 +73,8 @@ CHAR *pointer; } /* Create thread 1. */ - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, (TX_MAX_PRIORITIES/2), (TX_MAX_PRIORITIES/2), TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -87,8 +87,8 @@ CHAR *pointer; } /* Create thread 2. */ - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, (TX_MAX_PRIORITIES/2), (TX_MAX_PRIORITIES/2), TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -101,8 +101,8 @@ CHAR *pointer; } /* Create thread 3. */ - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, (TX_MAX_PRIORITIES/2), (TX_MAX_PRIORITIES/2), TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -115,8 +115,8 @@ CHAR *pointer; } /* Create thread 4. */ - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -129,8 +129,8 @@ CHAR *pointer; } /* Create thread 5. Make this thread non-preemptable for the range of priorities here... */ - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, (TX_MAX_PRIORITIES-1), 13, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -160,7 +160,7 @@ static void thread_0_entry(ULONG thread_input) /* Suspend this thread... */ tx_thread_suspend(&thread_0); - + /* Resume thread 5... */ tx_thread_resume(&thread_5); } @@ -252,7 +252,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 1) || (thread_1_counter != 1) || + if ((thread_0_counter != 1) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -277,7 +277,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 1) || (thread_1_counter != 1) || + if ((thread_0_counter != 1) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -301,7 +301,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 1) || (thread_1_counter != 1) || + if ((thread_0_counter != 1) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -325,7 +325,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 1) || (thread_1_counter != 1) || + if ((thread_0_counter != 1) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -349,7 +349,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 1) || (thread_1_counter != 1) || + if ((thread_0_counter != 1) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -373,7 +373,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 1) || (thread_1_counter != 1) || + if ((thread_0_counter != 1) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -398,7 +398,7 @@ UINT status; } /* Make sure that each thread has run twice. */ - if ((thread_0_counter != 2) || (thread_1_counter != 2) || + if ((thread_0_counter != 2) || (thread_1_counter != 2) || (thread_2_counter != 2) || (thread_3_counter != 2) || (thread_4_counter != 2)) { @@ -410,7 +410,7 @@ UINT status; /* Suspend a thread that is already suspended. */ status = tx_thread_suspend(&thread_4); - + /* Check for error condition. */ if (status != TX_SUCCESS) { @@ -420,7 +420,7 @@ UINT status; } else { - + /* Increment thread 5 counter. */ thread_5_counter++; diff --git a/test/tx/regression/threadx_thread_multiple_time_slice_test.c b/test/tx/regression/threadx_thread_multiple_time_slice_test.c index 6e1f61fd..f3e9fbf0 100644 --- a/test/tx/regression/threadx_thread_multiple_time_slice_test.c +++ b/test/tx/regression/threadx_thread_multiple_time_slice_test.c @@ -1,4 +1,4 @@ -/* This test is designed to see if two threads can be created and execute with a time-slice. +/* This test is designed to see if two threads can be created and execute with a time-slice. Thread 7 should run twice as long because it has more of a time-slice. */ #include <stdio.h> @@ -50,8 +50,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 2, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -63,8 +63,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 4, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -77,8 +77,8 @@ CHAR *pointer; } /* Create control thread. */ - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -92,10 +92,10 @@ CHAR *pointer; #ifndef TX_DISABLE_PREEMPTION_THRESHOLD - /* Create threads with preemption-threshold and time-slice, such and make sure time-slice is defeated by + /* Create threads with preemption-threshold and time-slice, such and make sure time-slice is defeated by preemption-threshold. */ - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 18, 17, 2, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -107,8 +107,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 4, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -161,7 +161,7 @@ static void thread_1_entry(ULONG thread_input) static void thread_2_entry(ULONG thread_input) { - + unsigned long counter_sum; #ifndef TX_DISABLE_PREEMPTION_THRESHOLD UINT status; @@ -177,7 +177,7 @@ UINT status; /* Increment thread 2 counter. */ thread_2_counter++; - /* Compute the delta. Should be twice as much, but some test environments (Windows/Linux) are + /* Compute the delta. Should be twice as much, but some test environments (Windows/Linux) are not as good in terms of real time processing. */ counter_sum = thread_0_counter; counter_sum = counter_sum + (thread_0_counter/4); @@ -187,19 +187,19 @@ UINT status; /* Thread Time-slice error. */ printf("ERROR #6\n"); test_control_return(1); - } + } #ifdef TX_DISABLE_PREEMPTION_THRESHOLD else { /* Successful Thread Time-slice test. */ printf("SUCCESS!\n"); test_control_return(0); - } + } #else /* Now suspend threads 0 and 1 so we can let 3 and 4 run. */ status = tx_thread_suspend(&thread_0); status += tx_thread_suspend(&thread_1); - + /* Check status. */ if (status) { @@ -207,7 +207,7 @@ UINT status; printf("ERROR #7\n"); test_control_return(1); } - + /* Now sleep and see if thread 4 ever runs. */ tx_thread_sleep(4); @@ -257,7 +257,7 @@ static void thread_4_entry(ULONG thread_input) { /* We should never get here! */ - + /* Increment thread 4 counter. */ thread_4_counter++; diff --git a/test/tx/regression/threadx_thread_preemptable_suspension_test.c b/test/tx/regression/threadx_thread_preemptable_suspension_test.c index b1c1bc52..8e4dbdd6 100644 --- a/test/tx/regression/threadx_thread_preemptable_suspension_test.c +++ b/test/tx/regression/threadx_thread_preemptable_suspension_test.c @@ -1,6 +1,6 @@ -/* This test is designed to see if multiple threads can be created and suspended. - The order the suspension and resumption occurs makes sure everything is working right. - All the counters should increment at the same rate. This test differs from test 4 in +/* This test is designed to see if multiple threads can be created and suspended. + The order the suspension and resumption occurs makes sure everything is working right. + All the counters should increment at the same rate. This test differs from test 4 in that thread 5 is preemptable. */ #include <stdio.h> @@ -58,8 +58,8 @@ CHAR *pointer; create information. */ /* Create thread 0. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 13, 13, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -72,8 +72,8 @@ CHAR *pointer; } /* Create thread 1. */ - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -86,8 +86,8 @@ CHAR *pointer; } /* Create thread 2. */ - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -100,8 +100,8 @@ CHAR *pointer; } /* Create thread 3. */ - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -114,8 +114,8 @@ CHAR *pointer; } /* Create thread 4. */ - status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -128,8 +128,8 @@ CHAR *pointer; } /* Create thread 5. Make this thread fully preemptable... */ - status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -159,7 +159,7 @@ static void thread_0_entry(ULONG thread_input) /* Suspend this thread... */ tx_thread_suspend(&thread_0); - + /* Resume thread 5... */ tx_thread_resume(&thread_5); } @@ -251,7 +251,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 1) || (thread_1_counter != 1) || + if ((thread_0_counter != 1) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -276,7 +276,7 @@ UINT status; } /* Make sure that each thread has run the proper amount. */ - if ((thread_0_counter != 2) || (thread_1_counter != 1) || + if ((thread_0_counter != 2) || (thread_1_counter != 1) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -300,7 +300,7 @@ UINT status; } /* Make sure that each thread has run the proper amount. */ - if ((thread_0_counter != 2) || (thread_1_counter != 2) || + if ((thread_0_counter != 2) || (thread_1_counter != 2) || (thread_2_counter != 1) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -324,7 +324,7 @@ UINT status; } /* Make sure that each thread has the proper amount. */ - if ((thread_0_counter != 2) || (thread_1_counter != 2) || + if ((thread_0_counter != 2) || (thread_1_counter != 2) || (thread_2_counter != 2) || (thread_3_counter != 1) || (thread_4_counter != 1)) { @@ -348,7 +348,7 @@ UINT status; } /* Make sure that each thread has run the proper amount. */ - if ((thread_0_counter != 2) || (thread_1_counter != 2) || + if ((thread_0_counter != 2) || (thread_1_counter != 2) || (thread_2_counter != 2) || (thread_3_counter != 2) || (thread_4_counter != 1)) { @@ -372,7 +372,7 @@ UINT status; } /* Make sure that each thread has run once. */ - if ((thread_0_counter != 2) || (thread_1_counter != 2) || + if ((thread_0_counter != 2) || (thread_1_counter != 2) || (thread_2_counter != 2) || (thread_3_counter != 2) || (thread_4_counter != 2)) { @@ -397,7 +397,7 @@ UINT status; } /* Make sure that each thread has run twice. */ - if ((thread_0_counter != 2) || (thread_1_counter != 2) || + if ((thread_0_counter != 2) || (thread_1_counter != 2) || (thread_2_counter != 2) || (thread_3_counter != 2) || (thread_4_counter != 2)) { diff --git a/test/tx/regression/threadx_thread_preemption_change_test.c b/test/tx/regression/threadx_thread_preemption_change_test.c index 1633ef92..ca0a3c72 100644 --- a/test/tx/regression/threadx_thread_preemption_change_test.c +++ b/test/tx/regression/threadx_thread_preemption_change_test.c @@ -51,8 +51,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -66,8 +66,8 @@ CHAR *pointer; #ifndef TX_DISABLE_PREEMPTION_THRESHOLD /* skip this test and pretend it passed */ - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -79,8 +79,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 14, 14, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -126,7 +126,7 @@ UINT i; /* Increment thread 0 counter. */ thread_0_counter++; - /* Resume thread 1, which has a higher priority. Preemption is disabled + /* Resume thread 1, which has a higher priority. Preemption is disabled though so thread 1 should not run yet. */ status = tx_thread_resume(&thread_1); @@ -169,7 +169,7 @@ UINT i; } /* Change the preemption threshold back to 15. */ - status = tx_thread_preemption_change(&thread_0, 15, &old_threshold); + status = tx_thread_preemption_change(&thread_0, 15, &old_threshold); /* Check status and run counters of other threads. */ if ((status != TX_SUCCESS) || (thread_1_counter != 1) || (thread_2_counter != 0) || @@ -181,7 +181,7 @@ UINT i; test_control_return(1); } - /* Resume thread 2. This should preempt because it is priority 14 and the + /* Resume thread 2. This should preempt because it is priority 14 and the current preemption threshold is 15. */ status = tx_thread_resume(&thread_2); @@ -194,16 +194,16 @@ UINT i; test_control_return(1); } - /* At this point, we are going to loop through preemption changes that result in + /* At this point, we are going to loop through preemption changes that result in preemption. */ for (i = 0; i < (TX_THREAD_EXECUTE_LOG_SIZE*3); i++) { /* Change the preemption threshold back to 14. */ - status = tx_thread_preemption_change(&thread_0, 14, &old_threshold); + status = tx_thread_preemption_change(&thread_0, 14, &old_threshold); /* Check status. */ - if (status != TX_SUCCESS) + if (status != TX_SUCCESS) { /* Thread error. */ @@ -213,7 +213,7 @@ UINT i; /* Resume thread 2 again. */ status = tx_thread_resume(&thread_2); - + /* Check status an thread 2 run counter. */ if ((status != TX_SUCCESS) && (thread_2_counter != (i+1))) { @@ -222,9 +222,9 @@ UINT i; printf("ERROR #11\n"); test_control_return(1); } - + /* Change the preemption threshold back to 15 to allow thread 2 to run. */ - status = tx_thread_preemption_change(&thread_0, 15, &old_threshold); + status = tx_thread_preemption_change(&thread_0, 15, &old_threshold); /* Check status an thread 2 run counter. */ if ((status != TX_SUCCESS) && (thread_2_counter != (i+2))) @@ -237,21 +237,21 @@ UINT i; } /* Change the priority of threads 0 and 1. */ - status = tx_thread_priority_change(&thread_0, 7, &old_threshold); - status += tx_thread_priority_change(&thread_1, 5, &old_threshold); + status = tx_thread_priority_change(&thread_0, 7, &old_threshold); + status += tx_thread_priority_change(&thread_1, 5, &old_threshold); /* Check status. */ - if (status != TX_SUCCESS) + if (status != TX_SUCCESS) { /* Thread error. */ printf("ERROR #13\n"); test_control_return(1); - } + } /* Change the preemption-threshold of this thread. */ status = tx_thread_preemption_change(&thread_0, 0, &old_threshold); - + /* Check status. */ if ((status != TX_SUCCESS) || (old_threshold != 7)) { @@ -259,29 +259,29 @@ UINT i; /* Thread error. */ printf("ERROR #14\n"); test_control_return(1); - } - + } + /* Get the mutex that has priority inheritance. */ status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Check status. */ - if (status != TX_SUCCESS) + if (status != TX_SUCCESS) { /* Thread error. */ printf("ERROR #15\n"); test_control_return(1); - } - + } + /* Resume thread 1 so that it can suspend on the mutex and automatically raise its priority. */ tx_thread_resume(&thread_1); - + /* Self suspend so that thread 1 and run. */ tx_thread_suspend(&thread_0); - + /* Restore the preemption-threshold of this thread. */ status = tx_thread_preemption_change(&thread_0, old_threshold, &old_threshold); - + /* Check status. */ if ((status != TX_SUCCESS) || (old_threshold != 0) || (thread_0.tx_thread_priority != 5) || (thread_0.tx_thread_preempt_threshold != 5)) { @@ -289,10 +289,10 @@ UINT i; /* Thread error. */ printf("ERROR #16\n"); test_control_return(1); - } + } /* Let thread 1 run again so it can release the mutex and undo the priority inheritance. */ - status = tx_mutex_put(&mutex_0); + status = tx_mutex_put(&mutex_0); /* Check status. */ if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 7) || (thread_0.tx_thread_preempt_threshold != 7)) @@ -301,7 +301,7 @@ UINT i; /* Thread error. */ printf("ERROR #17\n"); test_control_return(1); - } + } /* Test direct call to the thread preemption change routine with a threshold greater than the current priority. */ status = _tx_thread_preemption_change(&thread_0, 8, &old_threshold); @@ -313,7 +313,7 @@ UINT i; /* Thread error. */ printf("ERROR #18\n"); test_control_return(1); - } + } #endif @@ -329,7 +329,7 @@ static void thread_1_entry(ULONG thread_input) /* Self suspend after initial run. */ tx_thread_suspend(&thread_1); - + /* Increment the thread counter. */ thread_1_counter++; @@ -343,7 +343,7 @@ static void thread_1_entry(ULONG thread_input) tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); /* Release the mutex. */ - tx_mutex_put(&mutex_0); + tx_mutex_put(&mutex_0); } @@ -352,10 +352,10 @@ static void thread_2_entry(ULONG thread_input) while(1) { - + /* Increment thread counter. */ thread_2_counter++; - + /* Self suspend. */ tx_thread_suspend(&thread_2); } diff --git a/test/tx/regression/threadx_thread_priority_change.c b/test/tx/regression/threadx_thread_priority_change.c index a7649b8e..6a61e2cf 100644 --- a/test/tx/regression/threadx_thread_priority_change.c +++ b/test/tx/regression/threadx_thread_priority_change.c @@ -51,7 +51,7 @@ UINT saved_preempt_disable; #ifndef TX_NOT_INTERRUPTABLE /* Determine if we have the interrupt condition we are looking for. */ - if ((thread_3.tx_thread_priority == 6) && + if ((thread_3.tx_thread_priority == 6) && (thread_3.tx_thread_state == TX_READY) && (_tx_thread_priority_list[6] != &thread_3) && (thread_3_counter > 100)) @@ -59,16 +59,16 @@ UINT saved_preempt_disable; /* Save the preempt disable flag. */ saved_preempt_disable = _tx_thread_preempt_disable; - + /* Clear the preempt disable flag to ensure the API works correctly. */ _tx_thread_preempt_disable = 0; /* Suspend the thread to generate the condition. */ tx_thread_suspend(&thread_3); - + /* Restore the preempt disable flag. */ _tx_thread_preempt_disable = saved_preempt_disable; - + /* Done trying to generate this test condition. */ test_isr_dispatch = TX_NULL; } @@ -77,7 +77,7 @@ UINT saved_preempt_disable; /* Can't get the interrupt inside the code wit TX_NOT_INTERRUPTABLE defined, so simply stop after thread_3_counter > 100. */ if (thread_3_counter > 100) { - + /* Done trying to generate this test condition. */ test_isr_dispatch = TX_NULL; } @@ -102,8 +102,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -115,8 +115,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 22, 22, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -128,16 +128,16 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 30, 1, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4, + pointer, TEST_STACK_SIZE_PRINTF, 6, 6, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -171,11 +171,11 @@ UINT status; /* Increment thread 0 counter. */ thread_0_counter++; - /* Change priority to 22, to match that of the next highest priority ready thread. - This is to test the update of the priority list when a thread is moved to a + /* Change priority to 22, to match that of the next highest priority ready thread. + This is to test the update of the priority list when a thread is moved to a priority with already ready threads. */ status = tx_thread_priority_change(&thread_0, 22, &old_priority); - + /* Check status, return priority, and run count of other thread. */ if ((status != TX_SUCCESS) || (old_priority != 16) || (thread_1_counter != 0)) { @@ -186,7 +186,7 @@ UINT status; } /* Restore original priority. */ - tx_thread_priority_change(&thread_0, old_priority, &old_priority); + tx_thread_priority_change(&thread_0, old_priority, &old_priority); /* See if we can change priority of this thread. */ status = tx_thread_priority_change(&thread_0, 7, &old_priority); @@ -224,7 +224,7 @@ UINT status; test_control_return(1); } - /* Thread 1 should have run already... Raise this threads priority + /* Thread 1 should have run already... Raise this threads priority back up. */ status = tx_thread_priority_change(&thread_0, 8, &old_priority); @@ -284,10 +284,10 @@ UINT status; printf("ERROR #11\n"); test_control_return(1); } - + /* Now thread 1 should be suspended. Let's change thread 0's priority and make sure thread 2 doesn't run yet! */ status = tx_thread_priority_change(&thread_0, 7, &old_priority); - + /* Check status, return priority, and run count of other thread. */ if ((status != TX_SUCCESS) || (old_priority != 8) || (thread_1_counter != 2) || (thread_2_counter != 0)) { @@ -325,12 +325,12 @@ static void thread_2_entry(ULONG thread_input) while(1) { - + /* This thread should never run! */ /* Increment the thread counter. */ thread_2_counter++; - + /* Self suspend. */ tx_thread_suspend(&thread_2); } @@ -361,12 +361,12 @@ UINT loop; /* Raise priority of thread 3 for code coverage. */ tx_thread_priority_change(&thread_3, 6, &old_priority); tx_thread_priority_change(&thread_3, 5, &old_priority); - + /* Check to see if thread 4 has run... it should not have executed yet. If it does, set the thread_1_counter to indicate an error! */ if (thread_4_counter) thread_1_counter++; - + } while (test_isr_dispatch); } diff --git a/test/tx/regression/threadx_thread_relinquish_test.c b/test/tx/regression/threadx_thread_relinquish_test.c index e8b4ada7..5b180d84 100644 --- a/test/tx/regression/threadx_thread_relinquish_test.c +++ b/test/tx/regression/threadx_thread_relinquish_test.c @@ -47,8 +47,8 @@ CHAR *pointer; create information. */ /* Create thread 0. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -61,8 +61,8 @@ CHAR *pointer; } /* Create thread 1. */ - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -75,8 +75,8 @@ CHAR *pointer; } /* Create thread 2. */ - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -89,8 +89,8 @@ CHAR *pointer; } /* Create thread 3. */ - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -172,7 +172,7 @@ static void thread_3_entry(ULONG thread_input) /* Immediate response relinquish. */ tx_thread_relinquish(); - + /* All other threads should be completed now. */ if ((thread_0.tx_thread_state != TX_COMPLETED) || (thread_1.tx_thread_state != TX_COMPLETED) || (thread_2.tx_thread_state != TX_COMPLETED)) diff --git a/test/tx/regression/threadx_thread_reset_test.c b/test/tx/regression/threadx_thread_reset_test.c index ff3531a5..a709d163 100644 --- a/test/tx/regression/threadx_thread_reset_test.c +++ b/test/tx/regression/threadx_thread_reset_test.c @@ -35,7 +35,7 @@ static void entry_exit_notify(TX_THREAD *thread_ptr, UINT type) /* Check for the appropriate thread. */ if (thread_ptr != &thread_0) return; - + /* Check for type. */ if (type == TX_THREAD_ENTRY) thread_0_enter++; @@ -63,8 +63,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -94,8 +94,8 @@ CHAR *pointer; #endif - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -107,8 +107,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -150,11 +150,11 @@ UINT status; /* Attempt to delete thread 2, which is in the wrong stat for deleting. */ status = tx_thread_delete(&thread_2); - + /* Check for the proper status. */ if (status != TX_DELETE_ERROR) { - + /* Thread delete error. */ printf("ERROR #5\n"); test_control_return(1); @@ -177,11 +177,11 @@ UINT status; /* Call thread reset on thread 2, which should result in an error. */ status = tx_thread_reset(&thread_2); - + /* Check for proper status. */ if (status != TX_NOT_DONE) { - + /* Thread reset error. */ printf("ERROR #7\n"); test_control_return(1); @@ -206,12 +206,12 @@ UINT status; /* Terminate thread 0. */ status = tx_thread_terminate(&thread_0); - status += tx_thread_reset(&thread_0); - - + status += tx_thread_reset(&thread_0); + + /* Now resume thread 0 to let it run. */ status += tx_thread_resume(&thread_0); - + /* Determine if the first Thread has run and if it's current state is finished. */ if ((thread_0.tx_thread_state != TX_COMPLETED) || (thread_0_counter != 2) || @@ -228,7 +228,7 @@ UINT status; } else { - + /* Successful thread finish test. */ printf("SUCCESS!\n"); diff --git a/test/tx/regression/threadx_thread_simple_sleep_non_clear_test.c b/test/tx/regression/threadx_thread_simple_sleep_non_clear_test.c index f406924c..df8bb62b 100644 --- a/test/tx/regression/threadx_thread_simple_sleep_non_clear_test.c +++ b/test/tx/regression/threadx_thread_simple_sleep_non_clear_test.c @@ -32,15 +32,15 @@ CHAR *pointer; /* Put first available memory address into a character pointer. */ pointer = (CHAR *) first_unused_memory; - /* Place a 1 in the thread control block to simulate a control block created in + /* Place a 1 in the thread control block to simulate a control block created in random memory. */ thread_0.tx_thread_timer.tx_timer_internal_re_initialize_ticks = 1; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); /* Check for status. */ diff --git a/test/tx/regression/threadx_thread_simple_sleep_test.c b/test/tx/regression/threadx_thread_simple_sleep_test.c index 6b7afbe1..f038fafd 100644 --- a/test/tx/regression/threadx_thread_simple_sleep_test.c +++ b/test/tx/regression/threadx_thread_simple_sleep_test.c @@ -35,8 +35,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); /* Check for status. */ diff --git a/test/tx/regression/threadx_thread_simple_suspend_test.c b/test/tx/regression/threadx_thread_simple_suspend_test.c index 52215a75..a05797ec 100644 --- a/test/tx/regression/threadx_thread_simple_suspend_test.c +++ b/test/tx/regression/threadx_thread_simple_suspend_test.c @@ -1,4 +1,4 @@ -/* This test is designed to see if a thread can successfully suspend itself in a single +/* This test is designed to see if a thread can successfully suspend itself in a single thread system. This also tests a thread created that is not automatically enabled. */ #include <stdio.h> @@ -39,8 +39,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -52,8 +52,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c b/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c index 69eadbc6..d5c335f0 100644 --- a/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c +++ b/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c @@ -99,7 +99,7 @@ ULONG i; if (loop_count < min_loop_count) min_loop_count = loop_count; if (loop_count > max_loop_count) - max_loop_count = loop_count; + max_loop_count = loop_count; lower_bound = loop_count - 1; upper_bound = loop_count + 1; @@ -110,18 +110,18 @@ ULONG i; if ((current_itterations < lower_bound) || (current_itterations > upper_bound)) current_itterations = lower_bound; - + #ifdef DEBUG_1 /* Last loop count. */ last_loop_count = loop_count; #endif - + /* Reset the loop count to all ones! */ loop_count = 0xFFFFFFFF; } count++; for (i = 0; i < (count%32); i++) - destination++; + destination++; /* Determine if the ISR is in the mode to wakeup the thread suspending with a timeout. */ if (isr_test_suspend_interrupt) @@ -135,26 +135,26 @@ ULONG i; if ((_tx_thread_preempt_disable) && (thread_0.tx_thread_timer.tx_timer_internal_list_head == TX_NULL)) { - + /* Set the flag showing the condition is present. */ isr_test_suspend_interrupted_condition = TX_TRUE; - + /* All done with the test. */ isr_test_suspend_interrupt = TX_FALSE; } - + /* Post to the semaphore to wakeup the thread. */ tx_semaphore_put(&test_semaphore); - } - + } + return; } #endif #endif - + /* Increment the ISR count. */ isr_count++; - + /* Call sleep from ISR to check for error! */ status = tx_thread_sleep(100); @@ -165,7 +165,7 @@ ULONG i; error = 1; } - + /* End the ISR. */ test_isr_dispatch = TX_NULL; } @@ -190,8 +190,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); /* Check for status. */ @@ -221,7 +221,7 @@ CHAR *pointer; current_itterations = 0; #ifdef DEBUG_1 last_loop_count = 0x0; -#endif +#endif #endif #endif } @@ -246,11 +246,11 @@ volatile ULONG value = 0; /* Call sleep with an expiration of 0 and test error code. */ status = tx_thread_sleep(0); - + /* Check error code. */ if (status != TX_SUCCESS) { - + /* Thread Simple Sleep error. */ printf("ERROR #3\n"); test_control_return(1); @@ -274,10 +274,10 @@ volatile ULONG value = 0; /* Callibrate the loop count from thread sleep. */ for (i = 0; i < 180; i++) { - + /* Sleep to get a fresh time. */ tx_thread_sleep(1); - + /* Set the loop count to 0 and start counting.... */ loop_count = 0; start_time = _tx_timer_system_clock; @@ -288,7 +288,7 @@ volatile ULONG value = 0; delay_function(); loop_count++; } while (start_time == _tx_timer_system_clock); - + /* Wait to reset the loop count. */ tx_thread_sleep(1); } @@ -323,7 +323,7 @@ volatile ULONG value = 0; /* Call delay function. */ delay_function(); loop_count++; - } while (loop_count < current_itterations); + } while (loop_count < current_itterations); /* Check for a timer interrupt... if so, just skip the semaphore get. */ if (start_time != _tx_timer_system_clock) @@ -331,7 +331,7 @@ volatile ULONG value = 0; /* Suspend on the semaphore for 20 ticks... */ tx_semaphore_get(&test_semaphore, 20); - + /* Adjust the current itterations. */ current_itterations++; if (current_itterations > upper_bound) @@ -391,14 +391,14 @@ volatile ULONG value = 0; /* Check for error. */ if (tx_time_get() < 100) { - + /* Thread Simple Sleep error. */ printf("ERROR #4\n"); test_control_return(1); - } + } #endif #endif - + /* Clear the tick count. */ tx_time_set(0); @@ -419,12 +419,12 @@ volatile ULONG value = 0; /* Check to make sure the ISR happened and the proper return value was present. */ if ((isr_count == 0) || (error)) { - + /* Thread Simple Sleep error. */ printf("ERROR #6\n"); test_control_return(1); } - else + else { /* Successful Simple Sleep test. */ diff --git a/test/tx/regression/threadx_thread_sleep_terminate_test.c b/test/tx/regression/threadx_thread_sleep_terminate_test.c index 871fc6e2..98862051 100644 --- a/test/tx/regression/threadx_thread_sleep_terminate_test.c +++ b/test/tx/regression/threadx_thread_sleep_terminate_test.c @@ -30,7 +30,7 @@ static void entry_exit_notify(TX_THREAD *thread_ptr, UINT type) /* Check for the appropriate thread. */ if (thread_ptr != &thread_1) return; - + /* Check for type. */ if (type == TX_THREAD_ENTRY) thread_1_enter++; @@ -58,8 +58,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -71,8 +71,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -144,7 +144,7 @@ UINT status; /* Now try to suspend a terminated thread. */ status = tx_thread_suspend(&thread_1); - + /* Check status. */ if (status != TX_SUSPEND_ERROR) { @@ -153,7 +153,7 @@ UINT status; printf("ERROR #6\n"); test_control_return(1); } - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); @@ -178,7 +178,7 @@ UINT status; /* Check status. */ if (status != TX_SUCCESS) { - thread_1_counter = 0; /* Make an error! */ + thread_1_counter = 0; /* Make an error! */ return; } } diff --git a/test/tx/regression/threadx_thread_stack_checking_test.c b/test/tx/regression/threadx_thread_stack_checking_test.c index 3ffe3841..940b6c6b 100644 --- a/test/tx/regression/threadx_thread_stack_checking_test.c +++ b/test/tx/regression/threadx_thread_stack_checking_test.c @@ -62,11 +62,11 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -75,8 +75,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -88,8 +88,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, TX_NO_TIME_SLICE, TX_DONT_START); thread_2_stack_start = pointer; pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -137,7 +137,7 @@ UINT status; /* Resume thread 1 to get the stack checking to take place. */ status = tx_thread_resume(&thread_1); - + /* Suspend to allow thread 1 to run. */ tx_thread_suspend(&thread_0); @@ -158,7 +158,7 @@ UINT status; } else { - + /* Success! */ printf("SUCCESS!\n"); test_control_return(0); @@ -201,10 +201,10 @@ TX_THREAD fake_thread; /* Increment thread 1 counter. */ thread_1_counter++; - /* Now, deregister the stack error handler and get into a spin condition. We will then + /* Now, deregister the stack error handler and get into a spin condition. We will then want to terminate thread 1 from thread 0 when it awakes! */ tx_thread_stack_error_notify(TX_NULL); - + /* Now resume thread 2 again to cause the stack error! */ tx_thread_resume(&thread_2); @@ -218,7 +218,7 @@ TX_THREAD fake_thread; static void thread_2_entry(ULONG thread_input) { - + /* Increment thread 1 counter. */ thread_2_counter++; } diff --git a/test/tx/regression/threadx_thread_terminate_delete_test.c b/test/tx/regression/threadx_thread_terminate_delete_test.c index dbe919f3..63fd6a69 100644 --- a/test/tx/regression/threadx_thread_terminate_delete_test.c +++ b/test/tx/regression/threadx_thread_terminate_delete_test.c @@ -42,7 +42,7 @@ static void entry_exit_notify(TX_THREAD *thread_ptr, UINT type) /* Check for the appropriate thread. */ if (thread_ptr != &thread_1) return; - + /* Check for type. */ if (type == TX_THREAD_ENTRY) thread_1_enter++; @@ -57,7 +57,7 @@ static void entry_exit_notify3(TX_THREAD *thread_ptr, UINT type) /* Check for the appropriate thread. */ if (thread_ptr != &thread_3) return; - + /* Check for type. */ if (type == TX_THREAD_ENTRY) thread_3_enter++; @@ -84,8 +84,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -97,8 +97,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -136,8 +136,8 @@ CHAR *pointer; #endif - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -149,8 +149,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 12, 12, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -231,7 +231,7 @@ UINT status; test_control_return(1); } - /* At this point, terminate thread 2 which should be in a suspended state + /* At this point, terminate thread 2 which should be in a suspended state right now. */ status = tx_thread_terminate(&thread_2); @@ -267,7 +267,7 @@ UINT status; test_control_return(1); } - /* At this point, terminate thread 3 which should be in a suspended state + /* At this point, terminate thread 3 which should be in a suspended state on the semaphore right now. */ status = tx_thread_terminate(&thread_3); diff --git a/test/tx/regression/threadx_thread_time_slice_change_test.c b/test/tx/regression/threadx_thread_time_slice_change_test.c index 8ee7df3b..0122fc2a 100644 --- a/test/tx/regression/threadx_thread_time_slice_change_test.c +++ b/test/tx/regression/threadx_thread_time_slice_change_test.c @@ -39,8 +39,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -52,8 +52,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 22, 22, 200, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -138,7 +138,7 @@ static void thread_1_entry(ULONG thread_input) while(1) { - + /* Identify. */ tx_thread_identify(); diff --git a/test/tx/regression/threadx_thread_wait_abort_and_isr_test.c b/test/tx/regression/threadx_thread_wait_abort_and_isr_test.c index 56fef596..bc7446f7 100644 --- a/test/tx/regression/threadx_thread_wait_abort_and_isr_test.c +++ b/test/tx/regression/threadx_thread_wait_abort_and_isr_test.c @@ -53,7 +53,7 @@ static volatile UINT miss_count = 0; /* Check for proper error status. */ if (status != TX_CALLER_ERROR) { - + /* Blow up the test to force an error. */ condition_count = 10000000; semaphore_put_counter = 0xFFFF0000; @@ -67,7 +67,7 @@ static volatile UINT miss_count = 0; condition_count++; } - /* + /* It is possible for this test to get into a resonance condition in which the ISR never occurs while preemption is disabled (especially if the ISR is installed in the periodic timer interrupt handler, which is @@ -105,8 +105,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -118,8 +118,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -133,7 +133,7 @@ CHAR *pointer; /* Create semaphore - consumer producer semaphore. */ status = tx_semaphore_create(&semaphore_0, "semaphore 0", 0); - + /* Check for status. */ if (status != TX_SUCCESS) { @@ -190,7 +190,7 @@ UINT status; } /* Check for the preempt disable flag being set. */ - if (_tx_thread_preempt_disable) + if (_tx_thread_preempt_disable) { /* Test error! */ @@ -207,13 +207,13 @@ UINT status; #ifdef TX_NOT_INTERRUPTABLE - /* Determine if we have a non-interruptable build of ThreadX. If so, just + /* Determine if we have a non-interruptable build of ThreadX. If so, just get out of this loop after 100 passes. */ if (thread_0_counter >= 100) break; #endif - + } } @@ -223,7 +223,7 @@ UINT status; #ifdef TX_NOT_INTERRUPTABLE /* At this point, check to see if we got all the semaphores! */ if ((thread_0_counter != (semaphore_put_counter - semaphore_0.tx_semaphore_count)) || - (condition_count != 0)) + (condition_count != 0)) #else /* At this point, check to see if we got all the semaphores! */ if (thread_0_counter != (semaphore_put_counter - semaphore_0.tx_semaphore_count)) diff --git a/test/tx/regression/threadx_thread_wait_abort_test.c b/test/tx/regression/threadx_thread_wait_abort_test.c index a2e8e42d..49852ec1 100644 --- a/test/tx/regression/threadx_thread_wait_abort_test.c +++ b/test/tx/regression/threadx_thread_wait_abort_test.c @@ -39,8 +39,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -52,8 +52,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_time_get_set_test.c b/test/tx/regression/threadx_time_get_set_test.c index 6bc2ddc1..06b8e6f5 100644 --- a/test/tx/regression/threadx_time_get_set_test.c +++ b/test/tx/regression/threadx_time_get_set_test.c @@ -34,8 +34,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -66,7 +66,7 @@ ULONG current_time; /* Sleep for 1 tick to get a fresh timer. */ tx_thread_sleep(1); - + /* Set time to 0. */ tx_time_set(0); diff --git a/test/tx/regression/threadx_timer_activate_deactivate_test.c b/test/tx/regression/threadx_timer_activate_deactivate_test.c index a238ea33..69f9b38f 100644 --- a/test/tx/regression/threadx_timer_activate_deactivate_test.c +++ b/test/tx/regression/threadx_timer_activate_deactivate_test.c @@ -46,8 +46,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -89,13 +89,13 @@ TX_TIMER_INTERNAL **current_list_head; /* Call the timer thread entry function with an invalid value to make sure the code simply returns. */ _tx_timer_thread_entry(0); -#endif - +#endif + #ifndef TX_TIMER_PROCESS_IN_ISR tx_thread_resume(&_tx_timer_thread); #endif - + /* Call the internal timer activate function with 0 remaining time. */ test_timer.tx_timer_internal_remaining_ticks = 0; _tx_timer_system_activate(&test_timer); @@ -105,7 +105,7 @@ TX_TIMER_INTERNAL **current_list_head; list_head = TX_NULL; test_timer.tx_timer_internal_list_head = &list_head; _tx_timer_system_activate(&test_timer); - + /* Call the internal timer deactivate function to ensure the list head is not updated unless valid. */ list_head = TX_NULL; test_timer.tx_timer_internal_list_head = &list_head; @@ -115,8 +115,8 @@ TX_TIMER_INTERNAL **current_list_head; /* Call timer info get with a timer setup to exercise a path not possible, in order to exercise all conditionals. */ test_app_timer.tx_timer_internal.tx_timer_internal_list_head = (_tx_timer_list_end + 1); - status = _tx_timer_info_get(&test_app_timer, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + status = _tx_timer_info_get(&test_app_timer, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); + /* Deactivate and activate the timer. */ test_app_timer.tx_timer_internal.tx_timer_internal_active_next = &test_app_timer.tx_timer_internal; status += _tx_timer_deactivate(&test_app_timer); @@ -160,7 +160,7 @@ TX_TIMER_INTERNAL **current_list_head; /* Sleep for a 14 ticks. */ tx_thread_sleep(14); - /* At this point the initial expiration of the timer should have + /* At this point the initial expiration of the timer should have happened. */ if (timer_0_counter != 1) { @@ -174,7 +174,7 @@ TX_TIMER_INTERNAL **current_list_head; again! */ tx_thread_sleep(24); - /* At this point the timer counter should still be 1. */ + /* At this point the timer counter should still be 1. */ if (timer_0_counter != 1) { @@ -205,27 +205,27 @@ TX_TIMER_INTERNAL **current_list_head; timer_2.tx_timer_id = TX_TIMER_ID; timer_2.tx_timer_internal.tx_timer_internal_list_head = (TX_TIMER_INTERNAL **) ¤t_list_head; current_list_head = (struct TX_TIMER_INTERNAL_STRUCT **) &(timer_2.tx_timer_internal); - timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = TX_TIMER_ENTRIES*2; + timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = TX_TIMER_ENTRIES*2; timer_2.tx_timer_internal.tx_timer_internal_active_next = &(timer_2.tx_timer_internal); status = tx_timer_deactivate(&timer_2); /* Check for error. */ if ((status != TX_SUCCESS) || (timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks != TX_TIMER_ENTRIES)) { - + /* Application timer error. */ printf("ERROR #8a\n"); test_control_return(1); } - /* Sleep for twice the expiration time to make sure the timer + /* Sleep for twice the expiration time to make sure the timer doesn't automatically reschedule. */ tx_thread_sleep(47); /* Check for an error. */ - /* At this point the timer counter should still be 1. */ + /* At this point the timer counter should still be 1. */ if (timer_0_counter != 1) { diff --git a/test/tx/regression/threadx_timer_deactivate_accuracy_test.c b/test/tx/regression/threadx_timer_deactivate_accuracy_test.c index 6af4bde4..625b82a6 100644 --- a/test/tx/regression/threadx_timer_deactivate_accuracy_test.c +++ b/test/tx/regression/threadx_timer_deactivate_accuracy_test.c @@ -41,8 +41,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -144,7 +144,7 @@ UINT status; printf("ERROR #7\n"); test_control_return(1); } - + /* Sleep */ tx_thread_sleep(4); diff --git a/test/tx/regression/threadx_timer_information_test.c b/test/tx/regression/threadx_timer_information_test.c index 4dbc3c9b..7954de2c 100644 --- a/test/tx/regression/threadx_timer_information_test.c +++ b/test/tx/regression/threadx_timer_information_test.c @@ -48,8 +48,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -119,7 +119,7 @@ TX_TIMER_INTERNAL **list_head; /* Application timer error. */ printf("ERROR #4\n"); test_control_return(1); - } + } /* Deactivate the timer. */ status = tx_timer_deactivate(&timer_0); @@ -143,7 +143,7 @@ TX_TIMER_INTERNAL **list_head; /* Application timer error. */ printf("ERROR #6\n"); test_control_return(1); - } + } /* Modify the timer. */ status = tx_timer_change(&timer_0, 100, 1); @@ -194,12 +194,12 @@ TX_TIMER_INTERNAL **list_head; /* Check for successful completion. */ if ((status != TX_SUCCESS) || (active != TX_TRUE) || (remaining_ticks != 1) || (reschedule_ticks != 1) || (next_timer != &timer_1)) { - + /* Application timer error. */ printf("ERROR #10\n"); test_control_return(1); - } - + } + /* Now, deactivate timer 0 to get another path through the info get service. */ status = tx_timer_deactivate(&timer_0); status += tx_timer_info_get(&timer_0, &name, &active, &remaining_ticks, &reschedule_ticks, &next_timer); @@ -207,26 +207,26 @@ TX_TIMER_INTERNAL **list_head; /* Check for successful completion. */ if ((status != TX_SUCCESS) || (active != TX_FALSE) || (remaining_ticks != 1) || (reschedule_ticks != 1) || (next_timer != &timer_1)) { - + /* Application timer error. */ printf("ERROR #11\n"); test_control_return(1); - } + } - /* Change timer 0 to a large value and get the information again. */ + /* Change timer 0 to a large value and get the information again. */ status = tx_timer_change(&timer_0, 100, 200); status += tx_timer_activate(&timer_0); - + status += tx_timer_info_get(&timer_0, &name, &active, &remaining_ticks, &reschedule_ticks, &next_timer); /* Check for successful completion. */ if ((status != TX_SUCCESS) || (active != TX_TRUE) || (remaining_ticks != 100) || (reschedule_ticks != 200) || (next_timer != &timer_1)) { - + /* Application timer error. */ printf("ERROR #12\n"); test_control_return(1); - } + } #ifdef TX_TIMER_ENABLE_PERFORMANCE_INFO @@ -236,7 +236,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_PTR_ERROR) { - + /* Application timer error. */ printf("ERROR #13\n"); test_control_return(1); @@ -245,30 +245,30 @@ TX_TIMER_INTERNAL **list_head; /* Now get the performance information. */ status = tx_timer_performance_info_get(&timer_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_timer_performance_info_get(&timer_0, &activates, &reactivates, &deactivates, &expirations, &expiration_adjusts); - + /* Check for successful completion. */ - if ((status != TX_SUCCESS) || (activates != timer_0.tx_timer_performance_activate_count) || (reactivates != timer_0.tx_timer_performance_reactivate_count) || + if ((status != TX_SUCCESS) || (activates != timer_0.tx_timer_performance_activate_count) || (reactivates != timer_0.tx_timer_performance_reactivate_count) || (deactivates != timer_0.tx_timer_performance_deactivate_count) || (expirations != timer_0.tx_timer_performance_expiration_count) || (expiration_adjusts != timer_0.tx_timer_performance__expiration_adjust_count)) { - + /* Application timer error. */ printf("ERROR #14\n"); test_control_return(1); - } + } /* Now get the system performance information. */ status = tx_timer_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); status += tx_timer_performance_system_info_get(&activates, &reactivates, &deactivates, &expirations, &expiration_adjusts); - + /* Check for successful completion. */ - if ((status != TX_SUCCESS) || (activates != _tx_timer_performance_activate_count) || (reactivates != _tx_timer_performance_reactivate_count) || + if ((status != TX_SUCCESS) || (activates != _tx_timer_performance_activate_count) || (reactivates != _tx_timer_performance_reactivate_count) || (deactivates != _tx_timer_performance_deactivate_count) || (expirations != _tx_timer_performance_expiration_count) || (expiration_adjusts != _tx_timer_performance__expiration_adjust_count)) { - + /* Application timer error. */ printf("ERROR #15\n"); test_control_return(1); - } + } #else @@ -278,7 +278,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #16\n"); test_control_return(1); @@ -290,7 +290,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #17\n"); test_control_return(1); @@ -302,7 +302,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #18\n"); test_control_return(1); @@ -314,7 +314,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #19\n"); test_control_return(1); @@ -326,7 +326,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #20\n"); test_control_return(1); @@ -338,7 +338,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #21\n"); test_control_return(1); @@ -350,7 +350,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #22\n"); test_control_return(1); @@ -362,7 +362,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #23\n"); test_control_return(1); @@ -374,7 +374,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #24\n"); test_control_return(1); @@ -386,7 +386,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #25\n"); test_control_return(1); @@ -398,7 +398,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #26\n"); test_control_return(1); @@ -410,7 +410,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #27\n"); test_control_return(1); @@ -422,7 +422,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Application timer error. */ printf("ERROR #28\n"); test_control_return(1); @@ -432,18 +432,18 @@ TX_TIMER_INTERNAL **list_head; /* Test timer that is in the process of expiration - on temporary "expired" list. */ TX_MEMSET(&timer_2, 0, (sizeof(TX_TIMER))); - + /* Setup fake timer and test for no-reactivate condition. */ timer_2.tx_timer_id = TX_TIMER_ID; timer_2.tx_timer_internal.tx_timer_internal_list_head = (TX_TIMER_INTERNAL **) &list_head; list_head = (struct TX_TIMER_INTERNAL_STRUCT **) &(timer_2.tx_timer_internal); - timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = 10; + timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = 10; status = tx_timer_info_get(&timer_2, TX_NULL, TX_NULL, &remaining_ticks, &reschedule_ticks, TX_NULL); /* Check for error. */ if ((status != TX_SUCCESS) || (remaining_ticks != 0) || (reschedule_ticks != 0)) { - + /* Application timer error. */ printf("ERROR #28a\n"); test_control_return(1); @@ -453,13 +453,13 @@ TX_TIMER_INTERNAL **list_head; timer_2.tx_timer_id = TX_TIMER_ID; timer_2.tx_timer_internal.tx_timer_internal_list_head = (TX_TIMER_INTERNAL **) &list_head; list_head = (struct TX_TIMER_INTERNAL_STRUCT **) &(timer_2.tx_timer_internal); - timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = TX_TIMER_ENTRIES * 2; + timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = TX_TIMER_ENTRIES * 2; status = tx_timer_info_get(&timer_2, TX_NULL, TX_NULL, &remaining_ticks, &reschedule_ticks, TX_NULL); /* Check for error. */ if ((status != TX_SUCCESS) || (remaining_ticks != TX_TIMER_ENTRIES) || (reschedule_ticks != 0)) { - + /* Application timer error. */ printf("ERROR #28a\n"); test_control_return(1); @@ -473,7 +473,7 @@ TX_TIMER_INTERNAL **list_head; timer_2.tx_timer_id = TX_TIMER_ID; timer_2.tx_timer_internal.tx_timer_internal_list_head = (TX_TIMER_INTERNAL **) &list_head; list_head = (struct TX_TIMER_INTERNAL_STRUCT **) &(timer_2.tx_timer_internal); - timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = 13; + timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = 13; _tx_timer_expired_timer_ptr = &timer_2.tx_timer_internal; status = tx_timer_info_get(&timer_2, TX_NULL, TX_NULL, &remaining_ticks, &reschedule_ticks, TX_NULL); _tx_timer_expired_timer_ptr = TX_NULL; @@ -484,7 +484,7 @@ TX_TIMER_INTERNAL **list_head; /* Check for error. */ if ((status != TX_SUCCESS) || (remaining_ticks != 0) || (reschedule_ticks != 0)) { - + /* Application timer error. */ printf("ERROR #28b\n"); test_control_return(1); diff --git a/test/tx/regression/threadx_timer_large_timer_accuracy_test.c b/test/tx/regression/threadx_timer_large_timer_accuracy_test.c index dde97fe4..726523b9 100644 --- a/test/tx/regression/threadx_timer_large_timer_accuracy_test.c +++ b/test/tx/regression/threadx_timer_large_timer_accuracy_test.c @@ -41,8 +41,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -144,7 +144,7 @@ UINT status; printf("ERROR #7\n"); test_control_return(1); } - + /* Sleep */ tx_thread_sleep(2); diff --git a/test/tx/regression/threadx_timer_multiple_accuracy_test.c b/test/tx/regression/threadx_timer_multiple_accuracy_test.c index a7be91e2..af9957d8 100644 --- a/test/tx/regression/threadx_timer_multiple_accuracy_test.c +++ b/test/tx/regression/threadx_timer_multiple_accuracy_test.c @@ -43,8 +43,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_timer_multiple_test.c b/test/tx/regression/threadx_timer_multiple_test.c index 3f02d5a7..688a7d5b 100644 --- a/test/tx/regression/threadx_timer_multiple_test.c +++ b/test/tx/regression/threadx_timer_multiple_test.c @@ -1,4 +1,4 @@ -/* This test is designed to test a simple application timer services, +/* This test is designed to test a simple application timer services, including create, activate, deactivate, change, and delete with multiple timers. */ #include <stdio.h> @@ -46,8 +46,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; diff --git a/test/tx/regression/threadx_timer_simple_test.c b/test/tx/regression/threadx_timer_simple_test.c index 3df62caa..7fdf022e 100644 --- a/test/tx/regression/threadx_timer_simple_test.c +++ b/test/tx/regression/threadx_timer_simple_test.c @@ -1,4 +1,4 @@ -/* This test is designed to test a simple application timer services, including create, +/* This test is designed to test a simple application timer services, including create, activate, deactivate, change, and delete. */ #include <stdio.h> @@ -52,7 +52,7 @@ static void thread_1_entry(ULONG thread_input); static void timer_0_expiration(ULONG timer_input); static void timer_1_expiration(ULONG timer_input); -UINT _txe_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr, +UINT _txe_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr, VOID (*expiration_function)(ULONG), ULONG expiration_input, ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate, UINT timer_control_block_size); @@ -75,18 +75,18 @@ UINT status; /* Determine if the timer was able to be created durning initialization. */ if (test_timer_create_init != TX_SUCCESS) { - + /* Error! */ error++; } /* Attempt to delete a timer from a timer. */ status = tx_timer_delete(&timer_0); - + /* Check status. */ if (status != TX_CALLER_ERROR) { - + /* Error! */ error++; } @@ -98,7 +98,7 @@ UINT status; /* Check status. */ if (status != TX_CALLER_ERROR) { - + /* Error! */ error++; } @@ -124,11 +124,11 @@ UINT status; /* Attempt to delete a timer from an ISR. */ status = tx_timer_delete(&timer_0); - + /* Check status. */ if (status != TX_CALLER_ERROR) { - + /* Error! */ error++; } @@ -140,7 +140,7 @@ UINT status; /* Check status. */ if (status != TX_CALLER_ERROR) { - + /* Error! */ error++; } @@ -168,13 +168,13 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 3, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 18, 18, 3, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -234,7 +234,7 @@ UINT status; timer_memory.second = 0x55667788; timer_memory.next_to_last = 0x99aabbcc; timer_memory.last = 0xddeeff00; - + /* Create the timer. */ status = tx_timer_create(&timer_memory.timer, "timer memory", timer_0_expiration, 0x1234, 1000000, 100000, TX_NO_ACTIVATE); @@ -247,7 +247,7 @@ UINT status; (timer_memory.next_to_last != 0x99aabbcc) || (timer_memory.last != 0xddeeff00)) { - + /* Memory overwrite error. */ printf("ERROR #4\n"); test_control_return(1); @@ -257,11 +257,11 @@ UINT status; /* Attempt to activate a non-timer. */ status = tx_timer_activate(TX_NULL); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #5\n"); test_control_return(1); @@ -270,11 +270,11 @@ UINT status; /* Attempt to activate a non-created timer. */ timer_2.tx_timer_id = 0; status = tx_timer_activate(&timer_2); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #6\n"); test_control_return(1); @@ -285,11 +285,11 @@ UINT status; timer_2.tx_timer_internal.tx_timer_internal_list_head = TX_NULL; timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = 0; status = tx_timer_activate(&timer_2); - + /* Check status. */ if (status != TX_ACTIVATE_ERROR) { - + /* Application timer error. */ printf("ERROR #7\n"); test_control_return(1); @@ -301,11 +301,11 @@ UINT status; timer_2.tx_timer_internal.tx_timer_internal_list_head = TX_NULL; timer_2.tx_timer_internal.tx_timer_internal_remaining_ticks = TX_WAIT_FOREVER; status = tx_timer_activate(&timer_2); - + /* Check status. */ if (status != TX_SUCCESS) { - + /* Application timer error. */ printf("ERROR #8\n"); test_control_return(1); @@ -315,11 +315,11 @@ UINT status; /* Attempt to deactivate a non-timer. */ status = tx_timer_deactivate(TX_NULL); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #9\n"); test_control_return(1); @@ -328,11 +328,11 @@ UINT status; /* Attempt to deactivate a non-created timer. */ timer_2.tx_timer_id = 0; status = tx_timer_deactivate(&timer_2); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #10\n"); test_control_return(1); @@ -340,11 +340,11 @@ UINT status; /* Attempt to change a non-timer. */ status = tx_timer_change(TX_NULL, 1, 1); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #11\n"); test_control_return(1); @@ -353,11 +353,11 @@ UINT status; /* Attempt to change a non-created timer. */ timer_2.tx_timer_id = 0; status = tx_timer_change(&timer_2, 1, 1); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #12\n"); test_control_return(1); @@ -365,11 +365,11 @@ UINT status; /* Attempt to change a timer with a 0 initial ticks. */ status = tx_timer_change(&timer_0, 0, 1); - + /* Check status. */ if (status != TX_TICK_ERROR) { - + /* Application timer error. */ printf("ERROR #13\n"); test_control_return(1); @@ -377,11 +377,11 @@ UINT status; /* Attempt to delete a non-time. */ status = tx_timer_delete(TX_NULL); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #14\n"); test_control_return(1); @@ -390,11 +390,11 @@ UINT status; /* Attempt to delete a non-created time. */ timer_2.tx_timer_id = 0; status = tx_timer_delete(&timer_2); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #15\n"); test_control_return(1); @@ -402,11 +402,11 @@ UINT status; /* Attempt to get info from a non-timer. */ status = tx_timer_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #16\n"); test_control_return(1); @@ -415,11 +415,11 @@ UINT status; /* Attempt to get info from a non-created timer. */ timer_2.tx_timer_id = 0; status = tx_timer_info_get(&timer_2, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); - + /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #17\n"); test_control_return(1); @@ -432,7 +432,7 @@ UINT status; /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #18\n"); test_control_return(1); @@ -445,7 +445,7 @@ UINT status; /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #19\n"); test_control_return(1); @@ -458,7 +458,7 @@ UINT status; /* Check status. */ if (status != TX_TIMER_ERROR) { - + /* Application timer error. */ printf("ERROR #20\n"); test_control_return(1); @@ -471,7 +471,7 @@ UINT status; /* Check status. */ if (status != TX_TICK_ERROR) { - + /* Application timer error. */ printf("ERROR #21\n"); test_control_return(1); @@ -484,7 +484,7 @@ UINT status; /* Check status. */ if (status != TX_ACTIVATE_ERROR) { - + /* Application timer error. */ printf("ERROR #22\n"); test_control_return(1); @@ -502,7 +502,7 @@ UINT status; /* Application timer error. */ printf("ERROR #23\n"); test_control_return(1); - } + } /* Deactivate the timer. */ status = tx_timer_deactivate(&timer_0); @@ -526,7 +526,7 @@ UINT status; /* Application timer error. */ printf("ERROR #25\n"); test_control_return(1); - } + } /* Modify the timer. */ status = tx_timer_change(&timer_0, 100, 1); @@ -613,7 +613,7 @@ UINT status; /* Test for error. */ if ((error) || (timer_executed != 1) || (isr_executed != 1)) { - + /* Thread error. */ printf("ERROR #30\n"); test_control_return(1); @@ -623,7 +623,7 @@ UINT status; if (error) { - + /* Thread error. */ printf("ERROR #31\n"); test_control_return(1); @@ -639,11 +639,11 @@ UINT status; static void thread_1_entry(ULONG thread_input) { - + while(1) { - - tx_thread_relinquish(); + + tx_thread_relinquish(); } } @@ -658,7 +658,7 @@ static void timer_0_expiration(ULONG timer_input) static void timer_1_expiration(ULONG timer_input) { - + /* Process timer expiration. */ timer_1_counter++; } diff --git a/test/tx/regression/threadx_trace_basic_test.c b/test/tx/regression/threadx_trace_basic_test.c index bd6ca72f..0914650f 100644 --- a/test/tx/regression/threadx_trace_basic_test.c +++ b/test/tx/regression/threadx_trace_basic_test.c @@ -95,9 +95,9 @@ UINT old_interrupt; /* If win32, we can actually dump the file! */ trace_dump_file = fopen(trace_dump_file_name, "wb+"); - + fwrite(trace_buffer, 1, sizeof(trace_buffer), trace_dump_file); - + fclose(trace_dump_file); /* Restore interrupts. */ @@ -109,7 +109,7 @@ UINT old_interrupt; { trace_dump_file_name[11] = '0'; trace_dump_file_name[10]++; - + if (trace_dump_file_name[10] > '9') { trace_dump_file_name[10] = '0'; @@ -141,7 +141,7 @@ static void test_isr(void) /* Make ISR entry event. */ tx_trace_isr_enter_insert(1); - + /* Resume thread 2. */ tx_thread_resume(&thread_2); @@ -176,7 +176,7 @@ CHAR *pointer; /* Setup a pointer. */ pointer = (CHAR *) first_unused_memory; - + /* Adjust it forward just to make sure there is some space for the test below. */ pointer = pointer + 200; @@ -204,7 +204,7 @@ CHAR *pointer; /* Check status. */ if (status != TX_SUCCESS) { - + printf("Running Trace Basic Test............................................ ERROR #1\n"); test_control_return(1); } @@ -213,7 +213,7 @@ CHAR *pointer; /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + printf("Running Trace Basic Test............................................ ERROR #2\n"); test_control_return(1); } @@ -221,9 +221,9 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, TEST_STACK_SIZE_PRINTF, + + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -235,8 +235,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 15, 15, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -248,8 +248,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 14, 14, TX_NO_TIME_SLICE, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -361,7 +361,7 @@ ULONG object; /* Check status. */ if (status != TX_NOT_DONE) { - + printf("ERROR #6\n"); test_control_return(1); } @@ -370,7 +370,7 @@ ULONG object; /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + printf("ERROR #7\n"); test_control_return(1); } @@ -381,7 +381,7 @@ ULONG object; /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + printf("ERROR #8\n"); test_control_return(1); } @@ -392,7 +392,7 @@ ULONG object; /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + printf("ERROR #9\n"); test_control_return(1); } @@ -403,7 +403,7 @@ ULONG object; /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + printf("ERROR #10\n"); test_control_return(1); } @@ -433,7 +433,7 @@ ULONG object; printf("ERROR #12\n"); test_control_return(1); } - + /* Filter all events. */ status = tx_trace_event_filter(0); @@ -445,7 +445,7 @@ ULONG object; printf("ERROR #13\n"); test_control_return(1); } - + #endif /* Unfilter all events. */ @@ -485,7 +485,7 @@ ULONG object; } #endif - + /* Register the trace buffer full notification routine. */ status = tx_trace_buffer_full_notify(trace_buffer_full); @@ -509,7 +509,7 @@ ULONG object; printf("ERROR #18\n"); test_control_return(1); } - + /* Check the NULL path with trace disabled. */ status = tx_trace_buffer_full_notify(TX_NULL); @@ -521,7 +521,7 @@ ULONG object; printf("ERROR #19\n"); test_control_return(1); } - + #endif /* Create a timer for the test. */ @@ -542,7 +542,7 @@ ULONG object; /* Restore interrupts. */ tx_interrupt_control(old_interrupt); } - + /* Insert user event. */ status = tx_trace_user_event_insert(1027, 1, 2, 3, 4); @@ -629,7 +629,7 @@ ULONG object; break; #endif - } + } /* Clear the ISR. */ test_isr_dispatch = TX_NULL; @@ -661,7 +661,7 @@ ULONG object; /* Attempt to disable again, just to get the TX_NOT_DONE error code. */ status = tx_trace_disable(); - + #ifdef TX_ENABLE_EVENT_TRACE /* Check status. */ @@ -683,7 +683,7 @@ ULONG object; test_control_return(1); } #endif - + /* Attempt to enable event tracing with a bogus size. */ status = tx_trace_enable(trace_buffer, 1, 8); @@ -692,7 +692,7 @@ ULONG object; /* Check status. */ if (status != TX_SIZE_ERROR) { - + /* Trace error. */ printf("ERROR #31\n"); test_control_return(1); @@ -702,7 +702,7 @@ ULONG object; /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Trace error. */ printf("ERROR #32\n"); test_control_return(1); @@ -718,7 +718,7 @@ ULONG object; /* Check status. */ if (status != TX_NOT_DONE) { - + /* Trace error. */ printf("ERROR #33\n"); test_control_return(1); @@ -728,7 +728,7 @@ ULONG object; /* Check status. */ if (status != TX_FEATURE_NOT_ENABLED) { - + /* Trace error. */ printf("ERROR #34\n"); test_control_return(1); @@ -746,7 +746,7 @@ ULONG object; } else { - + /* Successful test. */ printf("SUCCESS!\n"); test_control_return(0); @@ -759,9 +759,9 @@ static void thread_1_entry(ULONG task_input) while(1) { - + thread_1_counter++; - tx_thread_suspend(&thread_1); + tx_thread_suspend(&thread_1); } } @@ -772,8 +772,8 @@ static void thread_2_entry(ULONG task_input) while(1) { - + thread_2_counter++; - tx_thread_suspend(&thread_2); + tx_thread_suspend(&thread_2); } } |
