diff --git a/test/core/core_type_mat2x2.cpp b/test/core/core_type_mat2x2.cpp index 4849fd09..338e1dbb 100644 --- a/test/core/core_type_mat2x2.cpp +++ b/test/core/core_type_mat2x2.cpp @@ -65,8 +65,7 @@ int test_ctr() glm::highp_mat2x2 const B(A); glm::mediump_mat2x2 const C(B); - for(glm::length_t i = 0; i < A.length(); ++i) - Error += glm::all(glm::equal(A[i], C[i])) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; } #if GLM_HAS_INITIALIZER_LISTS @@ -80,11 +79,8 @@ int test_ctr() {0, 1}, {2, 3}}; - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; - - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; std::vector v1{ {0, 1, 2, 3}, @@ -118,8 +114,7 @@ namespace cast glm::mat2 B(A); glm::mat2 Identity(1.0f); - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::equal(B[i], Identity[i])) ? 0 : 1; + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; return Error; } diff --git a/test/core/core_type_mat2x3.cpp b/test/core/core_type_mat2x3.cpp index d778cde2..b4431226 100644 --- a/test/core/core_type_mat2x3.cpp +++ b/test/core/core_type_mat2x3.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include #include #include @@ -44,11 +45,8 @@ int test_ctr() {0, 1, 2}, {3, 4, 5}}; - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; - - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; std::vector v1{ {0, 1, 2, 3, 4, 5}, @@ -82,8 +80,7 @@ namespace cast glm::mat2x3 B(A); glm::mat2x3 Identity(1.0f); - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::equal(B[i], Identity[i])) ? 0 : 1; + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; return Error; } diff --git a/test/core/core_type_mat2x4.cpp b/test/core/core_type_mat2x4.cpp index c7ac11c0..ba2cd41f 100644 --- a/test/core/core_type_mat2x4.cpp +++ b/test/core/core_type_mat2x4.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -39,19 +39,16 @@ int test_ctr() glm::mat2x4 m0( glm::vec4(0, 1, 2, 3), glm::vec4(4, 5, 6, 7)); - + glm::mat2x4 m1{0, 1, 2, 3, 4, 5, 6, 7}; - + glm::mat2x4 m2{ {0, 1, 2, 3}, {4, 5, 6, 7}}; - - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; - - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; - + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + std::vector v1{ {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} diff --git a/test/core/core_type_mat3x2.cpp b/test/core/core_type_mat3x2.cpp index d10b9c30..f4a204b4 100644 --- a/test/core/core_type_mat3x2.cpp +++ b/test/core/core_type_mat3x2.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include #include #include @@ -45,13 +46,10 @@ int test_ctr() {0, 1}, {2, 3}, {4, 5}}; - - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; - - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; - + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + std::vector v1{ {0, 1, 2, 3, 4, 5}, {0, 1, 2, 3, 4, 5} @@ -86,8 +84,7 @@ namespace cast glm::mat3x2 B(A); glm::mat3x2 Identity(1.0f); - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::equal(B[i], Identity[i])) ? 0 : 1; + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; return Error; } diff --git a/test/core/core_type_mat3x3.cpp b/test/core/core_type_mat3x3.cpp index 4fa13d66..04e5394d 100644 --- a/test/core/core_type_mat3x3.cpp +++ b/test/core/core_type_mat3x3.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include #include #include @@ -68,9 +69,9 @@ int test_inverse() glm::mat3 const Inverse = glm::inverse(Matrix); glm::mat3 const Identity = Matrix * Inverse; - Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; } { @@ -80,9 +81,9 @@ int test_inverse() glm::vec3(0.3f, 0.5f, 0.7f)); glm::mat3 const Identity = Matrix / Matrix; - Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; } return Error; @@ -104,13 +105,10 @@ int test_ctr() {0, 1, 2}, {3, 4, 5}, {6, 7, 8}}; - - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; - - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; - + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + std::vector v1{ {0, 1, 2, 3, 4, 5, 6, 7, 8}, {0, 1, 2, 3, 4, 5, 6, 7, 8} @@ -145,8 +143,7 @@ namespace cast glm::mat3x3 B(A); glm::mat3x3 Identity(1.0f); - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::equal(B[i], Identity[i])) ? 0 : 1; + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; return Error; } diff --git a/test/core/core_type_mat3x4.cpp b/test/core/core_type_mat3x4.cpp index d7881a30..6839dab1 100644 --- a/test/core/core_type_mat3x4.cpp +++ b/test/core/core_type_mat3x4.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -40,20 +40,17 @@ int test_ctr() glm::vec4(0, 1, 2, 3), glm::vec4(4, 5, 6, 7), glm::vec4(8, 9, 10, 11)); - + glm::mat3x4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; - + glm::mat3x4 m2{ {0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}}; - - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; - - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; - + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + std::vector v1{ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} diff --git a/test/core/core_type_mat4x2.cpp b/test/core/core_type_mat4x2.cpp index dd9d67c7..e392017c 100644 --- a/test/core/core_type_mat4x2.cpp +++ b/test/core/core_type_mat4x2.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include #include #include @@ -48,11 +49,8 @@ int test_ctr() {4, 5}, {6, 7}}; - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; - - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; std::vector v1{ {0, 1, 2, 3, 4, 5, 6, 7}, @@ -90,8 +88,7 @@ namespace cast glm::mat4x2 B(A); glm::mat4x2 Identity(1.0f); - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::equal(B[i], Identity[i])) ? 0 : 1; + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; return Error; } diff --git a/test/core/core_type_mat4x3.cpp b/test/core/core_type_mat4x3.cpp index 97c9f1ad..5a5c1500 100644 --- a/test/core/core_type_mat4x3.cpp +++ b/test/core/core_type_mat4x3.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include #include #include @@ -90,8 +91,7 @@ namespace cast glm::mat4x3 B(A); glm::mat4x3 Identity(1.0f); - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::equal(B[i], Identity[i])) ? 0 : 1; + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; return Error; } diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index 318e03a4..877126f1 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -209,11 +209,9 @@ int test_ctr() {8, 9, 10, 11}, {12, 13, 14, 15}}; - for(glm::length_t i = 0; i < m0.length(); ++i) - Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - for(glm::length_t i = 0; i < m1.length(); ++i) - Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; std::vector m3{ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},