zephyr/tests/kernel/queue/src
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
..
main.c tests: queue: fix SMP issue 2019-12-18 11:17:33 -08:00
test_queue_contexts.c tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
test_queue_fail.c timeout: Fix up API usage 2020-03-31 19:40:47 -04:00
test_queue_loop.c coccinelle: standardize k_thread create/define calls with integer timeouts 2019-10-09 08:38:10 -04:00
test_queue_user.c coccinelle: standardize k_thread create/define calls with integer timeouts 2019-10-09 08:38:10 -04:00
test_queue.h tests: queue: test k_queue_alloc_*pend() 2019-06-18 09:08:01 -04:00