diff --git a/test/gtc/gtc_packing.cpp b/test/gtc/gtc_packing.cpp index 5f9cb2a3..239417f7 100644 --- a/test/gtc/gtc_packing.cpp +++ b/test/gtc/gtc_packing.cpp @@ -69,11 +69,11 @@ int test_Half1x16() for(std::size_t i = 0; i < Tests.size(); ++i) { - glm::uint32 p0 = glm::packHalf1x16(Tests[i]); + glm::uint16 p0 = glm::packHalf1x16(Tests[i]); float v0 = glm::unpackHalf1x16(p0); - glm::uint32 p1 = glm::packHalf1x16(v0); + glm::uint16 p1 = glm::packHalf1x16(v0); float v1 = glm::unpackHalf1x16(p1); - Error += (v0 == v1) ? 0 : 1; + Error += glm::epsilonEqual(v0, v1, glm::epsilon()) ? 0 : 1; } return Error; @@ -294,7 +294,7 @@ int test_packUnorm1x16() for(std::size_t i = 0; i < A.size(); ++i) { glm::vec1 B(A[i]); - glm::uint32 C = glm::packUnorm1x16(B.x); + glm::uint16 C = glm::packUnorm1x16(B.x); glm::vec1 D(glm::unpackUnorm1x16(C)); Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; assert(!Error); @@ -316,7 +316,7 @@ int test_packSnorm1x16() for(std::size_t i = 0; i < A.size(); ++i) { glm::vec1 B(A[i]); - glm::uint32 C = glm::packSnorm1x16(B.x); + glm::uint16 C = glm::packSnorm1x16(B.x); glm::vec1 D(glm::unpackSnorm1x16(C)); Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; } diff --git a/test/gtx/gtx_matrix_factorisation.cpp b/test/gtx/gtx_matrix_factorisation.cpp index d2522f58..ac3ec92f 100644 --- a/test/gtx/gtx_matrix_factorisation.cpp +++ b/test/gtx/gtx_matrix_factorisation.cpp @@ -1,5 +1,7 @@ #define GLM_ENABLE_EXPERIMENTAL #include +#include +#include float const epsilon = 1e-10f; @@ -33,7 +35,7 @@ int test_qr(matType m) //Test if the matrix r is upper triangular for (glm::length_t i = 0; i < C; i++) for (glm::length_t j = i + 1; j < (C < R ? C : R); j++) - Error += r[i][j] != 0 ? 1 : 0; + Error += glm::epsilonEqual(r[i][j], static_cast(0), glm::epsilon()) ? 0 : 1; return Error; } @@ -70,7 +72,7 @@ int test_rq(matType m) //Test if the matrix r is upper triangular for (glm::length_t i = 0; i < (C < R ? C : R); i++) for (glm::length_t j = R - (C < R ? C : R) + i + 1; j < R; j++) - Error += r[i][j] != 0 ? 1 : 0; + Error += glm::epsilonEqual(r[i][j], static_cast(0), glm::epsilon()) ? 0 : 1; return Error; }