diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 9b3c64e3..0abc8607 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -24,6 +24,8 @@ glmCreateTestGTC(core_func_noise) glmCreateTestGTC(core_func_packing) glmCreateTestGTC(core_func_trigonometric) glmCreateTestGTC(core_func_vector_relational) +glmCreateTestGTC(core_setup_message) +glmCreateTestGTC(core_setup_precision) diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp new file mode 100644 index 00000000..8b02243b --- /dev/null +++ b/test/core/core_setup_message.cpp @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2011-05-31 +// Updated : 2011-05-31 +// Licence : This source is under MIT License +// File : test/core/setup_message.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include + +static int test_operators() +{ + glm::vec3 A(1.0f); + glm::vec3 B(1.0f); + bool R = A != B; + bool S = A == B; + + return (S && !R) ? 0 : 1; +} + +int main() +{ + int Error = 0; + + Error += test_operators(); + + return Error; +} diff --git a/test/core/core_setup_precision.cpp b/test/core/core_setup_precision.cpp new file mode 100644 index 00000000..05decb5f --- /dev/null +++ b/test/core/core_setup_precision.cpp @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2011-05-31 +// Updated : 2011-05-31 +// Licence : This source is under MIT License +// File : test/core/setup_precision_highp.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_PRECISION_HIGHP_FLOAT +#include + +static int test_mat() +{ + int Error = 0; + + Error += sizeof(glm::mat2) == sizeof(glm::highp_mat2) ? 0 : 1; + Error += sizeof(glm::mat3) == sizeof(glm::highp_mat3) ? 0 : 1; + Error += sizeof(glm::mat4) == sizeof(glm::highp_mat4) ? 0 : 1; + + Error += sizeof(glm::mat2x2) == sizeof(glm::highp_mat2x2) ? 0 : 1; + Error += sizeof(glm::mat2x3) == sizeof(glm::highp_mat2x3) ? 0 : 1; + Error += sizeof(glm::mat2x4) == sizeof(glm::highp_mat2x4) ? 0 : 1; + Error += sizeof(glm::mat3x2) == sizeof(glm::highp_mat3x2) ? 0 : 1; + Error += sizeof(glm::mat3x3) == sizeof(glm::highp_mat3x3) ? 0 : 1; + Error += sizeof(glm::mat3x4) == sizeof(glm::highp_mat3x4) ? 0 : 1; + Error += sizeof(glm::mat4x2) == sizeof(glm::highp_mat4x2) ? 0 : 1; + Error += sizeof(glm::mat4x3) == sizeof(glm::highp_mat4x3) ? 0 : 1; + Error += sizeof(glm::mat4x4) == sizeof(glm::highp_mat4x4) ? 0 : 1; + + return Error; +} + +static int test_vec() +{ + int Error = 0; + + Error += sizeof(glm::vec2) == sizeof(glm::highp_vec2) ? 0 : 1; + Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1; + Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_mat(); + Error += test_vec(); + + return Error; +} diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index 7028d280..577aac24 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -7,7 +7,6 @@ // File : test/core/type_mat4x4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_MESSAGES #define GLM_PRECISION_HIGHP_FLOAT #include #include diff --git a/test/gtc/gtc_half_float.cpp b/test/gtc/gtc_half_float.cpp index 0b9bc908..38b69d03 100644 --- a/test/gtc/gtc_half_float.cpp +++ b/test/gtc/gtc_half_float.cpp @@ -7,7 +7,6 @@ // File : test/gtc/matrix_transform.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_MESSAGES #include #include diff --git a/test/gtc/gtc_matrix_access.cpp b/test/gtc/gtc_matrix_access.cpp index 02b90105..b853b506 100644 --- a/test/gtc/gtc_matrix_access.cpp +++ b/test/gtc/gtc_matrix_access.cpp @@ -7,7 +7,6 @@ // File : test/gtc/matrix_access.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_MESSAGES #include #include diff --git a/test/gtc/gtc_matrix_integer.cpp b/test/gtc/gtc_matrix_integer.cpp index 48686de0..2e8aa78a 100644 --- a/test/gtc/gtc_matrix_integer.cpp +++ b/test/gtc/gtc_matrix_integer.cpp @@ -7,7 +7,6 @@ // File : test/gtc/matrix_integer.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_MESSAGES #include #include diff --git a/test/gtc/gtc_matrix_transform.cpp b/test/gtc/gtc_matrix_transform.cpp index 1ca84115..43ae2bae 100644 --- a/test/gtc/gtc_matrix_transform.cpp +++ b/test/gtc/gtc_matrix_transform.cpp @@ -7,7 +7,6 @@ // File : test/gtc/matrix_transform.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_MESSAGES #include #include diff --git a/test/gtc/gtc_swizzle.cpp b/test/gtc/gtc_swizzle.cpp index 70f266a5..5ed77ae1 100644 --- a/test/gtc/gtc_swizzle.cpp +++ b/test/gtc/gtc_swizzle.cpp @@ -7,7 +7,6 @@ // File : test/gtc/swizzle.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_MESSAGES #include #include diff --git a/test/gtc/gtc_type_ptr.cpp b/test/gtc/gtc_type_ptr.cpp index 043e0db8..f746a1b7 100644 --- a/test/gtc/gtc_type_ptr.cpp +++ b/test/gtc/gtc_type_ptr.cpp @@ -7,7 +7,6 @@ // File : test/gtc/type_ptr.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_MESSAGES #include #include