Quellcode durchsuchen

Added test for == operators

Christophe Riccio vor 15 Jahren
Ursprung
Commit
4cb312773e

+ 2 - 0
test/core/core_type_mat2x2.cpp

@@ -21,6 +21,8 @@ static bool test_operators()
 	glm::mat2x2 o = m / x;
 	glm::mat2x2 p = x * m;
 	glm::mat2x2 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat2x3.cpp

@@ -21,6 +21,8 @@ static bool test_operators()
 	glm::mat2x3 o = m / x;
 	glm::mat2x3 p = x * m;
 	glm::mat2x3 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat2x4.cpp

@@ -21,6 +21,8 @@ static bool test_operators()
 	glm::mat2x4 o = m / x;
 	glm::mat2x4 p = x * m;
 	glm::mat2x4 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat3x2.cpp

@@ -21,6 +21,8 @@ static bool test_operators()
 	glm::mat3x2 o = m / x;
 	glm::mat3x2 p = x * m;
 	glm::mat3x2 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat3x3.cpp

@@ -46,6 +46,8 @@ static bool test_operators()
 	glm::mat3x3 o = m / x;
 	glm::mat3x3 p = x * m;
 	glm::mat3x3 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat3x4.cpp

@@ -21,6 +21,8 @@ static bool test_operators()
 	glm::mat3x4 o = m / x;
 	glm::mat3x4 p = x * m;
 	glm::mat3x4 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat4x2.cpp

@@ -21,6 +21,8 @@ static bool test_operators()
 	glm::mat4x2 o = m / x;
 	glm::mat4x2 p = x * m;
 	glm::mat4x2 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat4x3.cpp

@@ -21,6 +21,8 @@ static bool test_operators()
 	glm::mat4x3 o = m / x;
 	glm::mat4x3 p = x * m;
 	glm::mat4x3 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 2 - 0
test/core/core_type_mat4x4.cpp

@@ -48,6 +48,8 @@ static bool test_operators()
 	glm::mat4x4 o = m / x;
 	glm::mat4x4 p = x * m;
 	glm::mat4x4 q = m * x;
+	bool R = m != q;
+	bool S = m == m;
 
 	return true;
 }

+ 16 - 1
test/core/core_type_vec1.cpp

@@ -9,7 +9,22 @@
 
 #include <glm/glm.hpp>
 
+static bool test_operators()
+{
+	glm::vec4 A(1.0f);
+	glm::vec4 B(1.0f);
+	bool R = A != B;
+	bool S = A == B;
+
+	return true;
+}
+
 int main()
 {
-	return -1;
+	bool Result = true;
+
+	Result = Result && test_operators();
+	
+	assert(Result);
+	return Result;
 }

+ 16 - 1
test/core/core_type_vec2.cpp

@@ -9,7 +9,22 @@
 
 #include <glm/glm.hpp>
 
+static bool test_operators()
+{
+	glm::vec4 A(1.0f);
+	glm::vec4 B(1.0f);
+	bool R = A != B;
+	bool S = A == B;
+
+	return true;
+}
+
 int main()
 {
-	return -1;
+	bool Result = true;
+
+	Result = Result && test_operators();
+	
+	assert(Result);
+	return Result;
 }

+ 16 - 1
test/core/core_type_vec3.cpp

@@ -9,7 +9,22 @@
 
 #include <glm/glm.hpp>
 
+static bool test_operators()
+{
+	glm::vec4 A(1.0f);
+	glm::vec4 B(1.0f);
+	bool R = A != B;
+	bool S = A == B;
+
+	return true;
+}
+
 int main()
 {
-	return -1;
+	bool Result = true;
+
+	Result = Result && test_operators();
+	
+	assert(Result);
+	return Result;
 }

+ 21 - 1
test/core/core_type_vec4.cpp

@@ -33,12 +33,24 @@ __m128 swizzle(glm::vec4 const & v)
 	return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value);
 }
 
-void test_hvec4()
+bool test_hvec4()
 {
 	glm::hvec4 const A = glm::hvec4(0, 1, 2, 3);
 	//glm::hvec4 B = glm::swizzle<glm::X, glm::Y, glm::Z, glm::W>(A);
 
 	//glm::vec4 B = glm::detail::tvec##(glm::vec4::_size)<float>();
+
+	return true;
+}
+
+static bool test_operators()
+{
+	glm::vec4 A(1.0f);
+	glm::vec4 B(1.0f);
+	bool R = A != B;
+	bool S = A == B;
+
+	return true;
 }
 
 int main()
@@ -48,6 +60,14 @@ int main()
 	__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));
 
+	bool Result = true;
+
+	Result = Result && test_operators();
+	Result = Result && test_hvec4();
+	
+	assert(Result);
+	return Result;
+
 	return 0;
 }