TC: Expand tc for termios API's
1) Adds missing test cases for isatty() and cfgetspeed() API's.
2) Adds failure test case: invlaid 'option' input to tcsetattr() API.
@@ -44,6 +44,19 @@ static void tc_termios_tcsetattr_tcgetattr(void)
printf("tc_termios_tcsetattr_tcgetattr fail : getattr %d\n", errno);
}
+ sleep(1);
+ /* isatty() returns 1 if fd is an open file descriptor referring to a terminal */
+ ret_chk = isatty(fileno(stdin));
+ TC_ASSERT_EQ("isatty", ret_chk, 1);
+
+ ret_chk = cfgetspeed(&prev_tio);
+ TC_ASSERT_GEQ("cfgetspeed", ret_chk, 0);
+
+ /* Failure case: invalid option */
+ sleep(1);
+ ret_chk = tcsetattr(fileno(stdin), 33, &prev_tio);
+ TC_ASSERT_LT("tcsetattr", ret_chk, 0);
+
sleep(1);
prev_tio.c_oflag &= ~ONLCR;
ret_chk = tcsetattr(fileno(stdin), TCSANOW, &prev_tio);
