mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 02:04:35 +00:00
- Fixed GLM_FORCE_SIZE_T_LENGTH and add test coverage #624
This commit is contained in:
parent
2834d7376a
commit
83602bdea4
@ -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)
|
||||
|
||||
|
22
test/core/core_setup_force_size_t_length.cpp
Normal file
22
test/core/core_setup_force_size_t_length.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user