libcruft-util/test/colour.cpp
Danny Robson f6056153e3 rename root namespace from util to cruft
This places, at long last, the core library code into the same namespace
as the extended library code.
2018-08-05 14:42:02 +10:00

21 lines
417 B
C++

#include "colour.hpp"
#include "tap.hpp"
int
main (int, char**)
{
cruft::TAP::logger tap;
// Check casting works between intergral and floating formats
{
cruft::srgba<4,float> f {1.f};
cruft::srgba<4,uint8_t> u {255};
tap.expect_eq (f.cast<uint8_t> (), u, "cast float to u8");
tap.expect_eq (u.cast<float> (), f, "cast u8 to float");
}
return tap.status ();
}