From 9443d8d9ca9d93e911a3108dac0ec6ea951925e5 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 24 Jul 2017 13:17:00 +0200 Subject: [PATCH] Added length constexpr test #657 --- test/core/core_type_vec1.cpp | 5 +++++ test/core/core_type_vec2.cpp | 5 +++++ test/core/core_type_vec3.cpp | 5 +++++ test/core/core_type_vec4.cpp | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index ff1555fe..543729eb 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -106,6 +106,11 @@ int test_vec1_size() Error += glm::vec1::length() == 1 ? 0 : 1; Error += glm::dvec1::length() == 1 ? 0 : 1; +# if GLM_HAS_CONSTEXPR_PARTIAL + constexpr std::size_t Length = glm::vec2::length(); + Error += Length == 1 ? 0 : 1; +# endif + return Error; } diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index 89ab00cb..551220b8 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -272,6 +272,11 @@ int test_vec2_size() Error += glm::vec2::length() == 2 ? 0 : 1; Error += glm::dvec2::length() == 2 ? 0 : 1; +# if GLM_HAS_CONSTEXPR_PARTIAL + constexpr std::size_t Length = glm::vec2::length(); + Error += Length == 2 ? 0 : 1; +# endif + return Error; } diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 072767f9..bbbd1841 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -246,6 +246,11 @@ int test_vec3_size() Error += glm::vec3::length() == 3 ? 0 : 1; Error += glm::dvec3::length() == 3 ? 0 : 1; +# if GLM_HAS_CONSTEXPR_PARTIAL + constexpr std::size_t Length = glm::vec3::length(); + Error += Length == 3 ? 0 : 1; +# endif + return Error; } diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 72af25d8..79c62c04 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -322,6 +322,11 @@ int test_vec4_size() Error += glm::vec4::length() == 4 ? 0 : 1; Error += glm::dvec4::length() == 4 ? 0 : 1; +# if GLM_HAS_CONSTEXPR_PARTIAL + constexpr std::size_t Length = glm::vec4::length(); + Error += Length == 4 ? 0 : 1; +# endif + return Error; }