From 0f1fff38ada3c5b9d6b973c6080d9772eea63e8e Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.maroneze@cea.fr>
Date: Wed, 9 Jun 2021 10:30:43 +0200
Subject: [PATCH] [Libc] fix test

---
 tests/libc/oracle/termios.res.oracle | 43 +++++++++++++++++++++++++++-
 tests/libc/termios.c                 |  2 +-
 2 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/tests/libc/oracle/termios.res.oracle b/tests/libc/oracle/termios.res.oracle
index 889f1135816..d83df79230a 100644
--- a/tests/libc/oracle/termios.res.oracle
+++ b/tests/libc/oracle/termios.res.oracle
@@ -23,6 +23,45 @@
 [eva] Done for function tcgetattr
 [eva:alarm] tests/libc/termios.c:13: Warning: 
   accessing uninitialized left-value. assert \initialized(&tio.c_cflag);
+[eva] computing for function cfsetispeed <- main.
+  Called from tests/libc/termios.c:19.
+[eva] using specification for function cfsetispeed
+[eva] tests/libc/termios.c:19: 
+  function cfsetispeed: precondition 'valid_termios_p' got status valid.
+[eva] Done for function cfsetispeed
+[eva] computing for function cfsetospeed <- main.
+  Called from tests/libc/termios.c:21.
+[eva] using specification for function cfsetospeed
+[eva] tests/libc/termios.c:21: 
+  function cfsetospeed: precondition 'valid_termios_p' got status valid.
+[eva] Done for function cfsetospeed
+[eva] computing for function cfgetispeed <- main.
+  Called from tests/libc/termios.c:23.
+[eva] using specification for function cfgetispeed
+[eva] tests/libc/termios.c:23: 
+  function cfgetispeed: precondition 'valid_termios_p' got status valid.
+[eva] Done for function cfgetispeed
+[eva] computing for function cfgetospeed <- main.
+  Called from tests/libc/termios.c:24.
+[eva] using specification for function cfgetospeed
+[eva] tests/libc/termios.c:24: 
+  function cfgetospeed: precondition 'valid_termios_p' got status valid.
+[eva] Done for function cfgetospeed
+[eva] computing for function tcflush <- main.
+  Called from tests/libc/termios.c:25.
+[eva] using specification for function tcflush
+[eva] tests/libc/termios.c:25: 
+  function tcflush: precondition 'valid_queue_selector' got status valid.
+[eva] Done for function tcflush
+[eva] computing for function tcsetattr <- main.
+  Called from tests/libc/termios.c:26.
+[eva] using specification for function tcsetattr
+[eva] tests/libc/termios.c:26: 
+  function tcsetattr: precondition 'valid_termios_p' got status valid.
+[eva] Done for function tcsetattr
+[eva] computing for function tcsetattr <- main.
+  Called from tests/libc/termios.c:26.
+[eva] Done for function tcsetattr
 [eva] Recording results for main
 [eva] done for function main
 [eva] ====== VALUES COMPUTED ======
@@ -31,4 +70,6 @@
   fd ∈ [-1..1023]
   tio ∈ [--..--] or UNINITIALIZED
   res ∈ {-1; 0}
-  __retres ∈ {1; 8}
+  sp1 ∈ [--..--]
+  sp2 ∈ [--..--]
+  __retres ∈ {-1; 0; 1; 8}
diff --git a/tests/libc/termios.c b/tests/libc/termios.c
index 78100d57f84..d79f7a622f6 100644
--- a/tests/libc/termios.c
+++ b/tests/libc/termios.c
@@ -10,7 +10,7 @@ int main() {
   fd = open("/dev/ttyS1", O_RDWR);
   int res = tcgetattr(fd, &tio);
   if (res) return 1;
-  if (tio.c_cflag | CS8) {
+  if (tio.c_cflag & CS8) {
     return 8;
   }
   tio.c_lflag = (ECHO|ICANON|ISIG|ECHOE|ECHOK|ECHONL);
-- 
GitLab