Browse Source

Fixed packing tests

Christophe Riccio 14 years ago
parent
commit
166c75afec
1 changed files with 4 additions and 1 deletions
  1. 4 1
      test/core/core_func_packing.cpp

+ 4 - 1
test/core/core_func_packing.cpp

@@ -124,7 +124,9 @@ int test_packHalf2x16()
 		glm::vec2 B(A[i]);
 		glm::vec2 B(A[i]);
 		glm::uint C = glm::packHalf2x16(B);
 		glm::uint C = glm::packHalf2x16(B);
 		glm::vec2 D = glm::unpackHalf2x16(C);
 		glm::vec2 D = glm::unpackHalf2x16(C);
-		Error += B == D ? 0 : 1;
+		//Error += B == D ? 0 : 1;
+		Error += glm::all(glm::equalEpsilon(B, D, 1.0f / 127.f)) ? 0 : 1;
+		assert(!Error);
 	}
 	}
 	
 	
 	return Error;
 	return Error;
@@ -145,6 +147,7 @@ int test_packDouble2x32()
 		double C = glm::packDouble2x32(B);
 		double C = glm::packDouble2x32(B);
 		glm::u32vec2 D = glm::unpackDouble2x32(C);
 		glm::u32vec2 D = glm::unpackDouble2x32(C);
 		Error += B == D ? 0 : 1;
 		Error += B == D ? 0 : 1;
+		assert(!Error);
 	}
 	}
 	
 	
 	return Error;
 	return Error;