49TEST(SnesColorTest, ConvertSnesToRGB_Binary) {
50 uint16_t red = 0b0000000000011111;
51 uint16_t blue = 0b0111110000000000;
52 uint16_t green = 0b0000001111100000;
53 uint16_t purple = 0b0111110000011111;
56 testcolor = ConvertSnestoRGB(red);
57 ASSERT_EQ(0xFF0000, test_convert(testcolor));
58 testcolor = ConvertSnestoRGB(green);
59 ASSERT_EQ(0x00FF00, test_convert(testcolor));
60 testcolor = ConvertSnestoRGB(blue);
61 ASSERT_EQ(0x0000FF, test_convert(testcolor));
62 testcolor = ConvertSnestoRGB(purple);
63 ASSERT_EQ(0xFF00FF, test_convert(testcolor));
66TEST(SnesColorTest, Extraction) {
68 char data[8] = {0x1F, 0x00, 0x00, 0x7C,
static_cast<char>(0xE0),
70 auto pal = Extract(data, 0, 4);
71 ASSERT_EQ(4, pal.size());
72 ASSERT_EQ(0xFF0000, test_convert(pal[0]));
73 ASSERT_EQ(0x0000FF, test_convert(pal[1]));
74 ASSERT_EQ(0x00FF00, test_convert(pal[2]));
75 ASSERT_EQ(0xFF00FF, test_convert(pal[3]));
78TEST(SnesColorTest, Convert) {
80 char data[10] = {0x1F,
84 static_cast<char>(0xE0),
88 static_cast<char>(0xFF),
90 auto pal = Extract(data, 0, 5);
92 EXPECT_EQ(10, snes_string.size());
93 EXPECT_THAT(data, ElementsAreArray(snes_string.data(), 10));