diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 7c1627bf..eace0aba 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -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) diff --git a/test/core/core_setup_force_size_t_length.cpp b/test/core/core_setup_force_size_t_length.cpp new file mode 100644 index 00000000..36010e31 --- /dev/null +++ b/test/core/core_setup_force_size_t_length.cpp @@ -0,0 +1,22 @@ +#define GLM_FORCE_SIZE_T_LENGTH +#include +#include + +template +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; +}