From ee0ca47aa29bfda4c0fa89b7bda74220b2a22cdc Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Fri, 21 Oct 2022 16:51:01 -0700 Subject: [PATCH] Run (most) common tests against the custom RNG Signed-off-by: Joe Richey --- tests/common/mod.rs | 1 + tests/custom.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 006f230..fecbbdf 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -13,6 +13,7 @@ fn test_zero() { } #[test] +#[cfg(not(feature = "custom"))] fn test_diff() { let mut v1 = [0u8; 1000]; getrandom_impl(&mut v1).unwrap(); diff --git a/tests/custom.rs b/tests/custom.rs index 477b024..4f9cb80 100644 --- a/tests/custom.rs +++ b/tests/custom.rs @@ -7,8 +7,6 @@ ))] use wasm_bindgen_test::wasm_bindgen_test as test; -#[cfg(feature = "test-in-browser")] -wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); use core::num::NonZeroU32; use getrandom::{getrandom, register_custom_getrandom, Error}; @@ -33,6 +31,9 @@ fn super_insecure_rng(buf: &mut [u8]) -> Result<(), Error> { register_custom_getrandom!(super_insecure_rng); +use getrandom::getrandom as getrandom_impl; +mod common; + #[test] fn custom_rng_output() { let mut buf = [0u8; 4];