zephyr/tests/kernel
Nicolas Pitre 11a1ae5f7a test_pipe_contexts: fix mempool size issue and async pipe coverage
The minimum possible mempool block size is either 8 or 16 for 32-bit or
64-bit targets respectively. Defining BYTES_TO_WRITE to 4 and using that
with K_MEM_POOL_DEFINE() won't produce the expected result i.e. only 1
block at any time could be allocated instead of 4.

Yet, the test does run successfully regardless of the block allocation
loop in tpipe_block_put().

It turns out that the pipe buffer is large enough to consume all the
block data synchronously, meaning that the mempool block is freed right
away and available for the next loop iteration. This also means that the
asynchronous delivery mechanism is never exercized.

Fix both issues by defining PIPE_LEN and BYTES_TO_WRITE in terms of
_MPOOL_MINBLK with the expected factor of 4, and adding a new test
using the half-sized pipe where the pipe buffer gets saturated and
mempool memory blocks are actually queued for asynchronous consumption.

The source data string has to be extended to accommodate larger pipe
sizes too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-12-20 20:43:01 -05:00
..
common global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
context tests: fix test identifiers 2019-12-09 15:53:44 -05:00
critical tests: fix test identifiers 2019-12-09 15:53:44 -05:00
device kernel: init: provide access to kernel startup state 2019-12-11 14:45:40 -08:00
early_sleep tests: fix test identifiers 2019-12-09 15:53:44 -05:00
fatal headers: Refactor kernel and arch headers. 2019-11-06 16:07:32 -08:00
fifo tests: fifo: assert of NULL from k_fifo_get 2019-12-10 10:39:59 -05:00
fp_sharing arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
gen_isr_table arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
interrupt arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
lifo kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
mbox tests: new updated names for the kernel tests 2019-10-24 06:25:53 -04:00
mem_heap/mheap_api_concept malloc: make sure returned memory is properly aligned 2019-07-03 14:17:29 -07:00
mem_pool global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
mem_protect arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
mem_slab global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
mp kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
msgq/msgq_api tests: adjust resource pool sizes for 64-bit 2019-12-12 14:48:42 -08:00
mutex tests: fix test identifiers 2019-12-09 15:53:44 -05:00
obj_tracing tests: obj tracing: fix counting 2019-12-10 10:40:16 -05:00
pending global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
pipe test_pipe_contexts: fix mempool size issue and async pipe coverage 2019-12-20 20:43:01 -05:00
poll tests: adjust resource pool sizes for 64-bit 2019-12-12 14:48:42 -08:00
profiling/profiling_api tests: fix test identifiers 2019-12-09 15:53:44 -05:00
queue tests: queue: fix SMP issue 2019-12-18 11:17:33 -08:00
sched global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
semaphore/semaphore tests: semaphore: consolidate semaphore tests 2019-11-15 08:04:52 -05:00
sleep tests: fix test identifiers 2019-12-09 15:53:44 -05:00
smp kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
spinlock kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
stack/stack tests: stack: consolidate tests 2019-11-15 08:04:52 -05:00
threads tests: thread_init: disable SMP 2019-12-18 11:17:33 -08:00
tickless kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
timer tests/kernel: timer_api: Enable Test userspace 2019-12-09 16:40:07 +01:00
workq kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
xip x86: fix XIP SOC support and defaults 2019-09-11 21:11:38 -04:00