Added mat4 access tests

This commit is contained in:
Christophe Riccio 2011-05-08 00:31:34 +01:00
parent d1571fd15f
commit 840c3d44f4

View File

@ -48,12 +48,40 @@ int test_mat4x4_col_get()
int test_mat4x4_row_set()
{
int Error = 0;
glm::mat4 m(1);
glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
glm::row(m, 2, glm::vec4( 8, 9, 10, 11));
glm::row(m, 3, glm::vec4(12, 13, 14, 15));
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
return Error;
}
int test_mat4x4_col_set()
{
int Error = 0;
glm::mat4 m(1);
glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
glm::column(m, 2, glm::vec4( 8, 9, 10, 11));
glm::column(m, 3, glm::vec4(12, 13, 14, 15));
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
return Error;
}
int main()
@ -61,7 +89,7 @@ int main()
int Error = 0;
Error += test_mat4x4_row_get();
Error += test_mat4x4_col_set();
Error += test_mat4x4_col_get();
Error += test_mat4x4_row_set();
Error += test_mat4x4_col_set();