Run (most) common tests against the custom RNG
Signed-off-by: Joe Richey <joerichey@google.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
+3
-2
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user