tests/kernel/mheap_api_concept: Remove whitebox tests
These two test cases were making whitebox assumptions of both the
block header size and memory layout of an old-style k_mem_pool that
aren't honored by the k_heap allocator. They aren't testing anything
that isn't covered elsewhere.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
diff --git a/tests/kernel/mem_heap/mheap_api_concept/src/main.c b/tests/kernel/mem_heap/mheap_api_concept/src/main.c
index 9460839..920e0a9 100644
--- a/tests/kernel/mem_heap/mheap_api_concept/src/main.c
+++ b/tests/kernel/mem_heap/mheap_api_concept/src/main.c
@@ -27,8 +27,6 @@
ztest_test_suite(mheap_api,
ztest_unit_test(test_mheap_malloc_free),
ztest_unit_test(test_mheap_calloc),
- ztest_unit_test(test_mheap_malloc_align4),
- ztest_unit_test(test_mheap_block_desc),
- ztest_unit_test(test_mheap_block_release));
+ ztest_unit_test(test_mheap_malloc_align4));
ztest_run_test_suite(mheap_api);
}
diff --git a/tests/kernel/mem_heap/mheap_api_concept/src/test_mheap_concept.c b/tests/kernel/mem_heap/mheap_api_concept/src/test_mheap_concept.c
index 67be8b8..c58c0c3 100644
--- a/tests/kernel/mem_heap/mheap_api_concept/src/test_mheap_concept.c
+++ b/tests/kernel/mem_heap/mheap_api_concept/src/test_mheap_concept.c
@@ -44,92 +44,3 @@
k_free(block[i]);
}
}
-
-/**
- * @brief Verify if the block descriptor is included
- * in every block which is allocated
- *
- * @ingroup kernel_heap_tests
- *
- * @see k_malloc(), k_free()
- */
-void test_mheap_block_desc(void)
-{
- void *block[BLK_NUM_MAX], *block_fail;
-
- /**
- * TESTPOINT: The kernel uses the first bytes of any memory
- * block allocated from the heap memory pool to save the heap
- * pointer it needs to later free the block.
- * Test steps:
- * initial memory heap status (F for free, U for used):
- * 64F, 64F, 64F, 64F
- * 1. request 4 blocks: each (64-N) bytes, indeed 64-byte allocated
- * 2. verify no more free blocks, any further allocation failed
- */
- for (int i = 0; i < BLK_NUM_MAX; i++) {
- block[i] = k_malloc(BLK_SIZE_EXCLUDE_DESC);
- zassert_not_null(block[i], NULL);
- }
- /* verify no more free blocks available*/
- block_fail = k_malloc(BLK_SIZE_MIN);
- zassert_is_null(block_fail, NULL);
-
- /* test case tear down*/
- for (int i = 0; i < BLK_NUM_MAX; i++) {
- k_free(block[i]);
- }
-}
-
-#define NMEMB 8
-#define SIZE 16
-/**
- * @brief Verify a region would be released back to
- * heap memory pool using k_free function.
- *
- * @ingroup kernel_heap_tests
- *
- * @see k_calloc(), k_free()
- */
-void test_mheap_block_release(void)
-{
- void *block[4 * BLK_NUM_MAX], *block_fail;
- int nb;
-
- /**
- * TESTPOINT: When the blocks in the heap memory pool are free by
- * the function k_free, the region would be released back to the
- * heap memory pool.
- */
- for (nb = 0; nb < ARRAY_SIZE(block); nb++) {
- /**
- * TESTPOINT: This routine provides traditional malloc()
- * semantics. Memory is allocated from the heap memory pool.
- */
- block[nb] = k_calloc(NMEMB, SIZE);
- if (block[nb] == NULL) {
- break;
- }
- }
-
- /* verify no more free blocks available*/
- block_fail = k_calloc(NMEMB, SIZE);
- zassert_is_null(block_fail, NULL);
-
- k_free(block[0]);
-
- /* one free block is available*/
- block[0] = k_calloc(NMEMB, SIZE);
- zassert_not_null(block[0], NULL);
-
- for (int i = 0; i < nb; i++) {
- /**
- * TESTPOINT: This routine provides traditional free()
- * semantics. The memory being returned must have been allocated
- * from the heap memory pool.
- */
- k_free(block[i]);
- }
- /** TESTPOINT: If ptr is NULL, no operation is performed.*/
- k_free(NULL);
-}