diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index 9cc86442..71d63c84 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -350,6 +350,8 @@ static int test_constexpr() #if GLM_HAS_CONSTEXPR_CXX11 static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr"); static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); #endif return 0; diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 652887f6..7e44d23d 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -563,6 +563,8 @@ static int test_constexpr() #if GLM_HAS_CONSTEXPR_CXX11 static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr"); static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); #endif return 0; diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index f4701914..8fef3289 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -105,17 +105,6 @@ static int test_vec4_ctor() } #endif// GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE) -# if GLM_HAS_CONSTEXPR && GLM_ARCH == GLM_ARCH_PURE && !(GLM_COMPILER & GLM_COMPILER_VC) // Visual Studio bug? - { - constexpr glm::ivec4 v(1); - - Error += v.x == 1 ? 0 : 1; - Error += v.y == 1 ? 0 : 1; - Error += v.z == 1 ? 0 : 1; - Error += v.w == 1 ? 0 : 1; - } -# endif - { glm::vec4 A(1); glm::vec4 B(1, 1, 1, 1); @@ -725,6 +714,8 @@ static int test_constexpr() #if GLM_HAS_CONSTEXPR_CXX11 static_assert(glm::vec4::length() == 4, "GLM: Failed constexpr"); static_assert(glm::vec4(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); #endif return 0; diff --git a/test/gtc/gtc_quaternion.cpp b/test/gtc/gtc_quaternion.cpp index b006a12f..94c18aae 100644 --- a/test/gtc/gtc_quaternion.cpp +++ b/test/gtc/gtc_quaternion.cpp @@ -202,7 +202,7 @@ int test_quat_slerp() int test_quat_mul() { - int Error(0); + int Error = 0; glm::quat temp1 = glm::normalize(glm::quat(1.0f, glm::vec3(0.0, 1.0, 0.0))); glm::quat temp2 = glm::normalize(glm::quat(0.5f, glm::vec3(1.0, 0.0, 0.0))); @@ -307,6 +307,16 @@ int test_size() return Error; } +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR_CXX11 + static_assert(glm::quat::length() == 4, "GLM: Failed constexpr"); + static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr"); +#endif + + return 0; +} + int main() { int Error = 0; @@ -323,6 +333,7 @@ int main() Error += test_quat_euler(); Error += test_quat_slerp(); Error += test_size(); + Error += test_constexpr(); return Error; }