Add additional host based unit tests for MediaClear functions in the Nvme Media Sanitize Unit tests + fix a few more errors in the unit test#12426
Open
spbrogan wants to merge 4 commits intotianocore:masterfrom
Conversation
8a5a1eb to
25cabb5
Compare
3 tasks
Add tests for MediaClear functions in the Nvme Media Sanitize Unit tests Signed-off-by: Sean Brogan <sebrogan@microsoft.com>
NamespaceData was allocated, zeroed, and never modifed. Then it was copied over another buffer that was already zero. Then it was leaked. Remove local variable NamespaceData and the associated code. Signed-off-by: Sean Brogan <sebrogan@microsoft.com>
LastBlock field is inclusive. To lower confusion it should be initialized to the intended value which was to create metadata for an 8mb disk. Signed-off-by: Sean Brogan <sebrogan@microsoft.com>
25cabb5 to
764db5e
Compare
Signed-off-by: Sean Brogan <sebrogan@microsoft.com>
mikebeaton
reviewed
Apr 10, 2026
| Device->Media.BlockSize = (UINT32)(1 << 9); // 512 byte sector size | ||
|
|
||
| Device->Media.LastBlock = 0x4000; // NamespaceData=>Nsze | ||
| Device->Media.LastBlock = 0x3FFF; |
Member
There was a problem hiding this comment.
Assuming the original comment made some sense, you could just append - 1 to the comment text and keep it?
Member
Author
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 adds test cases for two bugs found in the NVME driver.
#12396
#12397
How This Was Tested
These are tests. Running CI will run the host based tests.
Integration Instructions
N/A