Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CheckTileFill(const Tile &tile, char color){
- for (auto i = 0; i < Tile::SIZE; ++i){
- for (auto j = 0; j < Tile::SIZE; ++j){
- ASSERT_EQUAL(tile.GetPixel({i, j}), color);
- }
- }
- }
- Test:
- const char color = '#';
- Tile tile(color);
- CheckTileFill(tile, color);
- Point p1({1, 2});
- const char color_1 = '1';
- Point p2({5, 3});
- const char color_2 = '2';
- Point p3({0, 0});
- const char color_3 = '3';
- tile.SetPixel(p1, color_1);
- tile.SetPixel(p2, color_2);
- tile.SetPixel(p3, color_3);
- tile.SetPixel({-10, 100}, 's');
- ASSERT_EQUAL(tile.GetPixel(p1), color_1);
- ASSERT_EQUAL(tile.GetPixel(p2), color_2);
- ASSERT_EQUAL(tile.GetPixel(p3), color_3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement