Skip to content

Commit

Permalink
Merge pull request #19 from EmbarkStudios/rand
Browse files Browse the repository at this point in the history
Update rand 0.7 & criterion 0.4 and disable OS random number generator
  • Loading branch information
bitshifter authored Sep 14, 2019
2 parents 10d30cc + a89197d commit 516e11a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ transform-types = []
# TODO: make this dev only
approx = { version = "0.3", optional = true, default-features = false }
mint = { version = "0.5", optional = true, default-features = false }
rand = { version = "0.6", optional = true }
rand = { version = "0.7", optional = true, default-features = false }
serde = { version = "1.0", optional = true, features = ["derive"] }

[dev-dependencies]
criterion = "0.2"
rand_xoshiro = "0.1"
criterion = "0.3"
rand_xoshiro = "0.4"
serde_json = "1.0"

[[bench]]
Expand Down
7 changes: 5 additions & 2 deletions tests/angle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use approx::assert_ulps_eq;
use glam::f32::{deg, rad, Angle};
use std::f32::consts;
#[cfg(feature = "rand")]
use rand::{Rng, SeedableRng};
#[cfg(feature = "rand")]
use rand_xoshiro::Xoshiro256Plus;

#[test]
fn test_angle() {
Expand Down Expand Up @@ -47,8 +51,7 @@ fn test_angle() {
#[cfg(feature = "rand")]
#[test]
fn test_angle_rnd() {
use rand::Rng;
let mut rng = rand::thread_rng();
let mut rng = Xoshiro256Plus::seed_from_u64(0);
let a: Angle = rng.gen();
assert!(a >= rad(0.0));
assert!(a < rad(std::f32::consts::PI * 2.0));
Expand Down

0 comments on commit 516e11a

Please sign in to comment.