mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
adapt test to new ncplane_putc() api
This commit is contained in:
parent
0ae550f5d1
commit
879009ff9a
@ -17,7 +17,6 @@ class CellTest : public :: testing::Test {
|
|||||||
|
|
||||||
void TearDown() override {
|
void TearDown() override {
|
||||||
if(nc_){
|
if(nc_){
|
||||||
EXPECT_EQ(0, ncplane_fg_rgb8(n_, 255, 255, 255));
|
|
||||||
EXPECT_EQ(0, notcurses_render(nc_));
|
EXPECT_EQ(0, notcurses_render(nc_));
|
||||||
EXPECT_EQ(0, notcurses_stop(nc_));
|
EXPECT_EQ(0, notcurses_stop(nc_));
|
||||||
}
|
}
|
||||||
@ -31,11 +30,12 @@ TEST_F(CellTest, SetStyles) {
|
|||||||
cell c;
|
cell c;
|
||||||
memset(&c, 0, sizeof(c));
|
memset(&c, 0, sizeof(c));
|
||||||
cell_set_style(&c, WA_ITALIC);
|
cell_set_style(&c, WA_ITALIC);
|
||||||
cell_load(n_, &c, "s");
|
ASSERT_EQ(1, cell_load(n_, &c, "s"));
|
||||||
EXPECT_EQ(1, ncplane_putc(n_, &c, "s"));
|
EXPECT_EQ(0, ncplane_fg_rgb8(n_, 255, 255, 255));
|
||||||
|
EXPECT_EQ(1, ncplane_putc(n_, &c));
|
||||||
int x, y;
|
int x, y;
|
||||||
ncplane_cursor_yx(n_, &y, &x);
|
ncplane_cursor_yx(n_, &y, &x);
|
||||||
EXPECT_EQ(1, x);
|
EXPECT_EQ(1, x);
|
||||||
EXPECT_EQ(0, y);
|
EXPECT_EQ(0, y);
|
||||||
notcurses_render(nc_);
|
EXPECT_EQ(0, notcurses_render(nc_));
|
||||||
}
|
}
|
||||||
|
@ -103,9 +103,9 @@ TEST_F(NcplaneTest, RejectBadRGB) {
|
|||||||
// Verify we can emit a wide character, and it advances the cursor
|
// Verify we can emit a wide character, and it advances the cursor
|
||||||
TEST_F(NcplaneTest, EmitWchar) {
|
TEST_F(NcplaneTest, EmitWchar) {
|
||||||
const char cchar[] = "✔";
|
const char cchar[] = "✔";
|
||||||
cell c;
|
cell c{};
|
||||||
cell_load(n_, &c, cchar);
|
cell_load(n_, &c, cchar);
|
||||||
EXPECT_EQ(strlen(cchar), ncplane_putc(n_, &c, cchar));
|
EXPECT_EQ(strlen(cchar), ncplane_putc(n_, &c));
|
||||||
int x, y;
|
int x, y;
|
||||||
ncplane_cursor_yx(n_, &y, &x);
|
ncplane_cursor_yx(n_, &y, &x);
|
||||||
EXPECT_EQ(0, y);
|
EXPECT_EQ(0, y);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user