diff --git a/src/distributions/exponential.rs b/src/distributions/exponential.rs index bbdebacab71..b246c3502b1 100644 --- a/src/distributions/exponential.rs +++ b/src/distributions/exponential.rs @@ -107,7 +107,6 @@ mod test { let mut rng = ::test::rng(221); for _ in 0..1000 { assert!(exp.sample(&mut rng) >= 0.0); - assert!(exp.sample(&mut rng) >= 0.0); } } #[test] diff --git a/src/distributions/gamma.rs b/src/distributions/gamma.rs index f9dbbb96139..361e12ed6a2 100644 --- a/src/distributions/gamma.rs +++ b/src/distributions/gamma.rs @@ -318,7 +318,6 @@ mod test { let mut rng = ::test::rng(201); for _ in 0..1000 { chi.sample(&mut rng); - chi.sample(&mut rng); } } #[test] @@ -327,7 +326,6 @@ mod test { let mut rng = ::test::rng(202); for _ in 0..1000 { chi.sample(&mut rng); - chi.sample(&mut rng); } } #[test] @@ -336,7 +334,6 @@ mod test { let mut rng = ::test::rng(203); for _ in 0..1000 { chi.sample(&mut rng); - chi.sample(&mut rng); } } #[test] @@ -351,7 +348,6 @@ mod test { let mut rng = ::test::rng(204); for _ in 0..1000 { f.sample(&mut rng); - f.sample(&mut rng); } } @@ -361,7 +357,6 @@ mod test { let mut rng = ::test::rng(205); for _ in 0..1000 { t.sample(&mut rng); - t.sample(&mut rng); } } } diff --git a/src/distributions/integer.rs b/src/distributions/integer.rs index 8bac2bbfdfd..6b3a903bedf 100644 --- a/src/distributions/integer.rs +++ b/src/distributions/integer.rs @@ -108,3 +108,31 @@ impl Distribution for Uniform { ((rng.next_u64() as u128) << 64) | (rng.next_u64() as u128) } } + + +#[cfg(test)] +mod tests { + use Rng; + use distributions::{Uniform}; + + #[test] + fn test_integers() { + let mut rng = ::test::rng(806); + + rng.sample::(Uniform); + rng.sample::(Uniform); + rng.sample::(Uniform); + rng.sample::(Uniform); + rng.sample::(Uniform); + #[cfg(feature = "i128_support")] + rng.sample::(Uniform); + + rng.sample::(Uniform); + rng.sample::(Uniform); + rng.sample::(Uniform); + rng.sample::(Uniform); + rng.sample::(Uniform); + #[cfg(feature = "i128_support")] + rng.sample::(Uniform); + } +} diff --git a/src/distributions/normal.rs b/src/distributions/normal.rs index bd3ba24d463..089cb9046d5 100644 --- a/src/distributions/normal.rs +++ b/src/distributions/normal.rs @@ -167,7 +167,6 @@ mod tests { let mut rng = ::test::rng(210); for _ in 0..1000 { norm.sample(&mut rng); - norm.sample(&mut rng); } } #[test] @@ -183,7 +182,6 @@ mod tests { let mut rng = ::test::rng(211); for _ in 0..1000 { lnorm.sample(&mut rng); - lnorm.sample(&mut rng); } } #[test] diff --git a/src/distributions/other.rs b/src/distributions/other.rs index 75cf2f20465..873043addac 100644 --- a/src/distributions/other.rs +++ b/src/distributions/other.rs @@ -113,3 +113,17 @@ impl Distribution> for Uniform where Uniform: Distribution { } } } + + +#[cfg(test)] +mod tests { + use {Rng, RngCore, Uniform}; + + #[test] + fn test_misc() { + let mut rng: &mut RngCore = &mut ::test::rng(820); + + rng.sample::(Uniform); + rng.sample::(Uniform); + } +}