Skip to content

Commit

Permalink
Added more testing for fmin/fmax nan cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron committed Aug 21, 2017
1 parent d75ef41 commit 8150e48
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/gtx/gtx_extended_min_max.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtx/extended_min_max.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/gtc/epsilon.hpp>
Expand All @@ -18,6 +19,9 @@ namespace fmin_
glm::vec1 A0 = glm::fmin(glm::vec1(1), glm::vec1(Zero_f / 0.0f));
Error += glm::epsilonEqual(A0.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;

glm::vec1 A1 = glm::fmin(glm::vec1(Zero_f / 0.0f), glm::vec1(1));
Error += glm::epsilonEqual(A1.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;

glm::vec2 B0 = glm::fmin(glm::vec2(1), glm::vec2(1));
glm::vec2 B1 = glm::fmin(glm::vec2(1), 1.0f);
bool B2 = glm::all(glm::equal(B0, B1));
Expand Down Expand Up @@ -47,6 +51,9 @@ namespace fmax_
glm::vec1 A0 = glm::fmax(glm::vec1(1), glm::vec1(Zero_f / 0.0f));
Error += glm::epsilonEqual(A0.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;

glm::vec1 A1 = glm::fmax(glm::vec1(Zero_f / 0.0f), glm::vec1(1));
Error += glm::epsilonEqual(A0.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;

glm::vec2 B0 = glm::fmax(glm::vec2(1), glm::vec2(1));
glm::vec2 B1 = glm::fmax(glm::vec2(1), 1.0f);
bool B2 = glm::all(glm::equal(B0, B1));
Expand Down

0 comments on commit 8150e48

Please sign in to comment.