Advertisement
cepxuozab

ImageGetPixelTest

Sep 4th, 2024
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1.  void ImageGetPixelTest(){
  2.       auto side = Tile::SIZE;
  3.       Size size{side * 2 + 3, side * 2 + 5};
  4.       const char color = 'g';
  5.       const Image img(size, color);
  6.       for (auto x = 0; x < size.width; ++x){
  7.         for (auto y = 0; y < size.height; ++y){
  8.           ASSERT_EQUAL(img.GetPixel({x, y}), color);
  9.         }
  10.       }
  11.      
  12.       char blank = ' ';
  13.       ASSERT_EQUAL(img.GetPixel({-1, 2}), blank);
  14.       ASSERT_EQUAL(img.GetPixel({1, -2}), blank);
  15.       ASSERT_EQUAL(img.GetPixel({side*5, 2}), blank);
  16.       ASSERT_EQUAL(img.GetPixel({2, side*5}), blank);
  17.     }
  18.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement