Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: Add unit tests for util.rs #153

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Conversation

Zildj1an
Copy link
Contributor

@Zildj1an Zildj1an commented Nov 9, 2023

Add unit tests to check correct behavior of auxiliary functions in util.rs.

Add unit tests to check correct behavior of auxiliary functions in util.rs.

Signed-off-by: Carlos Bilbao <[email protected]>
Copy link
Member

@00xc 00xc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just one suggestion below.

Comment on lines +82 to +83
let start = VirtAddr::new(&mut data[0] as *mut u8 as usize);
let end = start + 10;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let start = VirtAddr::new(&mut data[0] as *mut u8 as usize);
let end = start + 10;
let start = VirtAddr::from(data.as_mut_ptr());
let end = start + core::mem::size_of_val(&data);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zildj1an Please fix this with a follow-on PR.

@joergroedel joergroedel merged commit 7aa8bd2 into coconut-svsm:main Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants