- Fixed GLM_FORCE_SIZE_T_LENGTH and add test coverage #624

This commit is contained in:
Christophe Riccio 2017-06-04 10:50:47 +02:00
parent 2834d7376a
commit 83602bdea4
2 changed files with 23 additions and 0 deletions

View File

@ -33,6 +33,7 @@ glmCreateTestGTC(core_func_trigonometric)
glmCreateTestGTC(core_func_vector_relational)
glmCreateTestGTC(core_func_swizzle)
glmCreateTestGTC(core_setup_force_cxx98)
glmCreateTestGTC(core_setup_force_size_t_length)
glmCreateTestGTC(core_setup_message)
glmCreateTestGTC(core_setup_precision)

View File

@ -0,0 +1,22 @@
#define GLM_FORCE_SIZE_T_LENGTH
#include <glm/glm.hpp>
#include <glm/ext.hpp>
template <typename genType>
genType add(genType const& a, genType const& b)
{
genType result(0);
for(glm::length_t i = 0; i < a.length(); ++i)
result[i] = a[i] + b[i];
return result;
}
int main()
{
int Error = 0;
glm::ivec4 v(1);
Error += add(v, v) == glm::ivec4(2) ? 0 : 1;
return Error;
}