Skip to content

Commit 7bab247

Browse files
committed
Test RDRAND on x86/x86_64
Signed-off-by: Joe Richey <[email protected]>
1 parent 14ba262 commit 7bab247

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
@@ -411,3 +411,6 @@ pub fn getrandom_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error
411411
not(all(target_family = "wasm", target_os = "unknown", feature = "custom"))
412412
))]
413413
pub(crate) mod tests;
414+
// TODO: Remove this hack when rdrand is part of the public API
415+
#[cfg(all(test, any(target_arch = "x86_64", target_arch = "x86")))]
416+
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)