Browse Source

Fixed error: comparing floating point with == or != is unsafe

Groove 7 years ago
parent
commit
ef955b2bf5
2 changed files with 4 additions and 4 deletions
  1. 2 2
      test/core/core_force_pure.cpp
  2. 2 2
      test/core/core_type_vec2.cpp

+ 2 - 2
test/core/core_force_pure.cpp

@@ -112,8 +112,8 @@ int test_vec4_ctor()
 #	endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR
 #	endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR
 
 
 	{
 	{
-		glm::vec4 A(1);
-		glm::vec4 B(1, 1, 1, 1);
+		glm::ivec4 A(1);
+		glm::ivec4 B(1, 1, 1, 1);
 		
 		
 		Error += A == B ? 0 : 1;
 		Error += A == B ? 0 : 1;
 	}
 	}

+ 2 - 2
test/core/core_type_vec2.cpp

@@ -18,8 +18,8 @@ static int test_operators()
 	int Error = 0;
 	int Error = 0;
 
 
 	{
 	{
-		glm::vec2 A(1.0f);
-		glm::vec2 B(1.0f);
+		glm::ivec2 A(1.0f);
+		glm::ivec2 B(1.0f);
 		Error += A != B ? 1 : 0;
 		Error += A != B ? 1 : 0;
 		Error += A == B ? 0 : 1;
 		Error += A == B ? 0 : 1;
 	}
 	}