From 840c3d44f4204f4cb5af285fc0455b2f8853aec0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 8 May 2011 00:31:34 +0100 Subject: [PATCH] Added mat4 access tests --- test/gtc/gtc_matrix_access.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/test/gtc/gtc_matrix_access.cpp b/test/gtc/gtc_matrix_access.cpp index 74a68670..ed49335b 100644 --- a/test/gtc/gtc_matrix_access.cpp +++ b/test/gtc/gtc_matrix_access.cpp @@ -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();