Remove double free RTOS tests

Remove the double free RTOS tests since this was never defined
behavior of CMSIS-RTOS. This allows testing to pass.

The RTX commit which caused this test to start failing is:
c3b123ef4256f65537e2597af475fc20ec9a383e
RTX5: updated MemoryPoolFree (removed count check) [SDCMSIS-801]

Note - Double freeing an element from a memory pool was never safe.
The error return value when double freeing was misleading since memory
corruption may still be occurring in that case. For more information
on this see SDCMSIS-801.
pull/7875/head
Russ Butler 2018-08-26 12:54:32 -05:00
parent 308dfe3a53
commit c3f5b64b79
2 changed files with 0 additions and 56 deletions

View File

@ -450,38 +450,6 @@ void test_mem_pool_free_realloc_first_complex(AllocType atype)
}
}
/* Robustness checks for free() function.
*
* Given block from the MemoryPool has been successfully deallocated.
* When free operation is executed on this block again.
* Then operation fails with osErrorResource status.
*
* */
void test_mem_pool_free_on_freed_block()
{
MemoryPool<int, 1> mem_pool;
int *p_block;
osStatus status;
/* Allocate memory block. */
p_block = mem_pool.alloc();
/* Show that memory pool block has been allocated. */
TEST_ASSERT_NOT_NULL(p_block);
/* Free memory block. */
status = mem_pool.free(p_block);
/* Check operation status. */
TEST_ASSERT_EQUAL(osOK, status);
/* Free memory block again. */
status = mem_pool.free(p_block);
/* Check operation status. */
TEST_ASSERT_EQUAL(osErrorResource, status);
}
/* Robustness checks for free() function.
* Function under test is called with invalid parameters.
*
@ -601,7 +569,6 @@ Case cases[] = {
Case("Test: fail (out of free blocks).", test_mem_pool_alloc_fail_wrapper<int, 3>),
Case("Test: free() - robust (free block twice).", test_mem_pool_free_on_freed_block),
Case("Test: free() - robust (free called with invalid param - NULL).", free_block_invalid_parameter_null),
Case("Test: free() - robust (free called with invalid param).", free_block_invalid_parameter)
};

View File

@ -265,28 +265,6 @@ void test_free_null()
TEST_ASSERT_EQUAL(osErrorParameter, status);
}
/** Test same message memory deallocation twice
Given an empty mailbox
Then allocate message memory
When try to free it second time
Then it return appropriate error code
*/
void test_free_twice()
{
osStatus status;
Mail<uint32_t, 4> mail_box;
uint32_t *mail = mail_box.alloc();
TEST_ASSERT_NOT_EQUAL(NULL, mail);
status = mail_box.free(mail);
TEST_ASSERT_EQUAL(osOK, status);
status = mail_box.free(mail);
TEST_ASSERT_EQUAL(osErrorResource, status);
}
/** Test get from empty mailbox with timeout set
Given an empty mailbox
@ -515,7 +493,6 @@ Case cases[] = {
Case("Test message send order", test_order),
Case("Test get with timeout on empty mailbox", test_get_empty_timeout),
Case("Test get without timeout on empty mailbox", test_get_empty_no_timeout),
Case("Test message free twice", test_free_twice),
Case("Test null message free", test_free_null),
Case("Test invalid message free", test_free_wrong),
Case("Test message send/receive single thread and order", test_single_thread_order),