fix up some memory leaks in unit tests

This commit is contained in:
nick black 2021-11-01 22:34:04 -04:00
parent 68f6c02899
commit 2be84dd3e8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 7 additions and 0 deletions

View File

@ -123,6 +123,7 @@ TEST_CASE("Media") {
void* needle = malloc(1);
REQUIRE(nullptr != needle);
struct ncplane* newn = ncplane_dup(ncp_, needle);
free(needle);
int ndimx, ndimy;
REQUIRE(nullptr != newn);
ncvisual_destroy(ncv);

View File

@ -198,6 +198,7 @@ notcurses_debug(nc_, stderr);
// ought yield space with white background FIXME currently just yields
// an upper half block
CHECK(0 == strcmp("\u259a", egc)); // quadrant upper left and lower right
free(egc);
CHECK(0xffffff == ncchannels_fg_rgb(channels));
CHECK(0xffffff == ncchannels_bg_rgb(channels));
CHECK(0 == ncplane_destroy(top));

View File

@ -277,16 +277,21 @@ TEST_CASE("Wide") {
auto egc = notcurses_at_yx(nc_, 0, 0, &c.stylemask, &c.channels);
REQUIRE(nullptr != egc);
CHECK(0 == strcmp("\u5f62", egc));
free(egc);
egc = notcurses_at_yx(nc_, 0, 1, &c.stylemask, &c.channels);
REQUIRE(nullptr != egc);
CHECK(0 == strcmp("", egc));
free(egc);
egc = notcurses_at_yx(nc_, 0, 2, &c.stylemask, &c.channels);
REQUIRE(nullptr != egc);
CHECK(0 == strcmp("\u5168", egc));
free(egc);
egc = notcurses_at_yx(nc_, 0, 3, &c.stylemask, &c.channels);
REQUIRE(nullptr != egc);
free(egc);
egc = notcurses_at_yx(nc_, 0, 4, &c.stylemask, &c.channels);
REQUIRE(nullptr != egc);
free(egc);
}
// If an ncplane is moved atop the right half of a wide glyph, the entire