Added trivially copyable test

This commit is contained in:
Christophe Riccio 2014-11-12 21:45:12 +01:00
parent f09888a090
commit debe75a6e1
5 changed files with 45 additions and 4 deletions

View File

@ -188,11 +188,13 @@ int test_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::mat4>::value ? 0 : 1;
//Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::mat4>::value ? 0 : 1;
//Error += std::is_copy_constructible<glm::mat4>::value ? 0 : 1;
//Error += std::has_trivial_copy_constructor<glm::mat4>::value ? 0 : 1;
#endif
#if(GLM_HAS_INITIALIZER_LISTS)
glm::mat4 m0(

View File

@ -44,6 +44,18 @@ int test_vec1_ctor()
{
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::vec1>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec1>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec1>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec1>::value ? 0 : 1;
#endif
/*
#if GLM_HAS_INITIALIZER_LISTS
{

View File

@ -201,6 +201,18 @@ int test_vec2_ctor()
{
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::vec2>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec2>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec2>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec2>::value ? 0 : 1;
#endif
#if GLM_HAS_INITIALIZER_LISTS
{
glm::vec2 a{ 0, 1 };

View File

@ -19,8 +19,20 @@
int test_vec3_ctor()
{
int Error = 0;
#if(GLM_HAS_INITIALIZER_LISTS)
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
// Error += std::is_trivially_default_constructible<glm::vec3>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec3>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec3>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec3>::value ? 0 : 1;
#endif
#if (GLM_HAS_INITIALIZER_LISTS)
{
glm::vec3 a{ 0, 1, 2 };
std::vector<glm::vec3> v = {

View File

@ -47,14 +47,17 @@ int test_vec4_ctor()
glm::ivec4 B(A);
Error += glm::all(glm::equal(A, B)) ? 0 : 1;
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
// Error += std::is_trivially_default_constructible<glm::vec4>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
// Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec4>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec4>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec4>::value ? 0 : 1;
#endif
#if GLM_HAS_INITIALIZER_LISTS
{