mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
fix up some memory leaks in unit tests
This commit is contained in:
parent
68f6c02899
commit
2be84dd3e8
@ -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);
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user