[bitmaps] add a big unit test on wiping

This commit is contained in:
nick black 2021-03-27 03:47:12 -04:00 committed by Nick Black
parent d095ba9bb7
commit a3a4f40fa0

View File

@ -28,6 +28,7 @@ TEST_CASE("Pixel") {
REQUIRE(ncv);
struct ncvisual_options vopts{};
vopts.blitter = NCBLIT_PIXEL;
vopts.flags = NCVISUAL_OPTION_NODEGRADE;
auto newn = ncvisual_render(nc_, ncv, &vopts);
CHECK(newn);
CHECK(0 == notcurses_render(nc_));
@ -149,5 +150,28 @@ TEST_CASE("Pixel") {
CHECK(0 == notcurses_render(nc_));
}
#ifdef NOTCURSES_USE_MULTIMEDIA
SUBCASE("PixelWipeScreen") {
auto ncv = ncvisual_from_file(find_data("worldmap.png"));
REQUIRE(ncv);
struct ncvisual_options vopts{};
vopts.blitter = NCBLIT_PIXEL;
vopts.flags = NCVISUAL_OPTION_NODEGRADE;
auto newn = ncvisual_render(nc_, ncv, &vopts);
CHECK(newn);
CHECK(0 == notcurses_render(nc_));
const auto s = newn->sprite;
for(int y = 0 ; y < s->dimy ; ++y){
for(int x = 0 ; x < s->dimx ; ++x){
CHECK(0 == sprite_wipe_cell(nc_, s, y, x));
CHECK(0 == notcurses_render(nc_));
}
}
ncplane_destroy(newn);
CHECK(0 == notcurses_render(nc_));
ncvisual_destroy(ncv);
}
#endif
CHECK(!notcurses_stop(nc_));
}