From 168d9c9024037c8150425612f0710aceb4656f2e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 13 Sep 2011 12:23:11 +0100 Subject: [PATCH] Added floattoint tests --- test/core/core_func_common.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index a8436648..fb99b809 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -25,6 +25,23 @@ int test_floatBitsToInt() Error += B.x == *(float*)&(A.x) ? 0 : 1; Error += B.y == *(float*)&(A.y) ? 0 : 1; } + + { + glm::vec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B = glm::floatBitsToInt(A); + Error += B.x == *(float*)&(A.x) ? 0 : 1; + Error += B.y == *(float*)&(A.y) ? 0 : 1; + Error += B.z == *(float*)&(A.z) ? 0 : 1; + } + + { + glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = glm::floatBitsToInt(A); + Error += B.x == *(float*)&(A.x) ? 0 : 1; + Error += B.y == *(float*)&(A.y) ? 0 : 1; + Error += B.z == *(float*)&(A.z) ? 0 : 1; + Error += B.w == *(float*)&(A.w) ? 0 : 1; + } return Error; }