Skip to content

Commit

Permalink
Test RDRAND on x86/x86_64
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Richey <[email protected]>
  • Loading branch information
josephlr committed Jun 19, 2024
1 parent 14ba262 commit 7bab247
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,6 @@ pub fn getrandom_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error
not(all(target_family = "wasm", target_os = "unknown", feature = "custom"))
))]
pub(crate) mod tests;
// TODO: Remove this hack when rdrand is part of the public API
#[cfg(all(test, any(target_arch = "x86_64", target_arch = "x86")))]
mod rdrand;
5 changes: 5 additions & 0 deletions src/rdrand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ unsafe fn rdrand_exact(dest: &mut [MaybeUninit<u8>]) -> Option<()> {
}
Some(())
}

#[cfg(test)]
mod tests {
crate::tests::define_tests!(super::getrandom_inner);
}

0 comments on commit 7bab247

Please sign in to comment.