Skip to content

Commit

Permalink
test matrix3::transform
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Nov 6, 2024
1 parent e858022 commit 755f4ff
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/testmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,35 @@ void test_matrix3_calcangleaxis()
}
}

void test_matrix3_transform()
{
std::printf("testing matrix3 transform\n");
{
matrix3 m;
m.identity();
vec v(1,0,0);
assert(m.transform(v) == vec(1,0,0));
}
{
matrix3 m;
m.identity();
vec v(1,2,3);
assert(m.transform(v) == vec(1,2,3));
}
{
matrix3 m({0,1,0}, {1,0,0}, {0,0,1});
m.identity();
vec v(1,0,0);
assert(m.transform(v) == vec(1,0,0));
}
{
matrix3 m({0,1,0}, {1,0,0}, {0,0,0});
m.identity();
vec v(0,0,1);
assert(m.transform(v) == vec(0,0,1));
}
}

void test_matrix3_identity()
{
std::printf("testing matrix3 identity\n");
Expand Down Expand Up @@ -1349,6 +1378,7 @@ testing matrices\n\
test_matrix3_setyaw();
test_matrix3_trace();
test_matrix3_calcangleaxis();
test_matrix3_transform();
test_matrix3_identity();
test_matrix3_transpose();
test_matrix3_invert();
Expand Down

0 comments on commit 755f4ff

Please sign in to comment.