zephyr/tests/lib
Nicolas Pitre 1e52b1123e tests/lib/heap_align: improve test
Many issues:

- heapmem[] is of type uint64_t meaning that it contains HEAP_SZ * 16
  bytes but the heap is initialized with only 1/16 of that, making
  this test's memory footprint way too large.

- The test to ensure the heap is empty uses an allocation size of
  (heap_end - heap_start - 8) which is wrong as heap_end and heap_start
  are uint64_t pointer types and therefore their difference will be 8x
  smaller than intended. Furthermore, the 8 here is unnessary as the
  chunk header size is already included in the location of heap_start.

- The heap start address misalignment bare no purpose as the misaligned
  start of the free heap is already controlled by the variable prefix
  allocation size.

- Alignment and sizes should rather be expressed in terms of size_t
  rather than uintptr_t.

Fix those issues, and add a few more test angles:

- Make the prefix allocation itterate across the entire alignment range
  to exercize all possible misalignments.

- Vary the aligned allocation size to better exercize the pre-alignment
  allocation and suffix handling.

- Double the aligned allocation to add more variability in the heap
  structure.

- Test the testing of emptiness by making sure that no more allocations
  are possible when we think we allocated it all.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-06-28 23:43:42 -04:00
..
c_lib tests: lib: Add some new test cases for libc 2020-06-23 22:42:25 -04:00
cmsis_dsp zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
devicetree zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
fdtable tests: make find_package(Zephyr...) REQUIRED 2020-05-29 10:47:25 +02:00
gui/lvgl zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
heap zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
heap_align tests/lib/heap_align: improve test 2020-06-28 23:43:42 -04:00
json zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mem_alloc tests: make find_package(Zephyr...) REQUIRED 2020-05-29 10:47:25 +02:00
notify zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
onoff zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
ringbuffer tests: ringbuffer modify a tesecase 2020-06-16 16:55:51 +02:00
sprintf zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00