diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-19 22:59:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-19 23:03:59 +0300 |
commit | a786b399d67f8aac79ded71bd1f0e0999ce3a0bb (patch) | |
tree | 7a363ca7a499e86452acc4b2bb2d0205da461caf /src/resources/dye_unittest.cc | |
parent | fe9994c45c1e464125186ae14e482ae155d9ec53 (diff) | |
download | plus-a786b399d67f8aac79ded71bd1f0e0999ce3a0bb.tar.gz plus-a786b399d67f8aac79ded71bd1f0e0999ce3a0bb.tar.bz2 plus-a786b399d67f8aac79ded71bd1f0e0999ce3a0bb.tar.xz plus-a786b399d67f8aac79ded71bd1f0e0999ce3a0bb.zip |
add some unit tests for normal dye.
Diffstat (limited to 'src/resources/dye_unittest.cc')
-rw-r--r-- | src/resources/dye_unittest.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/resources/dye_unittest.cc b/src/resources/dye_unittest.cc index 5898f5665..05e3401a6 100644 --- a/src/resources/dye_unittest.cc +++ b/src/resources/dye_unittest.cc @@ -206,3 +206,49 @@ TEST(Dye, replaceAColor3) EXPECT_EQ(0x20, data[2]); EXPECT_EQ(0x10, data[3]); } + +TEST(Dye, normalDye1) +{ + Dye dye("R:#203040,506070"); + uint8_t data[4]; + data[0] = 0x55; + data[1] = 0x00; + data[2] = 0x00; + data[3] = 0x50; + dye.normalDye(reinterpret_cast<uint32_t*>(&data[0]), 1); + EXPECT_EQ(0x55, data[0]); + EXPECT_EQ(0x28, data[1]); + EXPECT_EQ(0x1e, data[2]); + EXPECT_EQ(0x14, data[3]); +} + +TEST(Dye, normalDye2) +{ + Dye dye("G:#203040,506070"); + uint8_t data[4]; + data[0] = 0x60; + data[1] = 0x00; + data[2] = 0x50; + data[3] = 0x00; + dye.normalDye(reinterpret_cast<uint32_t*>(&data[0]), 1); + EXPECT_EQ(0x60, data[0]); + EXPECT_EQ(0x28, data[1]); + EXPECT_EQ(0x1e, data[2]); + EXPECT_EQ(0x14, data[3]); +} + +TEST(Dye, normalOGLDye1) +{ + Dye dye("R:#203040,506070"); + uint8_t data[4]; + data[0] = 0x55; + data[1] = 0x00; + data[2] = 0x00; + data[3] = 0x50; + dye.normalOGLDye(reinterpret_cast<uint32_t*>(&data[0]), 1); + EXPECT_EQ(0x15, data[0]); + EXPECT_EQ(0x20, data[1]); + EXPECT_EQ(0x2a, data[2]); + EXPECT_EQ(0x50, data[3]); +} + |