From b51f4e89817c8d41fab2b693786f60f11fcc7e6e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 14 Nov 2015 13:25:06 +0100 Subject: [PATCH] Added test --- test/core/core_func_packing.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/core/core_func_packing.cpp b/test/core/core_func_packing.cpp index 411121bc..52f606eb 100644 --- a/test/core/core_func_packing.cpp +++ b/test/core/core_func_packing.cpp @@ -80,7 +80,13 @@ int test_packSnorm2x16() int test_packUnorm4x8() { int Error = 0; - + + glm::uint32 Packed = glm::packUnorm4x8(glm::vec4(1.0f, 0.5f, 0.0f, 1.0f)); + glm::u8vec4 Vec(255, 128, 0, 255); + glm::uint32 & Ref = *reinterpret_cast(&Vec[0]); + + Error += Packed == Ref ? 0 : 1; + std::vector A; A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f)); A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f));