diff --git a/test/core/core_type_float.cpp b/test/core/core_type_float.cpp index 61894e46..7d4c5b4d 100644 --- a/test/core/core_type_float.cpp +++ b/test/core/core_type_float.cpp @@ -20,10 +20,15 @@ int test_float_size() int test_float_precision() { return ( - sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) && + sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) && sizeof(glm::mediump_float) <= sizeof(glm::highp_float)) ? 0 : 1; } +int test_vec2() +{ + return 0; +} + int main() { int Error = 0; diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index 570d5437..0e513cd3 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -91,10 +91,25 @@ int test_vec2_ctor() return Error; } +int test_vec2_size() +{ + int Error = 0; + + Error += sizeof(glm::vec2) == sizeof(glm::mediump_vec2) ? 0 : 1; + Error += 8 == sizeof(glm::mediump_vec2) ? 0 : 1; + Error += sizeof(glm::dvec2) == sizeof(glm::highp_vec2) ? 0 : 1; + Error += 16 == sizeof(glm::highp_vec2) ? 0 : 1; + Error += glm::vec2().length() == 2 ? 0 : 1; + Error += glm::dvec2().length() == 2 ? 0 : 1; + + return Error; +} + int main() { int Error = 0; + Error += test_vec2_size(); Error += test_vec2_ctor(); Error += test_vec2_operators(); diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index a2b7ec49..a7e470e2 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -2,14 +2,14 @@ // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-31 -// Updated : 2008-08-31 +// Updated : 2011-09-19 // Licence : This source is under MIT License // File : test/core/type_vec3.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// #include -static int test_operators() +static int test_vec3_operators() { glm::vec3 A(1.0f); glm::vec3 B(1.0f); @@ -19,11 +19,26 @@ static int test_operators() return (S && !R) ? 0 : 1; } +int test_vec3_size() +{ + int Error = 0; + + Error += sizeof(glm::vec3) == sizeof(glm::mediump_vec3) ? 0 : 1; + Error += 12 == sizeof(glm::mediump_vec3) ? 0 : 1; + Error += sizeof(glm::dvec3) == sizeof(glm::highp_vec3) ? 0 : 1; + Error += 24 == sizeof(glm::highp_vec3) ? 0 : 1; + Error += glm::vec3().length() == 3 ? 0 : 1; + Error += glm::dvec3().length() == 3 ? 0 : 1; + + return Error; +} + int main() { int Error = 0; - Error += test_operators(); + Error += test_vec3_operators(); + Error += test_vec3_size(); return Error; } diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index dd0769bb..23933b18 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -41,7 +41,7 @@ int test_hvec4() return 0; } -static int test_operators() +int test_vec4_operators() { glm::vec4 A(1.0f); glm::vec4 B(1.0f); @@ -51,13 +51,28 @@ static int test_operators() return (S && !R) ? 0 : 1; } +int test_vec4_size() +{ + int Error = 0; + + Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1; + Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::highp_vec4) ? 0 : 1; + Error += 32 == sizeof(glm::highp_vec4) ? 0 : 1; + Error += glm::vec4().length() == 4 ? 0 : 1; + Error += glm::dvec4().length() == 4 ? 0 : 1; + + return Error; +} + int main() { //__m128 DataA = swizzle(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); //__m128 DataB = swizzle(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); int Error = 0; - Error += test_operators(); + Error += test_vec4_size(); + Error += test_vec4_operators(); Error += test_hvec4(); return Error; }