From 97e09aa3047844991fe5c9625cae9a072a8ed03a Mon Sep 17 00:00:00 2001 From: olga Date: Fri, 13 Jan 2023 14:08:46 +0100 Subject: [PATCH] Fix round test Depending on the developer environment, the output of round for o.5 or -0.5 may be different (according to the GLSL spec). So the test was too restrictive. --- test/core/core_func_common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index b8640dea..f4b28e8f 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -639,7 +639,7 @@ namespace round_ float A = glm::round(0.0f); Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; float B = glm::round(0.5f); - Error += glm::equal(B, 1.0f, glm::epsilon()) ? 0 : 1; + Error += (glm::equal(B, 1.0f, glm::epsilon()) || glm::equal(B, 0.0f, glm::epsilon())) ? 0 : 1; float C = glm::round(1.0f); Error += glm::equal(C, 1.0f, glm::epsilon()) ? 0 : 1; float D = glm::round(0.1f); @@ -656,7 +656,7 @@ namespace round_ float A = glm::round(-0.0f); Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; float B = glm::round(-0.5f); - Error += glm::equal(B, -1.0f, glm::epsilon()) ? 0 : 1; + Error += (glm::equal(B, -1.0f, glm::epsilon()) || glm::equal(B, 0.0f, glm::epsilon())) ? 0 : 1; float C = glm::round(-1.0f); Error += glm::equal(C, -1.0f, glm::epsilon()) ? 0 : 1; float D = glm::round(-0.1f);