summaryrefslogtreecommitdiffstats
path: root/c/src/tests/libtests/termios/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-08-02 00:55:27 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-08-02 00:55:27 +0000
commit016a926defe59ea4d0483da43b59b9f347e97e59 (patch)
tree4c97fe8c7ea90a76d4f294ebfa13bf8b2d741e12 /c/src/tests/libtests/termios/init.c
parent2002-08-01 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-016a926defe59ea4d0483da43b59b9f347e97e59.tar.bz2
2002-08-01 Joel Sherrill <joel@OARcorp.com>
* Per PR47 add support for buffered test output. This involved adding defines to redirect output to a buffer and dump it when full, at "test pause", and at exit. To avoid problems when redefining exit(), all tests were modified to call rtems_test_exit(). Some tests, notable psxtests, had to be modified to include the standard test macro .h file (pmacros.h or tmacros.h) to enable this support. * cpuuse/task2.c, malloctest/task1.c, putenvtest/init.c, rtmonuse/task1.c, termios/init.c: Modified.
Diffstat (limited to '')
-rw-r--r--c/src/tests/libtests/termios/init.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/c/src/tests/libtests/termios/init.c b/c/src/tests/libtests/termios/init.c
index b4cd7df06d..aff6b08384 100644
--- a/c/src/tests/libtests/termios/init.c
+++ b/c/src/tests/libtests/termios/init.c
@@ -46,6 +46,8 @@ rtems_task Init (rtems_task_argument argument);
#include <errno.h>
#include <string.h>
+#include <tmacros.h>
+
#if !defined(fileno)
int fileno( FILE *stream); /* beyond ANSI */
#endif
@@ -589,7 +591,7 @@ void change_line_settings( struct termios *tp )
tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits | baud_rate;
if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) {
perror( "change_line_settings(): tcsetattr() failed" );
- exit( 1 );
+ rtems_test_exit( 1 );
}
printf( "Line settings set.\n" );
}
@@ -606,7 +608,7 @@ void canonical_input( struct termios *tp )
tp->c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) {
perror( "canonical_input(): tcsetattr() failed" );
- exit( 1 );
+ rtems_test_exit( 1 );
}
while ( ( c = getchar () ) != '\n');
@@ -725,7 +727,7 @@ Init (rtems_task_argument ignored)
if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) {
perror( "tcgetattr() failed" );
- exit( 0 );
+ rtems_test_exit( 0 );
}
test_termios = orig_termios;
@@ -738,7 +740,7 @@ Init (rtems_task_argument ignored)
test_termios = orig_termios;
if( tcsetattr( fileno( stdin ), TCSADRAIN, &test_termios ) < 0 ) {
perror( "tcsetattr() failed" );
- exit( 1 );
+ rtems_test_exit( 1 );
}
usage();
break;
@@ -764,7 +766,7 @@ Init (rtems_task_argument ignored)
break;
case '9':
- exit( 1 );
+ rtems_test_exit( 1 );
case '\n':
break;