Skip to content

Commit

Permalink
use proper float comparison in matrix3::mul test
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Nov 10, 2024
1 parent 01674dc commit abbb42c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/testmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ namespace
b.identity();
c.identity();
a.mul(b,c);
assert(a.a == vec(1,0,0));
assert(a.b == vec(0,1,0));
assert(a.c == vec(0,0,1));
assert(a.a.sub(vec(1,0,0)).magnitude() < tolerance);
assert(a.b.sub(vec(0,1,0)).magnitude() < tolerance);
assert(a.c.sub(vec(0,0,1)).magnitude() < tolerance);
}
{
matrix3 a, c;
Expand All @@ -126,19 +126,19 @@ namespace
matrix3 b(e1,e2,e3);
c.identity();
a.mul(b,c);
assert(a.a == vec(1,2,3));
assert(a.b == vec(4,5,6));
assert(a.c == vec(7,8,9));
assert(a.a.sub(vec(1,2,3)).magnitude() < tolerance);
assert(a.b.sub(vec(4,5,6)).magnitude() < tolerance);
assert(a.c.sub(vec(7,8,9)).magnitude() < tolerance);
}
//mul(const matrix3&);
{
matrix3 a,b;
a.identity();
b.identity();
a.mul(b);
assert(a.a == vec(1,0,0));
assert(a.b == vec(0,1,0));
assert(a.c == vec(0,0,1));
assert(a.a.sub(vec(1,0,0)).magnitude() < tolerance);
assert(a.b.sub(vec(0,1,0)).magnitude() < tolerance);
assert(a.c.sub(vec(0,0,1)).magnitude() < tolerance);
}
{
matrix3 a;
Expand All @@ -148,9 +148,9 @@ namespace
matrix3 b(e1,e2,e3);
a.identity();
a.mul(b);
assert(a.a == vec(1,2,3));
assert(a.b == vec(4,5,6));
assert(a.c == vec(7,8,9));
assert(a.a.sub(vec(1,2,3)).magnitude() < tolerance);
assert(a.b.sub(vec(4,5,6)).magnitude() < tolerance);
assert(a.c.sub(vec(7,8,9)).magnitude() < tolerance);
}
}

Expand Down

0 comments on commit abbb42c

Please sign in to comment.