#include #include #include #include static int test_defined() { int Error = 0; Error += glm::all(glm::epsilonEqual(glm::vec2(0.0f), glm::vec2(0.0f), glm::vec2(glm::epsilon()))) ? 0 : 1; Error += glm::all(glm::epsilonEqual(glm::vec3(0.0f), glm::vec3(0.0f), glm::vec3(glm::epsilon()))) ? 0 : 1; Error += glm::all(glm::epsilonEqual(glm::vec4(0.0f), glm::vec4(0.0f), glm::vec4(glm::epsilon()))) ? 0 : 1; Error += glm::all(glm::epsilonNotEqual(glm::vec2(1.0f), glm::vec2(2.0f), glm::vec2(glm::epsilon()))) ? 0 : 1; Error += glm::all(glm::epsilonNotEqual(glm::vec3(1.0f), glm::vec3(2.0f), glm::vec3(glm::epsilon()))) ? 0 : 1; Error += glm::all(glm::epsilonNotEqual(glm::vec4(1.0f), glm::vec4(2.0f), glm::vec4(glm::epsilon()))) ? 0 : 1; Error += glm::all(glm::epsilonEqual(glm::vec2(0.0f), glm::vec2(0.0f), glm::epsilon())) ? 0 : 1; Error += glm::all(glm::epsilonEqual(glm::vec3(0.0f), glm::vec3(0.0f), glm::epsilon())) ? 0 : 1; Error += glm::all(glm::epsilonEqual(glm::vec4(0.0f), glm::vec4(0.0f), glm::epsilon())) ? 0 : 1; Error += glm::all(glm::epsilonEqual(glm::quat(glm::vec3(0.0f)), glm::quat(glm::vec3(0.0f)), glm::epsilon())) ? 0 : 1; Error += glm::all(glm::epsilonNotEqual(glm::vec2(1.0f), glm::vec2(2.0f), glm::epsilon())) ? 0 : 1; Error += glm::all(glm::epsilonNotEqual(glm::vec3(1.0f), glm::vec3(2.0f), glm::epsilon())) ? 0 : 1; Error += glm::all(glm::epsilonNotEqual(glm::vec4(1.0f), glm::vec4(2.0f), glm::epsilon())) ? 0 : 1; Error += glm::all(glm::epsilonNotEqual(glm::quat(glm::vec3(0.0f)), glm::quat(glm::vec3(1.0f)), glm::epsilon())) ? 0 : 1; return Error; } template static int test_equal() { int Error = 0; { T A = glm::epsilon(); T B = glm::epsilon(); Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; } { T A(0); T B = static_cast(0) + glm::epsilon(); Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; } { T A(0); T B = static_cast(0) - glm::epsilon(); Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; } { T A = static_cast(0) + glm::epsilon(); T B = static_cast(0); Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; } { T A = static_cast(0) - glm::epsilon(); T B = static_cast(0); Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; } return Error; } int main() { int Error = 0; Error += test_defined(); Error += test_equal(); Error += test_equal(); return Error; }