check channels in WidePlaneAtopNarrow test #475

This commit is contained in:
nick black 2020-04-14 10:50:53 -04:00
parent 87136c37d3
commit d98f89c167
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -419,34 +419,43 @@ TEST_CASE("Wide") {
uint32_t attrword;
uint64_t channels;
char* egc;
uint64_t widechans = ncplane_channels(n_) | CELL_WIDEASIAN_MASK;
uint64_t narchans = ncplane_channels(topp);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &attrword, &channels)));
CHECK(0 == strcmp(egc, "a"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &attrword, &channels)));
CHECK(0 == strcmp(egc, "b"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &attrword, &channels)));
CHECK(0 == strcmp(egc, "c"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &attrword, &channels)));
CHECK(0 == strcmp(egc, "d"));
CHECK(narchans == channels);
free(egc);
CHECK(0 == ncplane_move_yx(topp, 0, 3));
CHECK(0 == notcurses_render(nc_));
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &attrword, &channels)));
CHECK(0 == strcmp(egc, " "));
@ -456,15 +465,19 @@ TEST_CASE("Wide") {
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &attrword, &channels)));
CHECK(0 == strcmp(egc, "a"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &attrword, &channels)));
CHECK(0 == strcmp(egc, "b"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &attrword, &channels)));
CHECK(0 == strcmp(egc, "c"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &attrword, &channels)));
CHECK(0 == strcmp(egc, "d"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &attrword, &channels)));
CHECK(0 == strcmp(egc, " "));
@ -473,24 +486,30 @@ TEST_CASE("Wide") {
CHECK(0 == notcurses_render(nc_));
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &attrword, &channels)));
CHECK(0 == strcmp(egc, " "));
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &attrword, &channels)));
CHECK(0 == strcmp(egc, "a"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &attrword, &channels)));
CHECK(0 == strcmp(egc, "b"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &attrword, &channels)));
CHECK(0 == strcmp(egc, "c"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &attrword, &channels)));
CHECK(0 == strcmp(egc, "d"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
@ -502,21 +521,26 @@ TEST_CASE("Wide") {
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &attrword, &channels)));
CHECK(0 == strcmp(egc, "a"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &attrword, &channels)));
CHECK(0 == strcmp(egc, "b"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &attrword, &channels)));
CHECK(0 == strcmp(egc, "c"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &attrword, &channels)));
CHECK(0 == strcmp(egc, "d"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &attrword, &channels)));
CHECK(0 == strcmp(egc, " "));
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &attrword, &channels)));
CHECK(0 == strcmp(egc, " "));
@ -525,24 +549,30 @@ TEST_CASE("Wide") {
CHECK(0 == notcurses_render(nc_));
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &attrword, &channels)));
CHECK(0 == strcmp(egc, "a"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &attrword, &channels)));
CHECK(0 == strcmp(egc, "b"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &attrword, &channels)));
CHECK(0 == strcmp(egc, "c"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &attrword, &channels)));
CHECK(0 == strcmp(egc, "d"));
CHECK(narchans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &attrword, &channels)));
CHECK(0 == strcmp(egc, ""));
CHECK(widechans == channels);
free(egc);
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &attrword, &channels)));
CHECK(0 == strcmp(egc, " "));