add BitmapMoveOffscreen unit test #1646

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

@ -665,5 +665,30 @@ TEST_CASE("Bitmaps") {
}
#endif
SUBCASE("BitmapMoveOffscreen") {
// 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 = 0, .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 = 0 ; i <= ncplane_dim_y(n_) ; ++i){
CHECK(0 == ncplane_move_yx(n, i, 0));
CHECK(0 == notcurses_render(nc_));
}
REQUIRE(nullptr != n);
}
CHECK(!notcurses_stop(nc_));
}

Loading…
Cancel
Save