[RFC PATCH 11/20] test: boot: add image_loader unit tests

Tom Rini trini at konsulko.com
Tue Feb 17 20:05:54 CET 2026


On Mon, Feb 16, 2026 at 09:22:59PM +0000, Daniel Golle wrote:

> Add unit tests for the image_loader framework covering its core
> logic with a mock storage backend:
> 
> - map() allocates, reads and records a region
> - map() returns cached pointer for already-mapped range
> - map() returns correct offset within a larger region
> - map() re-reads when extending a region to a larger size
> - map_to() reads to a specified address and records it
> - lookup() returns NULL for unmapped ranges
> - alloc_ptr advances with correct alignment
> - map() returns NULL when the translation table is full
> - cleanup() calls backend and resets state
> - map() with multiple disjoint regions
> - read beyond image size returns error
> 
> Also fix IMAGE_LOADER_MAX_REGIONS Kconfig to depend on IMAGE_LOADER
> and default to 16 unconditionally (the previous 'default 0' fallback
> caused the regions array to be zero-sized when IMAGE_LOADER was
> enabled after initial defconfig generation).

Since this is introduced earlier in the series, it should just be done
correctly to start with. The bias in me wants to say the AI didn't catch
this and should have.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260217/eaf1d543/attachment.sig>


More information about the U-Boot mailing list