bulk up ResizeThenRotateFromFile test

This commit is contained in:
nick black 2021-06-27 06:30:26 -04:00 committed by Nick Black
parent cbc9a6ce6e
commit 1b32823e42

View File

@ -25,8 +25,6 @@ TEST_CASE("Media") {
SUBCASE("ResizeThenRotateFromFile") {
auto ncv = ncvisual_from_file(find_data("changes.jpg").get());
REQUIRE(nullptr != ncv);
CHECK(0 == ncvisual_resize(ncv, 20, 20));
CHECK(0 == ncvisual_rotate(ncv, M_PI / 2));
struct ncvisual_options vopts{};
vopts.x = NCALIGN_CENTER;
vopts.y = NCALIGN_CENTER;
@ -34,7 +32,24 @@ TEST_CASE("Media") {
auto p = ncvisual_render(nc_, ncv, &vopts);
REQUIRE(nullptr != p);
CHECK(0 == notcurses_render(nc_));
ncplane_destroy(p);
sleep(1);
CHECK(0 == ncplane_destroy(p));
CHECK(0 == ncvisual_resize(ncv, 20, 20));
p = ncvisual_render(nc_, ncv, &vopts);
CHECK(0 == notcurses_render(nc_));
sleep(1);
CHECK(0 == ncplane_destroy(p));
p = ncvisual_render(nc_, ncv, &vopts);
REQUIRE(nullptr != p);
CHECK(0 == notcurses_render(nc_));
sleep(1);
CHECK(0 == ncplane_destroy(p));
CHECK(0 == ncvisual_rotate(ncv, M_PI / 2));
p = ncvisual_render(nc_, ncv, &vopts);
REQUIRE(nullptr != p);
CHECK(0 == notcurses_render(nc_));
sleep(1);
CHECK(0 == ncplane_destroy(p));
ncvisual_destroy(ncv);
}