Added a CMake option to execute GLM performance tests. Made quat and dualquat trivially constructible #263

This commit is contained in:
Christophe Riccio
2014-11-15 00:05:52 +01:00
parent b7b8b18f83
commit 0b8ca1a5b6
14 changed files with 70 additions and 36 deletions

View File

@@ -637,7 +637,9 @@ int main()
Error += ::bitfieldInterleave::test();
//Error += ::bitRevert::test();
Error += ::mask::perf();
# ifdef GLM_TEST_ENABLE_PERF
Error += ::mask::perf();
# endif
return Error;
}

View File

@@ -273,6 +273,20 @@ int test_quat_ctr()
{
int Error(0);
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
// Error += std::is_trivially_default_constructible<glm::quat>::value ? 0 : 1;
// Error += std::is_trivially_default_constructible<glm::dquat>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::quat>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::dquat>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::quat>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dquat>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::quat>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::dquat>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::quat>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::dquat>::value ? 0 : 1;
#endif
# if GLM_HAS_INITIALIZER_LISTS
{
glm::quat A{0, 1, 2, 3};

View File

@@ -299,7 +299,10 @@ int main()
Error += isPowerOfTwo::test();
Error += ceilPowerOfTwo::test();
Error += ceilPowerOfTwo::perf();
# ifdef GLM_TEST_ENABLE_PERF
Error += ceilPowerOfTwo::perf();
# endif
return Error;
}