new unit test BitmapMoveOffscreenUp #1405

pull/2122/head
nick black 3 years ago
parent d7d9f7bd92
commit dd916d54eb
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -665,7 +665,7 @@ TEST_CASE("Bitmaps") {
}
#endif
SUBCASE("BitmapMoveOffscreen") {
SUBCASE("BitmapMoveOffscreenDown") {
// first, assemble a visual equivalent to 2x2 cells
auto y = nc_->tcache.cellpixy * 2;
auto x = nc_->tcache.cellpixx * 2;
@ -690,5 +690,30 @@ TEST_CASE("Bitmaps") {
REQUIRE(nullptr != n);
}
SUBCASE("BitmapMoveOffscreenUp") {
// first, assemble a visual equivalent to 2x2 cells
auto y = nc_->tcache.cellpixy * 2;
auto x = nc_->tcache.cellpixx * 2;
std::vector<uint32_t> v(x * y * 4, htole(0xffccccff));
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
REQUIRE(nullptr != ncv);
struct ncvisual_options vopts = {
.n = nullptr,
.scaling = NCSCALE_NONE,
.y = ncplane_dim_y(n_) - 3, .x = 0,
.begy = 0, .begx = 0,
.leny = 0, .lenx = 0,
.blitter = NCBLIT_PIXEL,
.flags = NCVISUAL_OPTION_NODEGRADE,
.transcolor = 0,
};
auto n = ncvisual_render(nc_, ncv, &vopts);
for(int i = ncplane_dim_y(n_) - 3 ; i >= 0 ; --i){
CHECK(0 == ncplane_move_yx(n, i, 0));
CHECK(0 == notcurses_render(nc_));
}
REQUIRE(nullptr != n);
}
CHECK(!notcurses_stop(nc_));
}

Loading…
Cancel
Save