2
0
Эх сурвалжийг харах

Added trivially copyable test

Christophe Riccio 11 жил өмнө
parent
commit
debe75a6e1

+ 2 - 0
test/core/core_type_mat4x4.cpp

@@ -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(

+ 12 - 0
test/core/core_type_vec1.cpp

@@ -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
 	{

+ 12 - 0
test/core/core_type_vec2.cpp

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

+ 14 - 2
test/core/core_type_vec3.cpp

@@ -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 = {

+ 5 - 2
test/core/core_type_vec4.cpp

@@ -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
 	{