mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-10-31 15:20:13 +00:00
[bitmaps] add a big unit test on wiping
This commit is contained in:
parent
d095ba9bb7
commit
a3a4f40fa0
@ -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_));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user