Browse Source

fix: tests build

pull/43/head
Natasha England-Elbro 10 months ago
parent
commit
52f0019431
No known key found for this signature in database
GPG Key ID: 46F323AE9236FD6A
  1. 18
      citro3d/src/math/ops.rs

18
citro3d/src/math/ops.rs

@ -247,25 +247,13 @@ mod tests { @@ -247,25 +247,13 @@ mod tests {
assert_abs_diff_eq!(l / 2.0, FVec4::splat(0.5));
}
#[test]
fn matrix3() {
let l = Matrix3::diagonal(1.0, 2.0, 3.0);
let r = Matrix3::identity();
let (l, r) = (&l, &r);
assert_abs_diff_eq!(&(l * r), l);
assert_abs_diff_eq!(&(l + r), &Matrix3::diagonal(2.0, 3.0, 4.0));
assert_abs_diff_eq!(&(l - r), &Matrix3::diagonal(0.0, 1.0, 2.0));
}
#[test]
fn matrix4() {
let l = Matrix4::diagonal(1.0, 2.0, 3.0, 4.0);
let r = Matrix4::identity();
let (l, r) = (&l, &r);
assert_abs_diff_eq!(&(l * r), l);
assert_abs_diff_eq!(&(l + r), &Matrix4::diagonal(2.0, 3.0, 4.0, 5.0));
assert_abs_diff_eq!(&(l - r), &Matrix4::diagonal(0.0, 1.0, 2.0, 3.0));
assert_abs_diff_eq!(l * r, l);
assert_abs_diff_eq!(l + r, Matrix4::diagonal(2.0, 3.0, 4.0, 5.0));
assert_abs_diff_eq!(l - r, Matrix4::diagonal(0.0, 1.0, 2.0, 3.0));
}
}

Loading…
Cancel
Save