forked from M-Labs/nalgebra
Fix deprecated suffixes in tests
This commit is contained in:
parent
b805f9d829
commit
744e9782fc
14
tests/mat.rs
14
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<f64> = na::one();
|
||||
let ang = Vec1::new(na::abs(&random::<f64>()) % <f64 as BaseFloat>::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<f64> = na::one();
|
||||
let dir: Vec3<f64> = random();
|
||||
let ang = na::normalize(&dir) * (na::abs(&random::<f64>()) % <f64 as BaseFloat>::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));
|
||||
|
@ -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<f64> = 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<f64> = random();
|
||||
let vec: Vec3<f64> = random();
|
||||
let pnt: Pnt3<f64> = 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<f64> = random();
|
||||
let axis_angle2: Vec3<f64> = 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<f64> = 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<f64> = random();
|
||||
|
||||
let q = UnitQuat::new_with_euler_angles(angles.x, angles.y, angles.z);
|
||||
|
12
tests/vec.rs
12
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<f64> = random();
|
||||
let v2 : Vec3<f64> = random();
|
||||
let v3 : Vec3<f64> = na::cross(&v1, &v2);
|
||||
|
Loading…
Reference in New Issue
Block a user