Added more constexpr tests #783

This commit is contained in:
Groove
2018-07-10 00:06:28 +02:00
parent d3a2542c77
commit f95abf2c27
4 changed files with 18 additions and 12 deletions

View File

@@ -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;
}