Merged
Conversation
Copilot created this pull request from a session on behalf of
julian-klode
April 7, 2026 18:26
View session
ca88cdb to
0d293f9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an in-file unit test suite to lace-util’s PE parsing module (peimage.rs) to exercise parsing, section iteration, relocation, and error formatting paths for PE64 images.
Changes:
- Introduces a
build_pehelper to construct minimal PE64 byte images for tests usingzerocopy::IntoBytes. - Adds unit tests for
parse_pe,SectionHeader::name, section iterators,relocate_into, andPeErrordisplay strings. - Adds targeted header corruption in tests via
offset_of!to hit specific error branches.
Agent-Logs-Url: https://github.com/canonical/lace/sessions/58459055-4e10-4849-9eff-cdfd637c915f Co-authored-by: julian-klode <6325588+julian-klode@users.noreply.github.com>
6305b48 to
e5ab3e9
Compare
julian-klode
approved these changes
Apr 7, 2026
Contributor
julian-klode
left a comment
There was a problem hiding this comment.
Well this is somewhat ok, I'd love some integration tests but also end-to-end boot integration tests will cover that so, this is enough perhaps
kukrimate
approved these changes
Apr 8, 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.
build_pedoc comment (inaccurate statement about virtual section data)test_virtual_sections_correct_data— verify iterator returnsOkwith correct data when VA is in-boundstest_virtual_sections_out_of_bounds_returns_truncated— assert in-bounds case first, then corrupttest_relocate_into_success— pre-fillpageswith0xAAso the zero-fill assertion is meaningful