mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
39 lines
792 B
C++
39 lines
792 B
C++
|
#include "main.h"
|
||
|
|
||
|
class InputTest : public :: testing::Test {
|
||
|
protected:
|
||
|
void SetUp() override {
|
||
|
setlocale(LC_ALL, "");
|
||
|
if(getenv("TERM") == nullptr){
|
||
|
GTEST_SKIP();
|
||
|
}
|
||
|
notcurses_options nopts{};
|
||
|
nopts.inhibit_alternate_screen = true;
|
||
|
nopts.suppress_bannner = true;
|
||
|
outfp_ = fopen("/dev/tty", "wb");
|
||
|
ASSERT_NE(nullptr, outfp_);
|
||
|
nc_ = notcurses_init(&nopts, outfp_);
|
||
|
ASSERT_NE(nullptr, nc_);
|
||
|
}
|
||
|
|
||
|
void TearDown() override {
|
||
|
if(nc_){
|
||
|
EXPECT_EQ(0, notcurses_stop(nc_));
|
||
|
}
|
||
|
if(outfp_){
|
||
|
fclose(outfp_);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
struct notcurses* nc_{};
|
||
|
FILE* outfp_{};
|
||
|
};
|
||
|
|
||
|
TEST_F(InputTest, TestMouseOn){
|
||
|
ASSERT_EQ(0, notcurses_mouse_enable(nc_));
|
||
|
}
|
||
|
|
||
|
TEST_F(InputTest, TestMouseOff){
|
||
|
ASSERT_EQ(0, notcurses_mouse_disable(nc_));
|
||
|
}
|