From 75156cedc3b14c884ce6b5456040a36f8d455afc Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 15 Jan 2015 14:03:44 +1100 Subject: [PATCH] colour: remove redundant rgba member variables --- colour.hpp | 5 ----- test/Makefile.am | 1 + test/colour.cpp | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 test/colour.cpp diff --git a/colour.hpp b/colour.hpp index c9802eee..ff77374f 100644 --- a/colour.hpp +++ b/colour.hpp @@ -32,11 +32,6 @@ namespace util { struct colour : public detail::coord<4, T> { using detail::coord<4,T>::coord; - T r; - T g; - T b; - T a; - static const colour WHITE; static const colour BLACK; static const colour RED; diff --git a/test/Makefile.am b/test/Makefile.am index 8e0c48c9..04ed9da6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -5,6 +5,7 @@ TEST_BIN = \ backtrace \ bitwise \ checksum \ + colour \ float \ hton \ ip \ diff --git a/test/colour.cpp b/test/colour.cpp new file mode 100644 index 00000000..9204da88 --- /dev/null +++ b/test/colour.cpp @@ -0,0 +1,16 @@ +#include "colour.hpp" + +#include "debug.hpp" + +int +main (int, char**) +{ + CHECK_EQ (&util::colour4f::WHITE.x, + &util::colour4f::WHITE.r); + + CHECK_EQ (util::colour4f::WHITE.x, 1.f); + CHECK_EQ (util::colour4f::WHITE.r, 1.f); + CHECK_EQ (util::colour4f::WHITE.g, 1.f); + CHECK_EQ (util::colour4f::WHITE.b, 1.f); + CHECK_EQ (util::colour4f::WHITE.a, 1.f); +}