Skip to content

Commit

Permalink
random/tests: Small improvements
Browse files Browse the repository at this point in the history
Merges: #70
  • Loading branch information
chrysn authored Nov 25, 2023
2 parents 47191d6 + 4f22e83 commit c734c72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/random/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ crate-type = ["staticlib"]
panic = "abort"

[dependencies]
riot-wrappers = { version = "*", features = [ "set_panic_handler" ] }
riot-wrappers = { version = "*", features = [ "set_panic_handler", "panic_handler_format" ] }
rand_core = "0.6"
rngcheck = "0.1.1"
5 changes: 3 additions & 2 deletions tests/random/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ riot_main!(main);
fn check_csrng(mut rng: impl rand_core::CryptoRng + rand_core::RngCore) {
use rngcheck::{helpers::*, nist::*};

// This is also in https://github.com/ryankurte/rngcheck/pull/3
struct BitIter<'a, R: rand_core::RngCore> {
rng: &'a mut R,
remaining: usize,
Expand Down Expand Up @@ -62,8 +63,8 @@ fn check_csrng(mut rng: impl rand_core::CryptoRng + rand_core::RngCore) {
nist_freq_block(BitIter::new(&mut rng, count), 16).unwrap()
);

println!("Generating 10 more random numbers");
for _ in 0..10 {
println!("Generating 3 more random numbers");
for _ in 0..3 {
println!("{}", rng.next_u32());
}

Expand Down

0 comments on commit c734c72

Please sign in to comment.