diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-09 14:36:47 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-09 14:36:47 +0000 |
commit | 2e54cdc4d85a3b5d8d98ddcee2c3de6322e6af2c (patch) | |
tree | 56decc236f29385af6f03be21f8f2cc8f88f8490 /testsuites/libtests/termios01/init.c | |
parent | 2010-08-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-2e54cdc4d85a3b5d8d98ddcee2c3de6322e6af2c.tar.bz2 |
2010-08-09 Bharath Suri <bharath.s.jois@gmail.com>
PR 1661/testing
* termios01/init.c, termios01/termios_testdriver.c,
termios01/termios01.scn: Changes to improve coverage of
rtems_termios_open routine.
Diffstat (limited to 'testsuites/libtests/termios01/init.c')
-rw-r--r-- | testsuites/libtests/termios01/init.c | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/testsuites/libtests/termios01/init.c b/testsuites/libtests/termios01/init.c index 7276fce144..ce2afe456d 100644 --- a/testsuites/libtests/termios01/init.c +++ b/testsuites/libtests/termios01/init.c @@ -469,21 +469,9 @@ rtems_task Init( test_termios_baud2number(); test_termios_number_to_baud(); - /* - * tcsetattr - ERROR invalid operation - */ - puts( "tcsetattr - invalid operation - ENOTSUP" ); - rc = tcsetattr( 0, 0x12345, &t ); - rtems_test_assert( rc == -1 ); - rtems_test_assert( errno == ENOTSUP ); - - /* - * tcsetattr - TCSADRAIN - */ - puts( "\ntcsetattr - drain - OK" ); - rc = tcsetattr( 1, TCSADRAIN, &t ); - rtems_test_assert( rc == 0 ); - + sc = rtems_termios_bufsize( 256, 138, 64 ); + directive_failed( sc, "rtems_termios_bufsize" ); + /* * Register a driver */ @@ -505,6 +493,21 @@ rtems_task Init( rtems_test_exit(0); } + /* + * tcsetattr - ERROR invalid operation + */ + puts( "tcsetattr - invalid operation - ENOTSUP" ); + rc = tcsetattr( test, 0x12345, &t ); + rtems_test_assert( rc == -1 ); + rtems_test_assert( errno == ENOTSUP ); + + /* + * tcsetattr - TCSADRAIN + */ + puts( "\ntcsetattr - drain - OK" ); + rc = tcsetattr( test, TCSADRAIN, &t ); + rtems_test_assert( rc == 0 ); + test_termios_set_baud(test); puts( "Init - close - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK" ); @@ -588,6 +591,22 @@ rtems_task Init( rtems_test_exit(0); } + /* + TODO: This must be enabled, but is facing a strange problem + where the code dies off at rtems_termios_open. + */ + + /* + puts( "Multiple open of the device" ); + for( ; index < 26; ++index ) { + printf( "...%d ", index ); + test = open( TERMIOS_TEST_DRIVER_DEVICE_NAME, O_RDWR ); + rtems_test_assert( test != -1 ); + rc = close( test ); + rtems_test_assert( rc == 0 ); + } + puts( "" ); + */ puts( "*** END OF TEST TERMIOS 01 ***" ); rtems_test_exit(0); } |