diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-25 00:55:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-25 00:55:33 +0300 |
commit | 69aaf75b49cdf385b03469b82dd05480abf6e8b5 (patch) | |
tree | b2a14ea29c6bdd5b06f4812a378bd1f5325f206d /src/resources/dye/dye_unittest.cc | |
parent | 3480f3ad939e2ae5d0191ed739a57e834658c32e (diff) | |
download | manaplus-69aaf75b49cdf385b03469b82dd05480abf6e8b5.tar.gz manaplus-69aaf75b49cdf385b03469b82dd05480abf6e8b5.tar.bz2 manaplus-69aaf75b49cdf385b03469b82dd05480abf6e8b5.tar.xz manaplus-69aaf75b49cdf385b03469b82dd05480abf6e8b5.zip |
Switch in replaceSOGLColor into using custom despatcher.
Diffstat (limited to 'src/resources/dye/dye_unittest.cc')
-rw-r--r-- | src/resources/dye/dye_unittest.cc | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/src/resources/dye/dye_unittest.cc b/src/resources/dye/dye_unittest.cc index 5d2cfdb8d..6d6e6028e 100644 --- a/src/resources/dye/dye_unittest.cc +++ b/src/resources/dye/dye_unittest.cc @@ -69,7 +69,7 @@ TEST_CASE("Dye replaceSOGLColor 1 1", "") DyePalette palette("#00ff00,000011", 6); uint32_t data[1]; data[0] = buildHex(0x01, 0x02, 0x03, 0x10); - palette.replaceSOGLColor(&data[0], 1); + DYEPALETTE(palette, SOGLColor)(&data[0], 1); REQUIRE(data[0] == buildHex(0x01, 0x02, 0x03, 0x10)); } @@ -78,7 +78,7 @@ TEST_CASE("Dye replaceSOGLColor 1 2", "") DyePalette palette("#01ff02,030411", 6); uint32_t data[1]; data[0] = buildHex(0x20, 0x02, 0xff, 0x01); - palette.replaceSOGLColor(&data[0], 1); + DYEPALETTE(palette, SOGLColor)(&data[0], 1); REQUIRE(data[0] == buildHex(0x20, 0x11, 0x04, 0x03)); } @@ -87,7 +87,7 @@ TEST_CASE("Dye replaceSOGLColor 1 3", "") DyePalette palette("#404040,200000,0100ee,102030", 6); uint32_t data[1]; data[0] = buildHex(0x40, 0xee, 0x00, 0x01); - palette.replaceSOGLColor(&data[0], 1); + DYEPALETTE(palette, SOGLColor)(&data[0], 1); REQUIRE(data[0] == buildHex(0x40, 0x30, 0x20, 0x10)); } @@ -97,7 +97,7 @@ TEST_CASE("Dye replaceSOGLColor 2 1", "") uint32_t data[2]; data[0] = buildHex(0x20, 0x02, 0xff, 0x01); data[1] = buildHex(0x30, 0x02, 0xff, 0x01); - palette.replaceSOGLColor(&data[0], 2); + DYEPALETTE(palette, SOGLColor)(&data[0], 2); REQUIRE(data[0] == buildHex(0x20, 0x11, 0x04, 0x03)); REQUIRE(data[1] == buildHex(0x30, 0x11, 0x04, 0x03)); } @@ -110,7 +110,7 @@ TEST_CASE("Dye replaceSOGLColor 4 1", "") data[1] = buildHex(0x30, 0x02, 0xff, 0x01); data[2] = buildHex(0x40, 0x02, 0xff, 0x01); data[3] = buildHex(0x50, 0x02, 0xff, 0x02); - palette.replaceSOGLColor(&data[0], 4); + DYEPALETTE(palette, SOGLColor)(&data[0], 4); REQUIRE(data[0] == buildHex(0x20, 0x11, 0x04, 0x03)); REQUIRE(data[1] == buildHex(0x30, 0x11, 0x04, 0x03)); REQUIRE(data[2] == buildHex(0x40, 0x11, 0x04, 0x03)); @@ -129,7 +129,7 @@ TEST_CASE("Dye replaceSOGLColor 8 1", "") data[5] = buildHex(0x30, 0x02, 0xff, 0x01); data[6] = buildHex(0x40, 0x02, 0xff, 0x01); data[7] = buildHex(0x60, 0x02, 0xff, 0x02); - palette.replaceSOGLColor(&data[0], 8); + DYEPALETTE(palette, SOGLColor)(&data[0], 8); REQUIRE(data[0] == buildHex(0x20, 0x11, 0x04, 0x03)); REQUIRE(data[1] == buildHex(0x30, 0x11, 0x04, 0x03)); REQUIRE(data[2] == buildHex(0x40, 0x11, 0x04, 0x03)); @@ -216,29 +216,6 @@ TEST_CASE("Dye replaceSOGLColor 8 1 default", "") REQUIRE(data[7] == buildHex(0x60, 0x02, 0xff, 0x02)); } -TEST_CASE("Dye replaceSOGLColor 8 1 simd", "") -{ - DyePalette palette("#01ff02,030411,01ee02,010203", 6); - uint32_t data[8]; - data[0] = buildHex(0x20, 0x02, 0xff, 0x01); - data[1] = buildHex(0x30, 0x02, 0xff, 0x01); - data[2] = buildHex(0x40, 0x02, 0xff, 0x01); - data[3] = buildHex(0x50, 0x02, 0xff, 0x02); - data[4] = buildHex(0x20, 0x02, 0xff, 0x01); - data[5] = buildHex(0x30, 0x02, 0xff, 0x01); - data[6] = buildHex(0x40, 0x02, 0xff, 0x01); - data[7] = buildHex(0x60, 0x02, 0xff, 0x02); - palette.replaceSOGLColorSimd(&data[0], 8); - REQUIRE(data[0] == buildHex(0x20, 0x11, 0x04, 0x03)); - REQUIRE(data[1] == buildHex(0x30, 0x11, 0x04, 0x03)); - REQUIRE(data[2] == buildHex(0x40, 0x11, 0x04, 0x03)); - REQUIRE(data[3] == buildHex(0x50, 0x02, 0xff, 0x02)); - REQUIRE(data[4] == buildHex(0x20, 0x11, 0x04, 0x03)); - REQUIRE(data[5] == buildHex(0x30, 0x11, 0x04, 0x03)); - REQUIRE(data[6] == buildHex(0x40, 0x11, 0x04, 0x03)); - REQUIRE(data[7] == buildHex(0x60, 0x02, 0xff, 0x02)); -} - TEST_CASE("Dye replaceSOGLColor 8 1 sse2", "") { DyePalette palette("#01ff02,030411,01ee02,010203", 6); @@ -251,7 +228,7 @@ TEST_CASE("Dye replaceSOGLColor 8 1 sse2", "") data[5] = buildHex(0x30, 0x02, 0xff, 0x01); data[6] = buildHex(0x40, 0x02, 0xff, 0x01); data[7] = buildHex(0x60, 0x02, 0xff, 0x02); - palette.replaceSOGLColorSse2(&data[0], 8); + DYEPALETTE(palette, SOGLColorSse2)(&data[0], 8); REQUIRE(data[0] == buildHex(0x20, 0x11, 0x04, 0x03)); REQUIRE(data[1] == buildHex(0x30, 0x11, 0x04, 0x03)); REQUIRE(data[2] == buildHex(0x40, 0x11, 0x04, 0x03)); @@ -274,7 +251,7 @@ TEST_CASE("Dye replaceSOGLColor 8 1 avx2", "") data[5] = buildHex(0x30, 0x02, 0xff, 0x01); data[6] = buildHex(0x40, 0x02, 0xff, 0x01); data[7] = buildHex(0x60, 0x02, 0xff, 0x02); - palette.replaceSOGLColorAvx2(&data[0], 8); + DYEPALETTE(palette, SOGLColorAvx2)(&data[0], 8); REQUIRE(data[0] == buildHex(0x20, 0x11, 0x04, 0x03)); REQUIRE(data[1] == buildHex(0x30, 0x11, 0x04, 0x03)); REQUIRE(data[2] == buildHex(0x40, 0x11, 0x04, 0x03)); |