Browse Source

Fixed merge

Christophe Riccio 14 years ago
parent
commit
ac869c9faa

+ 6 - 1
test/core/core_type_float.cpp

@@ -20,10 +20,15 @@ int test_float_size()
 int test_float_precision()
 int test_float_precision()
 {
 {
     return (
     return (
-        sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) && 
+		sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) && 
 		sizeof(glm::mediump_float) <= sizeof(glm::highp_float)) ? 0 : 1;
 		sizeof(glm::mediump_float) <= sizeof(glm::highp_float)) ? 0 : 1;
 }
 }
 
 
+int test_vec2()
+{
+	return 0;
+}
+
 int main()
 int main()
 {
 {
     int Error = 0;
     int Error = 0;

+ 15 - 0
test/core/core_type_vec2.cpp

@@ -91,10 +91,25 @@ int test_vec2_ctor()
 	return Error;
 	return Error;
 }   
 }   
 
 
+int test_vec2_size()
+{
+	int Error = 0;
+	
+	Error += sizeof(glm::vec2) == sizeof(glm::mediump_vec2) ? 0 : 1;
+	Error += 8 == sizeof(glm::mediump_vec2) ? 0 : 1;
+	Error += sizeof(glm::dvec2) == sizeof(glm::highp_vec2) ? 0 : 1;
+	Error += 16 == sizeof(glm::highp_vec2) ? 0 : 1;
+	Error += glm::vec2().length() == 2 ? 0 : 1;
+	Error += glm::dvec2().length() == 2 ? 0 : 1;
+	
+	return Error;
+}
+
 int main()
 int main()
 {
 {
 	int Error = 0;
 	int Error = 0;
 
 
+	Error += test_vec2_size();
     Error += test_vec2_ctor();
     Error += test_vec2_ctor();
 	Error += test_vec2_operators();
 	Error += test_vec2_operators();
 
 

+ 18 - 3
test/core/core_type_vec3.cpp

@@ -2,14 +2,14 @@
 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Created : 2008-08-31
 // Created : 2008-08-31
-// Updated : 2008-08-31
+// Updated : 2011-09-19
 // Licence : This source is under MIT License
 // Licence : This source is under MIT License
 // File    : test/core/type_vec3.cpp
 // File    : test/core/type_vec3.cpp
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
 #include <glm/glm.hpp>
 #include <glm/glm.hpp>
 
 
-static int test_operators()
+static int test_vec3_operators()
 {
 {
 	glm::vec3 A(1.0f);
 	glm::vec3 A(1.0f);
 	glm::vec3 B(1.0f);
 	glm::vec3 B(1.0f);
@@ -19,11 +19,26 @@ static int test_operators()
 	return (S && !R) ? 0 : 1;
 	return (S && !R) ? 0 : 1;
 }
 }
 
 
+int test_vec3_size()
+{
+	int Error = 0;
+	
+	Error += sizeof(glm::vec3) == sizeof(glm::mediump_vec3) ? 0 : 1;
+	Error += 12 == sizeof(glm::mediump_vec3) ? 0 : 1;
+	Error += sizeof(glm::dvec3) == sizeof(glm::highp_vec3) ? 0 : 1;
+	Error += 24 == sizeof(glm::highp_vec3) ? 0 : 1;
+	Error += glm::vec3().length() == 3 ? 0 : 1;
+	Error += glm::dvec3().length() == 3 ? 0 : 1;
+	
+	return Error;
+}
+
 int main()
 int main()
 {
 {
 	int Error = 0;
 	int Error = 0;
 
 
-	Error += test_operators();
+	Error += test_vec3_operators();
+	Error += test_vec3_size();
 	
 	
 	return Error;
 	return Error;
 }
 }

+ 17 - 2
test/core/core_type_vec4.cpp

@@ -41,7 +41,7 @@ int test_hvec4()
 	return 0;
 	return 0;
 }
 }
 
 
-static int test_operators()
+int test_vec4_operators()
 {
 {
 	glm::vec4 A(1.0f);
 	glm::vec4 A(1.0f);
 	glm::vec4 B(1.0f);
 	glm::vec4 B(1.0f);
@@ -51,13 +51,28 @@ static int test_operators()
 	return (S && !R) ? 0 : 1;
 	return (S && !R) ? 0 : 1;
 }
 }
 
 
+int test_vec4_size()
+{
+	int Error = 0;
+	
+	Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1;
+	Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1;
+	Error += sizeof(glm::dvec4) == sizeof(glm::highp_vec4) ? 0 : 1;
+	Error += 32 == sizeof(glm::highp_vec4) ? 0 : 1;
+	Error += glm::vec4().length() == 4 ? 0 : 1;
+	Error += glm::dvec4().length() == 4 ? 0 : 1;
+	
+	return Error;
+}
+
 int main()
 int main()
 {
 {
 	//__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
 	//__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
 	//__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
 	//__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
 
 
 	int Error = 0;
 	int Error = 0;
-	Error += test_operators();
+	Error += test_vec4_size();
+	Error += test_vec4_operators();
 	Error += test_hvec4();
 	Error += test_hvec4();
 	return Error;
 	return Error;
 }
 }