From f9824a8dc648b12a2c76cdbbf685e7021111d158 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Sun, 22 Nov 2020 00:59:48 +0300 Subject: [PATCH] test: use custom epsilon to compare --- test/src/test_cam.c | 6 +++--- test/src/test_common.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/src/test_cam.c b/test/src/test_cam.c index ce89084..3fc3e1b 100644 --- a/test/src/test_cam.c +++ b/test/src/test_cam.c @@ -35,9 +35,9 @@ TEST_IMPL(camera_decomp) { farVal = 100.0f; glm_perspective(fovy, aspect, nearVal, farVal, proj); - ASSERT(fabsf(aspect - glm_persp_aspect(proj)) < GLM_FLT_EPSILON) - ASSERT(fabsf(fovy - glm_persp_fovy(proj)) < GLM_FLT_EPSILON) - ASSERT(fabsf(49.984f - glm_deg(glm_persp_fovy(proj))) < GLM_FLT_EPSILON) + ASSERT(fabsf(aspect - glm_persp_aspect(proj)) < 1e-5f) + ASSERT(fabsf(fovy - glm_persp_fovy(proj)) < 1e-5f) + ASSERT(fabsf(49.984f - glm_deg(glm_persp_fovy(proj))) < 1e-5f) glm_persp_sizes(proj, fovy, sizes); diff --git a/test/src/test_common.h b/test/src/test_common.h index 9162a8d..0840092 100644 --- a/test/src/test_common.h +++ b/test/src/test_common.h @@ -106,7 +106,7 @@ test_rand_quat(versor q); CGLM_INLINE bool test_eq(float a, float b) { - return fabsf(a - b) <= GLM_FLT_EPSILON * 10; + return fabsf(a - b) <= 1e-5f; } CGLM_INLINE