fix tests :/

This commit is contained in:
Quaternions 2024-09-10 14:50:35 -07:00
parent 021d7f9d1f
commit 7b78338c76

View File

@ -8,9 +8,9 @@ type Planar64Wide3=fixed_wide::types::I256F256;
#[test] #[test]
fn wide_vec3(){ fn wide_vec3(){
let v=Vector3::from_value(Planar64::from(3)); let v=Vector3::from_value(Planar64::from(3));
let v1=v*v; let v1=v*v.x;
let v2=v1*v1; let v2=v1*v1.y;
let v3=v2*v2; let v3=v2*v2.z;
assert_eq!(v3.array,Vector3::from_value(Planar64Wide3::from(3i128.pow(8))).array); assert_eq!(v3.array,Vector3::from_value(Planar64Wide3::from(3i128.pow(8))).array);
} }
@ -18,8 +18,8 @@ fn wide_vec3(){
#[test] #[test]
fn wide_vec3_dot(){ fn wide_vec3_dot(){
let v=Vector3::from_value(Planar64::from(3)); let v=Vector3::from_value(Planar64::from(3));
let v1=v*v; let v1=v*v.x;
let v2=v1*v1; let v2=v1*v1.y;
let v3=v2.dot(v2); let v3=v2.dot(v2);
assert_eq!(v3,Planar64Wide3::from(3i128.pow(8)*3)); assert_eq!(v3,Planar64Wide3::from(3i128.pow(8)*3));
@ -28,8 +28,8 @@ fn wide_vec3_dot(){
#[test] #[test]
fn wide_vec3_length_squared(){ fn wide_vec3_length_squared(){
let v=Vector3::from_value(Planar64::from(3)); let v=Vector3::from_value(Planar64::from(3));
let v1=v*v; let v1=v*v.x;
let v2=v1*v1; let v2=v1*v1.y;
let v3=v2.length_squared(); let v3=v2.length_squared();
assert_eq!(v3,Planar64Wide3::from(3i128.pow(8)*3)); assert_eq!(v3,Planar64Wide3::from(3i128.pow(8)*3));