Browse Source

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

Groove 7 years ago
parent
commit
a7e0e8387b
2 changed files with 8 additions and 6 deletions
  1. 6 6
      test/ext/ext_vec1.cpp
  2. 2 0
      test/gtc/gtc_type_ptr.cpp

+ 6 - 6
test/ext/ext_vec1.cpp

@@ -10,8 +10,8 @@ static int test_vec1_operators()
 {
 	int Error(0);
 
-	glm::vec1 A(1.0f);
-	glm::vec1 B(1.0f);
+	glm::ivec1 A(1.0f);
+	glm::ivec1 B(1.0f);
 	{
 		bool R = A != B;
 		bool S = A == B;
@@ -20,10 +20,10 @@ static int test_vec1_operators()
 	}
 
 	{
-		A *= 1.0f;
-		B *= 1.0;
-		A += 1.0f;
-		B += 1.0;
+		A *= 1;
+		B *= 1;
+		A += 1;
+		B += 1;
 
 		bool R = A != B;
 		bool S = A == B;

+ 2 - 0
test/gtc/gtc_type_ptr.cpp

@@ -1,5 +1,7 @@
 #include <glm/gtc/type_ptr.hpp>
 #include <glm/gtc/vec1.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_relational.hpp>
 
 int test_value_ptr_vec()
 {