1
0
forked from 0ad/0ad

Added simple test for the float->4ub color conversion

This was SVN commit r6154.
This commit is contained in:
Simon Brenner 2008-06-29 10:13:40 +00:00
parent 6f0be5ce94
commit d977cdc89b

View File

@ -0,0 +1,23 @@
#include "lib/self_test.h"
#include "graphics/Color.h"
class TestColor : public CxxTest::TestSuite
{
public:
void setUp()
{
ColorActivateFastImpl();
}
void test_Color4ub()
{
#define T(r, g, b, ub) TS_ASSERT_EQUALS(ub | 0xff000000, ConvertRGBColorTo4ub(RGBColor(r,g,b)))
T(0, 0, 0, 0x000000);
T(1, 0, 0, 0x0000ff);
T(0, 1, 0, 0x00ff00);
T(0, 0, 1, 0xff0000);
T(1, 1, 1, 0xffffff);
#undef T
}
};