Repository navigation
Split whTest_Flash() out of the NVM flash tests - #559
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the standalone flash-test extraction.
No open issues 🎉
What changed in this PR
Separates the low-level flash driver test from the NVM flash suite so embedded targets can link it without pulling in 2 MB of RAM-simulation buffers.
Changes:
- Moves
whTest_Flash()unchanged into a standalone source file without a server guard. - Keeps the NVM suite’s RAM-simulator and POSIX-backend calls using the new header.
- Replaces the unimplemented
whTest_FlashCfg()declaration with the actualwhTest_Flash()API in the standalone header.
| File | Description |
|---|---|
test/wh_test_nvm_flash.h |
Removes the unimplemented whTest_FlashCfg() declaration. |
test/wh_test_nvm_flash.c |
Includes the new header and removes the extracted function body. |
test/wh_test_flash.h |
Declares the standalone flash test and documents its destructive behavior. |
test/wh_test_flash.c |
Houses the unchanged flash test independently of the NVM suite. |
Review effort: Balanced
kojiws
force-pushed
the
split-flash-test
branch
from
November 5, 2026 01:52
e60f04c to
dc4fdf1
Compare
bigbrett
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR supersedes #557.
whTest_Flash()checks a port'swhFlashCbflash driver and is meant to run on the target.It lived in
wh_test_nvm_flash.c, so linking it also pulled in that file's RAM-simulated flash: 2 MB of static buffers.That does not fit targets with small local RAM.
Changes
whTest_Flash()unchanged to newtest/wh_test_flash.c/test/wh_test_flash.h. It depends only onwh_flash.handwh_flash_unit.h, with no ramsim and no server guard.wh_test_nvm_flash.cincludes the new header and still callswhTest_Flash()on the ramsim and POSIX file backends.whTest_FlashCfg()prototype fromwh_test_nvm_flash.h. It had no implementation; ports now includewh_test_flash.hinstead.Testing
make runwithNOCRYPTO=1make runwithNOCRYPTO=1 ASAN=1 NVM_FLASH_CRC=1wh_test_flash.calone withwh_flash_unit.c,wh_flash_ramsim.cand a smallmain(), without server or client defines. It passes, and the only test symbol in the binary iswhTest_Flash.