Skip to content

Commit 6238ad6

Browse files
committed
Test RDRAND on x86/x86_64
Signed-off-by: Joe Richey <[email protected]>
1 parent f92ad31 commit 6238ad6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,3 +408,6 @@ pub fn getrandom_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error
408408
// Don't run normal unit tests when testing custom getrandom
409409
#[cfg(all(test, not(feature = "custom")))]
410410
pub(crate) mod tests;
411+
// TODO: Remove this hack when rdrand is part of the public API
412+
#[cfg(all(test, any(target_arch = "x86_64", target_arch = "x86")))]
413+
mod rdrand;

src/rdrand.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,8 @@ unsafe fn rdrand_exact(dest: &mut [MaybeUninit<u8>]) -> Option<()> {
121121
}
122122
Some(())
123123
}
124+
125+
#[cfg(test)]
126+
mod tests {
127+
crate::tests::define_tests!(super::getrandom_inner);
128+
}

0 commit comments

Comments
 (0)