From 744e9782fcf7ef869a9d8d838dd263afa2b8f65a Mon Sep 17 00:00:00 2001 From: Jameson Ernst Date: Sat, 28 Feb 2015 16:49:12 -0800 Subject: [PATCH] Fix deprecated suffixes in tests --- tests/mat.rs | 14 +++++++------- tests/quat.rs | 10 +++++----- tests/vec.rs | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/mat.rs b/tests/mat.rs index b107d504..764b9c75 100644 --- a/tests/mat.rs +++ b/tests/mat.rs @@ -7,7 +7,7 @@ use na::{Vec1, Vec3, Mat1, Mat2, Mat3, Mat4, Mat5, Mat6, Rot3, Persp3, PerspMat3 macro_rules! test_inv_mat_impl( ($t: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let randmat : $t = random(); match na::inv(&randmat) { @@ -20,7 +20,7 @@ macro_rules! test_inv_mat_impl( macro_rules! test_transpose_mat_impl( ($t: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let randmat : $t = random(); assert!(na::transpose(&na::transpose(&randmat)) == randmat); @@ -30,7 +30,7 @@ macro_rules! test_transpose_mat_impl( macro_rules! test_qr_impl( ($t: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let randmat : $t = random(); let (q, r) = na::qr(&randmat); @@ -44,7 +44,7 @@ macro_rules! test_qr_impl( // NOTE: deactivated untile we get a better convergence rate. // macro_rules! test_eigen_qr_impl( // ($t: ty) => { -// for _ in (0us .. 10000) { +// for _ in (0usize .. 10000) { // let randmat : $t = random(); // // Make it symetric so that we can recompose the matrix to test at the end. // let randmat = na::transpose(&randmat) * randmat; @@ -126,7 +126,7 @@ fn test_inv_mat6() { #[test] fn test_rotation2() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let randmat: na::Rot2 = na::one(); let ang = Vec1::new(na::abs(&random::()) % ::pi()); @@ -143,7 +143,7 @@ fn test_index_mat2() { #[test] fn test_inv_rotation3() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let randmat: Rot3 = na::one(); let dir: Vec3 = random(); let ang = na::normalize(&dir) * (na::abs(&random::()) % ::pi()); @@ -251,7 +251,7 @@ fn test_dmat_from_vec() { /* FIXME: review qr decomposition to make it work with DMat. #[test] fn test_qr() { - for _ in (0us .. 10) { + for _ in (0usize .. 10) { let dim1: usize = random(); let dim2: usize = random(); let rows = min(40, max(dim1, dim2)); diff --git a/tests/quat.rs b/tests/quat.rs index 2751fbbe..00375dcf 100644 --- a/tests/quat.rs +++ b/tests/quat.rs @@ -6,7 +6,7 @@ use rand::random; #[test] fn test_quat_as_mat() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let axis_angle: Vec3 = random(); assert!(na::approx_eq(&UnitQuat::new(axis_angle).to_rot(), &Rot3::new(axis_angle))) @@ -15,7 +15,7 @@ fn test_quat_as_mat() { #[test] fn test_quat_mul_vec_or_pnt_as_mat() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let axis_angle: Vec3 = random(); let vec: Vec3 = random(); let pnt: Pnt3 = random(); @@ -32,7 +32,7 @@ fn test_quat_mul_vec_or_pnt_as_mat() { #[test] fn test_quat_div_quat() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let axis_angle1: Vec3 = random(); let axis_angle2: Vec3 = random(); @@ -48,7 +48,7 @@ fn test_quat_div_quat() { #[test] fn test_quat_to_axis_angle() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let axis_angle: Vec3 = random(); let q = UnitQuat::new(axis_angle); @@ -60,7 +60,7 @@ fn test_quat_to_axis_angle() { #[test] fn test_quat_euler_angles() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let angles: Vec3 = random(); let q = UnitQuat::new_with_euler_angles(angles.x, angles.y, angles.z); diff --git a/tests/vec.rs b/tests/vec.rs index 087026e2..60642842 100644 --- a/tests/vec.rs +++ b/tests/vec.rs @@ -6,7 +6,7 @@ use na::{Vec0, Vec1, Vec2, Vec3, Vec4, Vec5, Vec6, Mat3, Iterable, IterableMut}; macro_rules! test_iterator_impl( ($t: ty, $n: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let v: $t = random(); let mut mv: $t = v.clone(); let n: $n = random(); @@ -24,7 +24,7 @@ macro_rules! test_iterator_impl( macro_rules! test_commut_dot_impl( ($t: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let v1 : $t = random(); let v2 : $t = random(); @@ -35,7 +35,7 @@ macro_rules! test_commut_dot_impl( macro_rules! test_scalar_op_impl( ($t: ty, $n: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let v1 : $t = random(); let n : $n = random(); @@ -58,7 +58,7 @@ macro_rules! test_scalar_op_impl( macro_rules! test_basis_impl( ($t: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { na::canonical_basis(|e1: $t| { na::canonical_basis(|e2: $t| { assert!(e1 == e2 || na::approx_eq(&na::dot(&e1, &e2), &na::zero())); @@ -76,7 +76,7 @@ macro_rules! test_basis_impl( macro_rules! test_subspace_basis_impl( ($t: ty) => ( - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let v : $t = random(); let v1 = na::normalize(&v); @@ -100,7 +100,7 @@ macro_rules! test_subspace_basis_impl( #[test] fn test_cross_vec3() { - for _ in (0us .. 10000) { + for _ in (0usize .. 10000) { let v1 : Vec3 = random(); let v2 : Vec3 = random(); let v3 : Vec3 = na::cross(&v1, &v2);