u-boot/test
Simon Glass 67bc59df05 Add support for an owned buffer
When passing a data buffer back from a function, it is not always clear
who owns the buffer, i.e. who is responsible for freeing the memory used.
An example of this is where multiple files are decompressed from the
firmware image, using a temporary buffer for reading (since the
compressed data has to live somewhere) and producing a temporary or
permanent buffer with the resuilts.

Where the firmware image can be memory-mapped, as on x86, the compressed
data does not need to be buffered, but the complexity of having a buffer
which is either allocated or not, makes the code hard to understand.

Introduce a new 'abuf' which supports simple buffer operations:

- encapsulating a buffer and its size
- either allocated with malloc() or not
- able to be reliably freed if necessary
- able to be converted to an allocated buffer if needed

This simple API makes it easier to deal with allocated and memory-mapped
buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-10-08 15:53:26 -04:00
..
cmd test: cmd: setexpr: add format string tests 2021-07-27 17:56:13 -04:00
common sandbox: Reduce keyed autoboot delay 2021-08-01 09:05:24 -06:00
dm clk: k210: Try harder to get the best config 2021-10-07 16:08:23 +08:00
env sandbox: add test of CONFIG_ENV_IMPORT_FDT 2021-05-04 12:52:30 -04:00
fs Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
image sandbox: Support executables for more phases 2021-07-21 10:27:34 -06:00
lib Add support for an owned buffer 2021-10-08 15:53:26 -04:00
log log: Allow padding of the function name 2021-07-21 10:27:35 -06:00
optee test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
overlay test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
py test: Allow tpm2 tests to run in parallel 2021-10-05 08:50:15 -04:00
stdint Remove <inttypes.h> includes and PRI* usages in printf() entirely 2018-09-10 20:48:17 -04:00
trace SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bloblist.c test: Tidy a comment in the bloblist test 2021-09-16 13:19:25 -04:00
bootm.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
cmd_ut.c test: add first autoboot unit tests 2021-07-23 13:36:20 -04:00
command_ut.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
common.sh Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
compression.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
Kconfig lib: add crypt subsystem 2021-07-23 13:36:14 -04:00
Makefile test: add first autoboot unit tests 2021-07-23 13:36:20 -04:00
nokia_rx51_test.sh Nokia RX-51: Add check for /lib/ld-linux.so.2 in test script 2021-07-15 17:56:05 +05:30
print_ut.c version: Move version_string[] from version.h to version_string.h 2021-09-17 12:10:44 -04:00
run test: Run sandbox_spl tests on sandbox_noinst 2021-03-26 17:03:09 +13:00
str_ut.c lib: Allow using 0x when a decimal value is requested 2021-08-02 13:32:14 -04:00
test-main.c test: Avoid a build error with SPL 2021-07-21 10:27:34 -06:00
time_ut.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
unicode_ut.c Prepare v2021.04-rc4 2021-03-15 12:15:38 -04:00
ut.c test: Add a way to skip console checking until a string matches 2021-09-16 14:39:40 -04:00