Skip to content

Commit 4828506

Browse files
committed
Simplify reseeding::test_rng_fill_bytes
1 parent b4c7517 commit 4828506

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/reseeding.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,8 @@ mod test {
223223
let mut v = [0u8; FILL_BYTES_V_LEN];
224224
::test::rng(321).fill_bytes(&mut v);
225225

226-
// To test that `fill_bytes` actually did something, check that the
227-
// average of `v` is not 0.
228-
let mut sum = 0.0;
229-
for &x in v.iter() {
230-
sum += x as f64;
231-
}
232-
assert!(sum / v.len() as f64 != 0.0);
226+
// To test that `fill_bytes` actually did something, check that not all
227+
// bytes are zero.
228+
assert!(!v.iter().all(|&x| x == 0));
233229
}
234230
}

0 commit comments

Comments
 (0)