diff --git a/tests/ncplane.cpp b/tests/ncplane.cpp index 6fd3e7b5a..12a2c9cee 100644 --- a/tests/ncplane.cpp +++ b/tests/ncplane.cpp @@ -539,12 +539,18 @@ TEST_CASE("NCPlane") { REQUIRE(0 == ncplane_putstr(n_, STR3)); REQUIRE(0 == ncplane_cursor_move_yx(n_, 0, 0)); REQUIRE(0 < ncplane_at_cursor_cell(n_, &testcell)); // want first char of STR1 - CHECK(!strcmp("Σ", cell_extended_gcluster(n_, &testcell))); + auto cstr = cell_strdup(n_, &testcell); + REQUIRE(nullptr != cstr); + CHECK(!strcmp("Σ", cstr)); + free(cstr); CHECK(0 == testcell.attrword); CHECK(0 == testcell.channels); REQUIRE(0 == ncplane_cursor_move_yx(n_, 1, dimx - mbstowcs(nullptr, STR2, 0))); REQUIRE(0 < ncplane_at_cursor_cell(n_, &testcell)); // want first char of STR2 - CHECK(!strcmp("α", cell_extended_gcluster(n_, &testcell))); + cstr = cell_strdup(n_, &testcell); + REQUIRE(nullptr != cstr); + CHECK(!strcmp("α", cstr)); + free(cstr); CHECK(0 == testcell.attrword); CHECK(0 == testcell.channels); // FIXME maybe check all cells? diff --git a/tests/wide.cpp b/tests/wide.cpp index 848bf6706..fd24404a0 100644 --- a/tests/wide.cpp +++ b/tests/wide.cpp @@ -73,11 +73,16 @@ TEST_CASE("Wide") { CHECK(0 == ncplane_cursor_move_yx(n_, 0, x)); cell testcell = CELL_TRIVIAL_INITIALIZER; REQUIRE(0 < ncplane_at_cursor_cell(n_, &testcell)); - CHECK(!strcmp(cell_extended_gcluster(n_, &tcell), - cell_extended_gcluster(n_, &testcell))); + auto cstr1 = cell_strdup(n_, &tcell); + auto cstr2 = cell_strdup(n_, &testcell); + CHECK(!strcmp(cstr1, cstr2)); + free(cstr1); free(cstr2); CHECK(0 == testcell.attrword); wchar_t w; - REQUIRE(0 < mbtowc(&w, cell_extended_gcluster(n_, &tcell), MB_CUR_MAX)); + auto cstr = cell_strdup(n_, &tcell); + REQUIRE(cstr); + REQUIRE(0 < mbtowc(&w, cstr, MB_CUR_MAX)); + free(cstr); if(wcwidth(w) == 2){ CHECK(CELL_WIDEASIAN_MASK == testcell.channels); ++x;