Fix trailing commas in tests.

This commit is contained in:
sebcrozet 2020-04-05 20:36:26 +02:00
parent ed85d5418a
commit f782060e99
4 changed files with 20 additions and 13 deletions

View File

@ -75,13 +75,14 @@ quickcheck!(
)
}
#[cfg_attr(rustfmt, rustfmt_skip)]
fn composition2(
i: Isometry2<f64>,
uc: UnitComplex<f64>,
r: Rotation2<f64>,
t: Translation2<f64>,
v: Vector2<f64>,
p: Point2<f64>,
p: Point2<f64>
) -> bool {
// (rotation × translation) * point = rotation × (translation * point)
relative_eq!((uc * t) * v, uc * v, epsilon = 1.0e-7) &&
@ -112,13 +113,14 @@ quickcheck!(
relative_eq!((i * t) * p, i * (t * p), epsilon = 1.0e-7)
}
#[cfg_attr(rustfmt, rustfmt_skip)]
fn composition3(
i: Isometry3<f64>,
uq: UnitQuaternion<f64>,
r: Rotation3<f64>,
t: Translation3<f64>,
v: Vector3<f64>,
p: Point3<f64>,
p: Point3<f64>
) -> bool {
// (rotation × translation) * point = rotation × (translation * point)
relative_eq!((uq * t) * v, uq * v, epsilon = 1.0e-7) &&
@ -149,13 +151,14 @@ quickcheck!(
relative_eq!((i * t) * p, i * (t * p), epsilon = 1.0e-7)
}
#[cfg_attr(rustfmt, rustfmt_skip)]
fn all_op_exist(
i: Isometry3<f64>,
uq: UnitQuaternion<f64>,
t: Translation3<f64>,
v: Vector3<f64>,
p: Point3<f64>,
r: Rotation3<f64>,
r: Rotation3<f64>
) -> bool {
let iMi = i * i;
let iMuq = i * uq;

View File

@ -1,6 +1,5 @@
#![cfg(feature = "arbitrary")]
#![allow(non_snake_case)]
#![cfg_attr(rustfmt, rustfmt_skip)]
use na::{Point3, Quaternion, Rotation3, Unit, UnitQuaternion, Vector3};
@ -56,12 +55,12 @@ quickcheck!(
*
*/
#[cfg_attr(rustfmt, rustfmt_skip)]
fn unit_quaternion_transformation(
q: UnitQuaternion<f64>,
v: Vector3<f64>,
p: Point3<f64>
) -> bool
{
) -> bool {
let r = q.to_rotation_matrix();
let rv = r * v;
let rp = r * p;
@ -122,6 +121,7 @@ quickcheck!(
// Test that all operators (incl. all combinations of references) work.
// See the top comment on `geometry/quaternion_ops.rs` for details on which operations are
// supported.
#[cfg_attr(rustfmt, rustfmt_skip)]
fn all_op_exist(
q: Quaternion<f64>,
uq: UnitQuaternion<f64>,
@ -129,8 +129,7 @@ quickcheck!(
p: Point3<f64>,
r: Rotation3<f64>,
s: f64
) -> bool
{
) -> bool {
let uv = Unit::new_normalize(v);
let qpq = q + q;

View File

@ -15,10 +15,11 @@ quickcheck!(
&& relative_eq!((ii * i) * v, v, epsilon = 1.0e-7)
}
#[cfg_attr(rustfmt, rustfmt_skip)]
fn inverse_is_parts_inversion(
t: Translation3<f64>,
r: UnitQuaternion<f64>,
scaling: f64,
scaling: f64
) -> bool {
if relative_eq!(scaling, 0.0) {
true
@ -28,10 +29,11 @@ quickcheck!(
}
}
#[cfg_attr(rustfmt, rustfmt_skip)]
fn multiply_equals_alga_transform(
s: Similarity3<f64>,
v: Vector3<f64>,
p: Point3<f64>,
p: Point3<f64>
) -> bool {
s * v == s.transform_vector(&v)
&& s * p == s.transform_point(&p)
@ -47,13 +49,14 @@ quickcheck!(
)
}
#[cfg_attr(rustfmt, rustfmt_skip)]
fn composition(
i: Isometry3<f64>,
uq: UnitQuaternion<f64>,
t: Translation3<f64>,
v: Vector3<f64>,
p: Point3<f64>,
scaling: f64,
scaling: f64
) -> bool {
if relative_eq!(scaling, 0.0) {
return true;
@ -142,13 +145,14 @@ quickcheck!(
relative_eq!((s * i * t) * p, scaling * (i * (t * p)), epsilon = 1.0e-7)
}
#[cfg_attr(rustfmt, rustfmt_skip)]
fn all_op_exist(
s: Similarity3<f64>,
i: Isometry3<f64>,
uq: UnitQuaternion<f64>,
t: Translation3<f64>,
v: Vector3<f64>,
p: Point3<f64>,
p: Point3<f64>
) -> bool {
let sMs = s * s;
let sMuq = s * uq;

View File

@ -68,11 +68,12 @@ quickcheck!(
// Test that all operators (incl. all combinations of references) work.
// See the top comment on `geometry/quaternion_ops.rs` for details on which operations are
// supported.
#[cfg_attr(rustfmt, rustfmt_skip)]
fn all_op_exist(
uc: UnitComplex<f64>,
v: Vector2<f64>,
p: Point2<f64>,
r: Rotation2<f64>,
r: Rotation2<f64>
) -> bool {
let uv = Unit::new_normalize(v);