zephyr/tests
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
..
application_development tests: fix test identifiers 2019-12-09 15:53:44 -05:00
arch arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
benchmarks test: benchmarkis add frdmk82f board config 2019-12-19 12:55:18 -05:00
bluetooth Bluetooth: L2CAP: Make channel ops const 2019-12-19 11:28:24 +02:00
boards drivers/flash: nios2_qspi add unaligned read test 2019-12-19 12:53:22 -05:00
crypto global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
drivers tests: spi_loopback: Add rv32m1 configuration 2019-12-20 17:06:10 +01:00
kernel test_pipe_contexts: fix mempool size issue and async pipe coverage 2019-12-20 20:43:01 -05:00
lib global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
misc/test_build tests: fix test identifiers 2019-12-09 15:53:44 -05:00
net samples & tests: Correct main() type 2019-12-16 11:27:56 +01:00
portability tests: samples: portability: fix test tags and identifiers 2019-12-09 15:53:44 -05:00
posix global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
shell tests: fix test identifiers 2019-12-09 15:53:44 -05:00
subsys logging: Fix false strdup buffer freeing 2019-12-20 08:49:01 -05:00
unit tests: unit: util: Add test for IF_ENABLED() 2019-12-18 08:14:52 -05:00
ztest subsys/testsuite: make tc_util overridable 2019-09-17 07:11:33 +08:00