Advertisement
cepxuozab

TileGetPixel

Jun 28th, 2024 (edited)
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. void CheckTileFill(const Tile &tile, char color){
  2.         for (auto i = 0; i < Tile::SIZE; ++i){
  3.             for (auto j = 0; j < Tile::SIZE; ++j){
  4.                 ASSERT_EQUAL(tile.GetPixel({i, j}), color);
  5.             }
  6.         }
  7.     }
  8.  
  9. void TileGetPixel(){
  10.         const char color = '#';
  11.         const Tile tile(color);
  12.         CheckTileFill(tile, color);
  13.         ASSERT_EQUAL(tile.GetPixel({Tile::SIZE, Tile::SIZE}), ' ');
  14.         ASSERT_EQUAL(tile.GetPixel({Tile::SIZE + 1, Tile::SIZE}), ' ');
  15.         ASSERT_EQUAL(tile.GetPixel({Tile::SIZE, Tile::SIZE + 1}), ' ');
  16.         ASSERT_EQUAL(tile.GetPixel({Tile::SIZE + 100, Tile::SIZE + 10}), ' ');
  17.         ASSERT_EQUAL(tile.GetPixel({-1, 1}), ' ');
  18.         ASSERT_EQUAL(tile.GetPixel({1, -1}), ' ');
  19.         ASSERT_EQUAL(tile.GetPixel({-1, -1}), ' ');
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement