zephyr/tests/kernel
Andy Ross 987658dcee tests/kernel: Fill allocation robustly for mpool heap backend
These five tests (mbox_api, mheap_api_concept, msgq_api, pipe_api and
queue) all had test cases where they needed a mem_pool allocation to
FAIL.  And they are all written to assume the behavior of the original
allocator and not the more general k_heap code, which actually
succeeds in a bunch of these cases.

* Even a very small heap saves enough metadata memory for the very
  small minimum block size, and this can be re-used as an allocation.
  So you can't assume a small heap is full.

* Calculating the number of blocks based on "num_blocks * max size /
  minimum size" and allocating them does not fill the heap, because
  the conservative metadata reservation leaves some space left over.

So these have all been modified to "fill" a heap by iteratively
allocating until failure.

Also, this fixes a benign overrun bug in mbox.  The test code would
insert a "big" message by reading past the end of the small message
buffer.  This didn't fail because it happened to be part of an array
of messages and the other ones defined contained the memory read.  But
still.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
..
common
context
device
early_sleep
fatal
fifo
fp_sharing
gen_isr_table
interrupt
lifo
mbox tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
mem_heap/mheap_api_concept tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
mem_pool tests/kernel/mem_pool: Split out tests for legacy mem_pool config 2020-04-14 10:05:55 -07:00
mem_protect
mem_slab
mp
msgq/msgq_api tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
mutex
obj_tracing
pending kernel: remove unused offload workqueue option 2020-04-12 18:42:27 -04:00
pipe tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
poll
profiling/profiling_api
queue tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
sched
semaphore/semaphore
sleep
smp
spinlock
stack/stack
threads
tickless
timer
workq tests: critical: change doxygen group 2020-04-12 18:42:27 -04:00
xip