Added simple test for the float->4ub color conversion
This was SVN commit r6154.
This commit is contained in:
parent
6f0be5ce94
commit
d977cdc89b
23
source/graphics/tests/test_Color.h
Normal file
23
source/graphics/tests/test_Color.h
Normal 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
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user