diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-15 22:29:38 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-15 22:29:38 +0000 |
commit | e958d79b338b8a32c6f182152f4f205e1a35e2ce (patch) | |
tree | 8669f9a76984f924b331989b4dcd12c5454e4dc1 /testsuites/libtests/termios01/init.c | |
parent | 2009-08-15 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-e958d79b338b8a32c6f182152f4f205e1a35e2ce.tar.bz2 |
2009-08-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* termios01/init.c, termios01/termios01.scn: Add a few error paths to
complete coverage of termios_XXX_to_YYY() methods.
Diffstat (limited to 'testsuites/libtests/termios01/init.c')
-rw-r--r-- | testsuites/libtests/termios01/init.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuites/libtests/termios01/init.c b/testsuites/libtests/termios01/init.c index f12c54fe0c..a38bd2c316 100644 --- a/testsuites/libtests/termios01/init.c +++ b/testsuites/libtests/termios01/init.c @@ -124,6 +124,15 @@ void test_termios_baud2index(void) "\n" "Test termios_baud2index..." ); + puts( "termios_baud_to_index(-2) - NOT OK" ); + i = termios_baud_to_index( -2 ); + assert ( i == -1 ); + + puts( "termios_baud_to_index(572) - NOT OK" ); + i = termios_baud_to_index( -2 ); + assert ( i == -1 ); + + if ( i != -1 ) for (i=0 ; baud_table[i].constant != -1 ; i++ ) { printf( "termios_baud_to_index(B%d) - OK\n", baud_table[i].baud ); index = termios_baud_to_index( baud_table[i].constant ); @@ -146,6 +155,14 @@ void test_termios_baud2number(void) "\n" "Test termios_baud2number..." ); + puts( "termios_baud_to_number(-2) - NOT OK" ); + i = termios_baud_to_number( -2 ); + assert ( i == -1 ); + + puts( "termios_baud_to_number(572) - NOT OK" ); + i = termios_baud_to_number( -2 ); + assert ( i == -1 ); + for (i=0 ; baud_table[i].constant != -1 ; i++ ) { printf( "termios_baud_to_number(B%d) - OK\n", baud_table[i].baud ); number = termios_baud_to_number( baud_table[i].constant ); @@ -172,6 +189,14 @@ void test_termios_number_to_baud(void) "\n" "Test termios_number_to_baud..." ); + puts( "termios_number_to_baud(-2) - NOT OK" ); + i = termios_number_to_baud( -2 ); + assert ( i == -1 ); + + puts( "termios_number_to_baud(572) - NOT OK" ); + i = termios_number_to_baud( -2 ); + assert ( i == -1 ); + for (i=0 ; baud_table[i].constant != -1 ; i++ ) { printf( "termios_number_to_baud(B%d) - OK\n", baud_table[i].baud ); termios_baud = termios_number_to_baud( baud_table[i].baud ); |