Platformer in OpenGL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
872 B

5 years ago
  1. #include <glm/ext/scalar_relational.hpp>
  2. int test_equal()
  3. {
  4. # if GLM_CONFIG_CONSTEXP == GLM_ENABLE
  5. static_assert(glm::equal(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr");
  6. static_assert(!glm::equal(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr");
  7. # endif
  8. int Error = 0;
  9. Error += glm::equal(1.01f, 1.02f, 0.1f) ? 0 : 1;
  10. Error += !glm::equal(1.01f, 1.02f, 0.001f) ? 0 : 1;
  11. return Error;
  12. }
  13. int test_notEqual()
  14. {
  15. # if GLM_CONFIG_CONSTEXP == GLM_ENABLE
  16. static_assert(glm::notEqual(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr");
  17. static_assert(!glm::notEqual(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr");
  18. # endif
  19. int Error = 0;
  20. Error += glm::notEqual(1.01f, 1.02f, 0.001f) ? 0 : 1;
  21. Error += !glm::notEqual(1.01f, 1.02f, 0.1f) ? 0 : 1;
  22. return Error;
  23. }
  24. int main()
  25. {
  26. int Error = 0;
  27. Error += test_equal();
  28. Error += test_notEqual();
  29. return Error;
  30. }