From 291287e45d1d0601ff4895a97d12f0f61658b12b Mon Sep 17 00:00:00 2001 From: Groove Date: Sat, 28 Jul 2018 18:16:07 +0200 Subject: [PATCH] Fixed error: comparing floating point with == or != is unsafe --- test/core/core_type_mat4x3.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/core/core_type_mat4x3.cpp b/test/core/core_type_mat4x3.cpp index 2ac1d283..2ab0e891 100644 --- a/test/core/core_type_mat4x3.cpp +++ b/test/core/core_type_mat4x3.cpp @@ -49,11 +49,8 @@ int test_ctr() {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},