tests: re-add all disabled tests and all disabled configurations

This commit is contained in:
Felipe Neves
2020-09-24 17:25:52 -03:00
committed by Angus Gratton
parent 206540909e
commit 3057b76a7e
22 changed files with 40 additions and 225 deletions
+1 -1
View File
@@ -598,7 +598,7 @@ IRAM_ATTR void *heap_caps_aligned_alloc(size_t alignment, size_t size, int caps)
return NULL;
}
void heap_caps_aligned_free(void *ptr)
IRAM_ATTR void heap_caps_aligned_free(void *ptr)
{
heap_caps_free(ptr);
}
-3
View File
@@ -124,9 +124,6 @@ void *heap_caps_aligned_alloc(size_t alignment, size_t size, int caps);
* @brief Used to deallocate memory previously allocated with heap_caps_aligned_alloc
*
* @param ptr Pointer to the memory allocated
* @note This function is aimed to deallocate only memory allocated with
* heap_caps_aligned_alloc, memory allocated with heap_caps_malloc
* MUST not be passed to this function
* @note This function is deprecated, plase consider using heap_caps_free() instead
*/
void __attribute__((deprecated)) heap_caps_aligned_free(void *ptr);
+2 -2
View File
@@ -236,10 +236,10 @@ void *multi_heap_realloc_impl(multi_heap_handle_t heap, void *p, size_t size)
}
multi_heap_internal_lock(heap);
heap->free_bytes += tlsf_block_size(p);
size_t previous_block_size = tlsf_block_size(p);
void *result = tlsf_realloc(heap->heap_data, p, size);
if(result) {
heap->free_bytes += previous_block_size;
heap->free_bytes -= tlsf_block_size(result);
if (heap->free_bytes < heap->minimum_free_bytes) {
heap->minimum_free_bytes = heap->free_bytes;
-3
View File
@@ -162,8 +162,6 @@ TEST_CASE("heap_caps metadata test", "[heap]")
TEST_ASSERT(after.minimum_free_bytes < original.total_free_bytes);
}
#ifndef CONFIG_SPIRAM
/* Small function runs from IRAM to check that malloc/free/realloc
all work OK when cache is disabled...
*/
@@ -247,4 +245,3 @@ TEST_CASE("allocation with invalid capability should also trigger the alloc fail
(void)ptr;
}
#endif
+2 -2
View File
@@ -24,7 +24,7 @@ TEST_CASE("realloc shrink buffer in place", "[heap]")
#endif
#ifndef CONFIG_ESP32S2_MEMPROT_FEATURE
TEST_CASE("realloc shrink buffer with EXEC CAPS", "[heap][ignore]")
TEST_CASE("realloc shrink buffer with EXEC CAPS", "[heap]")
{
const size_t buffer_size = 64;
@@ -34,7 +34,7 @@ TEST_CASE("realloc shrink buffer with EXEC CAPS", "[heap][ignore]")
TEST_ASSERT(y);
//y needs to fall in a compatible memory area of IRAM:
TEST_ASSERT(esp_ptr_executable(y));
TEST_ASSERT(esp_ptr_executable(y)|| esp_ptr_in_iram(y) || esp_ptr_in_diram_iram(y));
free(y);
}
@@ -18,7 +18,7 @@
TEST_CASE("multi_heap simple allocations", "[multi_heap]")
{
uint8_t small_heap[10 * 1024];
uint8_t small_heap[4 * 1024];
multi_heap_handle_t heap = multi_heap_register(small_heap, sizeof(small_heap));
@@ -59,10 +59,10 @@ TEST_CASE("multi_heap simple allocations", "[multi_heap]")
TEST_CASE("multi_heap fragmentation", "[multi_heap]")
{
uint8_t small_heap[10 * 1024];
uint8_t small_heap[4 * 1024];
multi_heap_handle_t heap = multi_heap_register(small_heap, sizeof(small_heap));
const size_t alloc_size = 1350;
const size_t alloc_size = 128;
void *p[4];
for (int i = 0; i < 4; i++) {
@@ -92,7 +92,6 @@ TEST_CASE("multi_heap fragmentation", "[multi_heap]")
void *big = multi_heap_malloc(heap, alloc_size * 3);
//Blocks in TLSF are organized in different form, so this makes no sense
//REQUIRE( p[3] == big ); /* big should go where p[3] was freed from */
multi_heap_free(heap, big);
multi_heap_free(heap, p[2]);
@@ -103,7 +102,6 @@ TEST_CASE("multi_heap fragmentation", "[multi_heap]")
big = multi_heap_malloc(heap, alloc_size * 2);
//Blocks in TLSF are organized in different form, so this makes no sense
//REQUIRE( p[0] == big ); /* big should now go where p[0] was freed from */
multi_heap_free(heap, big);
}
@@ -111,7 +109,7 @@ TEST_CASE("multi_heap fragmentation", "[multi_heap]")
TEST_CASE("multi_heap defrag", "[multi_heap]")
{
void *p[4];
uint8_t small_heap[10 * 1024];
uint8_t small_heap[4 * 1024];
multi_heap_info_t info, info2;
multi_heap_handle_t heap = multi_heap_register(small_heap, sizeof(small_heap));
@@ -161,7 +159,7 @@ TEST_CASE("multi_heap defrag", "[multi_heap]")
TEST_CASE("multi_heap defrag realloc", "[multi_heap]")
{
void *p[4];
uint8_t small_heap[10 * 1024];
uint8_t small_heap[4 * 1024];
multi_heap_info_t info, info2;
multi_heap_handle_t heap = multi_heap_register(small_heap, sizeof(small_heap));
@@ -206,7 +204,7 @@ TEST_CASE("multi_heap defrag realloc", "[multi_heap]")
TEST_CASE("multi_heap many random allocations", "[multi_heap]")
{
uint8_t big_heap[64 * 1024];
uint8_t big_heap[8 * 1024];
const int NUM_POINTERS = 64;
printf("Running multi-allocation test...\n");
@@ -217,7 +215,7 @@ TEST_CASE("multi_heap many random allocations", "[multi_heap]")
const size_t initial_free = multi_heap_free_size(heap);
const int ITERATIONS = 100000;
const int ITERATIONS = 10000;
for (int i = 0; i < ITERATIONS; i++) {
/* check all pointers allocated so far are valid inside big_heap */
@@ -298,7 +296,7 @@ TEST_CASE("multi_heap many random allocations", "[multi_heap]")
TEST_CASE("multi_heap_get_info() function", "[multi_heap]")
{
uint8_t heapdata[10 * 1024];
uint8_t heapdata[4 * 1024];
multi_heap_handle_t heap = multi_heap_register(heapdata, sizeof(heapdata));
multi_heap_info_t before, after, freed;
@@ -394,7 +392,7 @@ TEST_CASE("multi_heap minimum-size allocations", "[multi_heap]")
TEST_CASE("multi_heap_realloc()", "[multi_heap]")
{
const uint32_t PATTERN = 0xABABDADA;
uint8_t small_heap[10 * 1024];
uint8_t small_heap[4 * 1024];
multi_heap_handle_t heap = multi_heap_register(small_heap, sizeof(small_heap));
uint32_t *a = (uint32_t *)multi_heap_malloc(heap, 64);
@@ -446,16 +444,11 @@ TEST_CASE("multi_heap_realloc()", "[multi_heap]")
#endif
}
//TEST_CASE("corrupt heap block", "[multi_heap]"), this
// test will crash since heap check failling will trigger
// an assert failure.
// TLSF only accepts heaps aligned to 4-byte boundary so
// unaligned test does not make sense
// only aligned allocation tests make sense.
TEST_CASE("multi_heap aligned allocations", "[multi_heap]")
{
uint8_t test_heap[1024 * 1024];
uint8_t test_heap[4 * 1024];
multi_heap_handle_t heap = multi_heap_register(test_heap, sizeof(test_heap));
uint32_t aligments = 0; // starts from alignment by 4-byte boundary
size_t old_size = multi_heap_free_size(heap);
@@ -466,7 +459,7 @@ TEST_CASE("multi_heap aligned allocations", "[multi_heap]")
multi_heap_dump(heap);
printf("*********************\n");
for(;aligments <= 128 * 1024; aligments++) {
for(;aligments <= 256; aligments++) {
//Use some stupid size value to test correct alignment even in strange
//memory layout objects: