mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 22:23:03 +00:00
only run termios test if stdin is a tty
This commit is contained in:
@@ -24,6 +24,7 @@ void resetTermios(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("init and reset termios") {
|
TEST_CASE("init and reset termios") {
|
||||||
|
if (isatty(STDIN_FILENO)) {
|
||||||
struct termios original;
|
struct termios original;
|
||||||
tcgetattr(0, &original);
|
tcgetattr(0, &original);
|
||||||
SUBCASE("no echo") {
|
SUBCASE("no echo") {
|
||||||
@@ -37,6 +38,7 @@ TEST_CASE("init and reset termios") {
|
|||||||
tcgetattr(0, ¤t);
|
tcgetattr(0, ¤t);
|
||||||
CHECK(std::memcmp(&original, ¤t, sizeof(struct termios)) == 0);
|
CHECK(std::memcmp(&original, ¤t, sizeof(struct termios)) == 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char getch_(int echo) {
|
char getch_(int echo) {
|
||||||
char ch;
|
char ch;
|
||||||
|
|||||||
Reference in New Issue
Block a user