From 132ed9aa0ec0d915542bdb2069b8168e5b1e158c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 13 Sep 2011 16:15:32 +0100 Subject: [PATCH] Added pack/unpackDouble2x32 tests --- test/core/core_func_packing.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/core/core_func_packing.cpp b/test/core/core_func_packing.cpp index 2741bf95..2eb0aa7a 100644 --- a/test/core/core_func_packing.cpp +++ b/test/core/core_func_packing.cpp @@ -9,6 +9,7 @@ #include #include +#include #include int test_packHalf2x16() @@ -31,11 +32,32 @@ int test_packHalf2x16() return Error; } +int test_packDouble2x32() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::u32vec2( 1, 2)); + A.push_back(glm::u32vec2(-1,-2)); + A.push_back(glm::u32vec2(-1000, 1100)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::u32vec2 B(A[i]); + double C = glm::packDouble2x32(B); + glm::u32vec2 D = glm::unpackDouble2x32(C); + Error += B == D ? 0 : 1; + } + + return Error; +} + int main() { int Error = 0; Error += test_packHalf2x16(); + Error += test_packDouble2x32(); return Error; }