From 1e63a1a42647779f9e7fb7c362c958613d12d1a0 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Sun, 6 Mar 2016 19:44:12 -0500 Subject: [PATCH] Add constructor tests --- test/core/core_type_ctor.cpp | 9 +++++++++ test/gtc/gtc_quaternion.cpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/test/core/core_type_ctor.cpp b/test/core/core_type_ctor.cpp index f9f43e6e..e818513b 100644 --- a/test/core/core_type_ctor.cpp +++ b/test/core/core_type_ctor.cpp @@ -100,6 +100,11 @@ int test_vec3_ctor() } # endif//GLM_HAS_DEFAULTED_FUNCTIONS + Error += (glm::ivec3(glm::vec2(4.0f, 5.0f)) == glm::ivec3(4, 5, 0)) ? 0 : 1; + Error += (glm::ivec3(glm::vec2(5, 6)) == glm::ivec3(5, 6, 0)) ? 0 : 1; + Error += (glm::bvec3(glm::vec2(4.0f, 5.0f)) == glm::bvec3(true, true, false)) ? 0 : 1; + Error += (glm::ivec3(glm::dvec3(1.0, 1.0, 1.0)) == glm::ivec3(1, 1, 1)) ? 0 : 1; + return Error; } @@ -131,6 +136,10 @@ int test_vec4_ctor() } # endif//GLM_HAS_DEFAULTED_FUNCTIONS + Error += (glm::ivec4(glm::vec2(4.0f, 5.0f)) == glm::ivec4(4, 5, 0, 0)) ? 0 : 1; + Error += (glm::vec4(glm::vec3(4.0f, 5.0f, 7.0f)) == glm::vec4(4.0f, 5.0f, 7.0f, 0)) ? 0 : 1; + Error += (glm::uvec4(glm::bvec4(true, true, false, true)) == glm::uvec4(1, 1, 0, 1)) ? 0 : 1; + return Error; } diff --git a/test/gtc/gtc_quaternion.cpp b/test/gtc/gtc_quaternion.cpp index 2f006f34..ebd1ab7e 100644 --- a/test/gtc/gtc_quaternion.cpp +++ b/test/gtc/gtc_quaternion.cpp @@ -277,6 +277,8 @@ int test_quat_type() glm::quat A; glm::dquat B; + glm::dquat C(A); + return 0; }