Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ImageGetPixelTest(){
- auto side = Tile::SIZE;
- Size size{side * 2 + 3, side * 2 + 5};
- const char color = 'g';
- const Image img(size, color);
- for (auto x = 0; x < size.width; ++x){
- for (auto y = 0; y < size.height; ++y){
- ASSERT_EQUAL(img.GetPixel({x, y}), color);
- }
- }
- char blank = ' ';
- ASSERT_EQUAL(img.GetPixel({-1, 2}), blank);
- ASSERT_EQUAL(img.GetPixel({1, -2}), blank);
- ASSERT_EQUAL(img.GetPixel({side*5, 2}), blank);
- ASSERT_EQUAL(img.GetPixel({2, side*5}), blank);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement