From faff516c22d68a1c5f60df222a1b87f0d2305536 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 6 May 2011 10:15:12 +0100 Subject: [PATCH] Added int and uint tests --- test/core/core_type_float.cpp | 2 +- test/core/core_type_int.cpp | 41 +++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/test/core/core_type_float.cpp b/test/core/core_type_float.cpp index c21fc9ee..ff9cb5f4 100644 --- a/test/core/core_type_float.cpp +++ b/test/core/core_type_float.cpp @@ -2,7 +2,7 @@ // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-31 -// Updated : 2008-08-31 +// Updated : 2011-05-06 // Licence : This source is under MIT License // File : test/core/type_float.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/test/core/core_type_int.cpp b/test/core/core_type_int.cpp index b1e4b147..035622df 100644 --- a/test/core/core_type_int.cpp +++ b/test/core/core_type_int.cpp @@ -2,14 +2,51 @@ // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-31 -// Updated : 2008-08-31 +// Updated : 2011-05-06 // Licence : This source is under MIT License // File : test/core/type_int.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// #include +int test_int_size() +{ + return + sizeof(glm::int_t) != sizeof(glm::lowp_int) && + sizeof(glm::int_t) != sizeof(glm::mediump_int) && + sizeof(glm::int_t) != sizeof(glm::highp_int); +} + +int test_uint_size() +{ + return + sizeof(glm::uint_t) != sizeof(glm::lowp_uint) && + sizeof(glm::uint_t) != sizeof(glm::mediump_uint) && + sizeof(glm::uint_t) != sizeof(glm::highp_uint); +} + +int test_int_precision() +{ + return ( + sizeof(glm::lowp_int) <= sizeof(glm::mediump_int) && + sizeof(glm::mediump_int) <= sizeof(glm::highp_int)) ? 0 : 1; +} + +int test_uint_precision() +{ + return ( + sizeof(glm::lowp_uint) <= sizeof(glm::mediump_uint) && + sizeof(glm::mediump_uint) <= sizeof(glm::highp_uint)) ? 0 : 1; +} + int main() { - return -1; + int Error = 0; + + Error += test_int_size(); + Error += test_int_precision(); + Error += test_uint_size(); + Error += test_uint_precision(); + + return Error; }