diff options
Diffstat (limited to 'test/smp/regression/threadx_block_memory_basic_test.c')
| -rw-r--r-- | test/smp/regression/threadx_block_memory_basic_test.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/test/smp/regression/threadx_block_memory_basic_test.c b/test/smp/regression/threadx_block_memory_basic_test.c index 5f2afa01..12e301d1 100644 --- a/test/smp/regression/threadx_block_memory_basic_test.c +++ b/test/smp/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(); } } |
