adapt test to new ncplane_putc() api

This commit is contained in:
nick black 2019-11-24 15:32:38 -05:00 committed by Nick Black
parent 0ae550f5d1
commit 879009ff9a
2 changed files with 6 additions and 6 deletions

View File

@ -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_));
} }

View File

@ -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);