--- testsuites/libtests/termios/init.c | 341 +++++++++++++-------- testsuites/libtests/termios01/init.c | 143 +++++++-- testsuites/libtests/termios01/termios01.scn | 270 ++++++++++++---- testsuites/libtests/termios01/termios_testdriver.c | 6 +- testsuites/libtests/termios02/termios02.scn | 4 +- testsuites/libtests/termios03/termios03.scn | 200 ++++++------ testsuites/libtests/termios04/termios04.scn | 8 +- testsuites/libtests/termios05/termios05.scn | 8 +- testsuites/libtests/termios06/init.c | 8 +- testsuites/libtests/termios06/termios06.scn | 24 +- testsuites/libtests/termios07/termios07.scn | 21 +- testsuites/libtests/termios08/termios08.scn | 19 +- 12 files changed, 694 insertions(+), 358 deletions(-)
diff --git a/testsuites/libtests/termios/init.c b/testsuites/libtests/termios/init.c index fcb586b..d8ac60a 100644 --- a/testsuites/libtests/termios/init.c +++ b/testsuites/libtests/termios/init.c @@ -46,6 +46,7 @@ void print_c_oflag(struct termios * tp); void print_c_lflag(struct termios * tp); void print_c_cflag(struct termios * tp); void print_c_cc(struct termios * tp); +void print_baud(const char* name, speed_t spd); void print_termios(struct termios *tp); unsigned long get_baud_rate(void); unsigned long get_parity(void); @@ -118,6 +119,9 @@ void print_c_oflag( struct termios * tp ) if( tp->c_oflag & ONLCR ) printf( "ONLCR " ); + if( tp->c_oflag & ONOEOT ) + printf( "ONOEOT " ); + if( tp->c_oflag & OCRNL ) printf( "OCRNL " ); @@ -215,27 +219,38 @@ void print_c_oflag( struct termios * tp ) void print_c_lflag( struct termios * tp ) { char * c_lflag_bits [] = { - "ISIG", /* 0000001 */ - "ICANON", /* 0000002 */ - "XCASE", /* 0000004 */ - "ECHO", /* 0000010 */ - "ECHOE", /* 0000020 */ - "ECHOK", /* 0000040 */ - "ECHONL", /* 0000100 */ - "NOFLSH", /* 0000200 */ - "TOSTOP", /* 0000400 */ - "ECHOCTL", /* 0001000 */ - "ECHOPRT", /* 0002000 */ - "ECHOKE", /* 0004000 */ - "FLUSHO", /* 0010000 */ - "unknown", /* 0020000 */ - "PENDIN", /* 0040000 */ - "IEXTEN", /* 0100000 */ - "unknown", /* 0200000 */ - "unknown", /* 0400000 */ - "unknown", /* 1000000 */ - "unknown", /* 2000000 */ - "unknown", /* 4000000 */ + "ECHOKE", /* 0x00000001 */ + "ECHOE", /* 0x00000002 */ + "ECHOK", /* 0x00000004 */ + "ECHO", /* 0x00000008 */ + "ECHONL", /* 0x00000010 */ + "ECHOPRT", /* 0x00000020 */ + "ECHOCTL", /* 0x00000040 */ + "ISIG", /* 0x00000080 */ + "ICANON", /* 0x00000100 */ + "ALTWERASE", /* 0x00000200 */ + "IEXTEN", /* 0x00000400 */ + "EXTPROC", /* 0x00000800 */ + "XCASE", /* 0x00001000 */ + "unknown", /* 0x00002000 */ + "unknown", /* 0x00004000 */ + "unknown", /* 0x00008000 */ + "unknown", /* 0x00010000 */ + "unknown", /* 0x00020000 */ + "unknown", /* 0x00040000 */ + "unknown", /* 0x00080000 */ + "unknown", /* 0x00100000 */ + "unknown", /* 0x00200000 */ + "TOSTOP", /* 0x00400000 */ + "FLUSHO", /* 0x00800000 */ + "unknown", /* 0x01000000 */ + "NOKERNINFO", /* 0x02000000 */ + "unknown", /* 0x04000000 */ + "unknown", /* 0x08000000 */ + "unknown", /* 0x10000000 */ + "PENDIN", /* 0x20000000 */ + "unknown", /* 0x40000000 */ + "NOFLSH", /* 0x80000000 */ }; printf( "c_lflag = 0x%08x\n\t", tp->c_lflag ); @@ -246,98 +261,8 @@ void print_c_lflag( struct termios * tp ) void print_c_cflag( struct termios * tp ) { - unsigned int baud; - printf( "c_cflag = 0x%08x\n", tp->c_cflag ); - baud = (tp->c_cflag & CBAUD) ; - if ( tp->c_cflag & CBAUDEX ) - switch( baud ) { - case B0: - printf( "\tCBAUD =\tB0\n" ); - break; - - case B50: - printf( "\tCBAUD =\tB50\n" ); - break; - - case B75: - printf( "\tCBAUD =\tB75\n" ); - break; - - case B110: - printf( "\tCBAUD =\tB110\n" ); - break; - - case B134: - printf( "\tCBAUD =\tB134\n" ); - break; - - case B150: - printf( "\tCBAUD =\tB150\n" ); - break; - - case B200: - printf( "\tCBAUD =\tB200\n" ); - break; - - case B300: - printf( "\tCBAUD =\tB300\n" ); - break; - - case B600: - printf( "\tCBAUD =\tB600\n" ); - break; - - case B1200: - printf( "\tCBAUD =\tB1200\n" ); - break; - - case B1800: - printf( "\tCBAUD =\tB1800\n" ); - break; - - case B2400: - printf( "\tCBAUD =\tB2400\n" ); - break; - - case B4800: - printf( "\tCBAUD =\tB4800\n" ); - break; - - case B9600: - printf( "\tCBAUD =\tB9600\n" ); - break; - - case B19200: - printf( "\tCBAUD =\tB19200\n" ); - break; - - case B38400: - printf( "\tCBAUD =\tB38400\n" ); - break; - - case B57600: - printf( "\tCBAUD =\tB57600\n" ); - break; - - case B115200: - printf( "\tCBAUD =\tB115200\n" ); - break; - - case B230400: - printf( "\tCBAUD =\tB230400\n" ); - break; - - case B460800: - printf( "\tCBAUD =\tB460800\n" ); - break; - - default: - printf( "\tCBAUD =\tunknown (0x%08x)\n", baud ); - break; - } - switch( tp->c_cflag & CSIZE ) { case CS5: printf( "\tCSIZE =\tCS5\n" ); @@ -356,6 +281,11 @@ void print_c_cflag( struct termios * tp ) break; } + if( tp->c_cflag & CIGNORE ) + printf( "\tCIGNORE set: iqnore c_cflags enabled\n" ); + else + printf( "\tCIGNORE clear: iqnore c_cflags disabled\n" ); + if( tp->c_cflag & CSTOPB ) printf( "\tCSTOPB set: send 2 stop bits\n" ); else @@ -386,17 +316,35 @@ void print_c_cflag( struct termios * tp ) else printf( "\tCLOCAL clear: don't ignore modem lines\n" ); -#if defined(CBAUDEX) - if( tp->c_cflag & CBAUDEX ) - printf( "\tCBAUDEX set: What does this do?\n" ); + if( tp->c_cflag & CCTS_OFLOW ) + printf( "\tCCTS_OFLOW: hardware CTS output flow control enabled\n" ); else - printf( "\tCBAUDEX clear: What does this do?\n" ); -#endif + printf( "\tCCTS_OFLOW: hardware CTS output flow control disabled\n" ); + + if( tp->c_cflag & CRTS_IFLOW ) + printf( "\tCRTS_IFLOW: hardware RTS input flow control enabled\n" ); + else + printf( "\tCRTS_IFLOW: hardware RTS input flow control disabled\n" ); if( tp->c_cflag & CRTSCTS ) printf( "\tCRTSCTS: harware flow control enabled?\n" ); else printf( "\tCRTSCTS: hardware flow control disabled?\n" ); + + if( tp->c_cflag & CDSR_OFLOW ) + printf( "\tCDSR_OFLOW: hardware DSR output flow control enabled\n" ); + else + printf( "\tCDSR_OFLOW: hardware DSR output flow control disabled\n" ); + + if( tp->c_cflag & CDTR_IFLOW ) + printf( "\tCDTR_IFLOW: hardware DTR input flow control enabled\n" ); + else + printf( "\tCDTR_IFLOW: hardware DTR input flow control disabled\n" ); + + if( tp->c_cflag & CCAR_OFLOW ) + printf( "\tCCAR_OFLOW: hardware CD output flow control enabled\n" ); + else + printf( "\tCCAR_OFLOW: hardware CD output flow control disabled\n" ); } @@ -404,25 +352,26 @@ void print_c_cc( struct termios * tp ) { size_t i; char * cc_index_names [ /* NCCS */ ] = { - "[VINTR] ", /* 0 */ - "[VQUIT] ", /* 1 */ - "[VERASE] ", /* 2 */ - "[VKILL] ", /* 3 */ - "[VEOF] ", /* 4 */ - "[VTIME] ", /* 5 */ - "[VMIN] ", /* 6 */ - "[VSWTC ", /* 7 */ - "[VSTART] ", /* 8 */ - "[VSTOP] ", /* 9 */ + "[VEOF] ", /* 0 */ + "[VEOL] ", /* 1 */ + "[VEOL2] ", /* 2 */ + "[VERASE] ", /* 3 */ + "[VWERASE] ", /* 4 */ + "[VKILL] ", /* 5 */ + "[VREPRINT]", /* 6 */ + "[VERASE2] ", /* 7 */ + "[VINTR] ", /* 8 */ + "[VQUIT] ", /* 9 */ "[VSUSP] ", /* 10 */ - "[VEOL] ", /* 11 */ - "[VREPRINT]", /* 12 */ - "[VDISCARD]", /* 13 */ - "[VWERASE] ", /* 14 */ - "[VLNEXT ", /* 15 */ - "[VEOL2] ", /* 16 */ - "unknown ", /* 17 */ - "unknown ", /* 18 */ + "[VDSUSP] ", /* 11 */ + "[VSTART] ", /* 12 */ + "[VSTOP] ", /* 13 */ + "[VLNEXT] ", /* 14 */ + "[VDISCARD]", /* 15 */ + "[VMIN] ", /* 16 */ + "[VTIME] ", /* 17 */ + "[VSTATUS] ", /* 18 */ + "unknown ", /* 19 */ }; for( i = 0; i < sizeof(cc_index_names)/sizeof(char*) ; i++ ) { @@ -431,6 +380,116 @@ void print_c_cc( struct termios * tp ) } +void print_baud( const char* name, speed_t spd ) +{ + switch( spd ) { + case B0: + printf( "%s = B0\n", name ); + break; + + case B50: + printf( "%s = B50\n", name ); + break; + + case B75: + printf( "%s = B75\n", name ); + break; + + case B110: + printf( "%s = B110\n", name ); + break; + + case B134: + printf( "%s = B134\n", name ); + break; + + case B150: + printf( "%s = B150\n", name ); + break; + + case B200: + printf( "%s = B200\n", name ); + break; + + case B300: + printf( "%s = B300\n", name ); + break; + + case B600: + printf( "%s = B600\n", name ); + break; + + case B1200: + printf( "%s = B1200\n", name ); + break; + + case B1800: + printf( "%s = B1800\n", name ); + break; + + case B2400: + printf( "%s = B2400\n", name ); + break; + + case B4800: + printf( "%s = B4800\n", name ); + break; + + case B9600: + printf( "%s = B9600\n", name ); + break; + + case B19200: + printf( "%s = B19200\n", name ); + break; + + case B38400: + printf( "%s = B38400\n", name ); + break; + + case B7200: + printf( "%s = B7200\n", name ); + break; + + case B14400: + printf( "%s = B14400\n", name ); + break; + + case B28800: + printf( "%s = B28800\n", name ); + break; + + case B57600: + printf( "%s = B57600\n", name ); + break; + + case B76800: + printf( "%s = B76800\n", name ); + break; + + case B115200: + printf( "%s = B115200\n", name ); + break; + + case B230400: + printf( "%s = B230400\n", name ); + break; + + case B460800: + printf( "%s = B460800\n", name ); + break; + + case B921600: + printf( "%s = B921600\n", name ); + break; + + default: + printf( "%s = unknown (0x%08x)\n", name, (unsigned int)spd ); + break; + } +} + + void print_termios( struct termios *tp ) { printf( "\nLooking at the current termios settings:\n\n" ); @@ -439,6 +498,8 @@ void print_termios( struct termios *tp ) print_c_cflag( tp ); print_c_lflag( tp ); print_c_cc( tp ); + print_baud( "c_ispeed", tp->c_ispeed ); + print_baud( "c_ospeed", tp->c_ospeed ); printf( "\n" ); } @@ -450,7 +511,8 @@ unsigned long get_baud_rate(void) while( 1 ) { printf( "Enter the numerical value for the new baud rate.\n" ); printf( "Choices are: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800\n" ); - printf( "2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800\n" ); + printf( "2400, 4800, 9600, 19200, 38400, 7200, 14400, 28800, 57600, 76800\n" ); + printf( "115200, 230400, 460800, 921600\n" ); printf( "\nYour choice: " ); scanf( "%lu", &baud_rate ); printf( "\n" ); @@ -470,10 +532,15 @@ unsigned long get_baud_rate(void) case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; + case 7200: return B7200; + case 14400: return B14400; + case 28800: return B28800; case 57600: return B57600; + case 76800: return B76800; case 115200: return B115200; case 230400: return B230400; case 460800: return B460800; + case 921600: return B921600; default: printf( "%lu is not a valid choice. Try again.\n\n", baud_rate ); @@ -589,7 +656,9 @@ void change_line_settings( struct termios *tp ) sleep( sleep_time ); - tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits | baud_rate; + tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits; + tp->c_ispeed = baud_rate; + tp->c_ospeed = baud_rate; if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) { perror( "change_line_settings(): tcsetattr() failed" ); rtems_test_exit( 1 ); diff --git a/testsuites/libtests/termios01/init.c b/testsuites/libtests/termios01/init.c index 64c3bb2..562b252 100644 --- a/testsuites/libtests/termios01/init.c +++ b/testsuites/libtests/termios01/init.c @@ -12,6 +12,7 @@ #endif #include "tmacros.h" +#define TTYDEFCHARS #include <termios.h> #include <rtems/libcsupport.h> #include <rtems/malloc.h> @@ -66,10 +67,15 @@ static const termios_baud_test_r baud_table[] = { { B9600, 9600 }, { B19200, 19200 }, { B38400, 38400 }, + { B7200, 7200 }, + { B14400, 14400 }, + { B28800, 28800 }, { B57600, 57600 }, + { B76800, 76800 }, { B115200, 115200 }, { B230400, 230400 }, { B460800, 460800 }, + { B921600, 921600 }, { INVALID_CONSTANT, INVALID_BAUD } }; @@ -233,16 +239,14 @@ static void test_termios_set_baud( puts( "Test termios setting device baud rate..." ); for (i=0 ; baud_table[i].constant != INVALID_CONSTANT ; i++ ) { - tcflag_t cbaud = CBAUD; - sc = tcgetattr( test, &attr ); if ( sc != 0 ) { printf( "ERROR - return %d\n", sc ); rtems_test_exit(0); } - attr.c_cflag &= ~cbaud; - attr.c_cflag |= baud_table[i].constant; + attr.c_ispeed = baud_table[i].constant; + attr.c_ospeed = baud_table[i].constant; printf( "tcsetattr(TCSANOW, B%" PRIdrtems_termios_baud_t ") - OK\n", @@ -258,7 +262,17 @@ static void test_termios_set_baud( "tcsetattr(TCSADRAIN, B%" PRIdrtems_termios_baud_t ") - OK\n", baud_table[i].baud ); - sc = tcsetattr( test, TCSANOW, &attr ); + sc = tcsetattr( test, TCSADRAIN, &attr ); + if ( sc != 0 ) { + printf( "ERROR - return %d\n", sc ); + rtems_test_exit(0); + } + + printf( + "tcsetattr(TCSAFLUSH, B%" PRIdrtems_termios_baud_t ") - OK\n", + baud_table[i].baud + ); + sc = tcsetattr( test, TCSAFLUSH, &attr ); if ( sc != 0 ) { printf( "ERROR - return %d\n", sc ); rtems_test_exit(0); @@ -301,7 +315,21 @@ static void test_termios_set_charsize( } printf( "tcsetattr(TCSADRAIN, CS%d) - OK\n", char_size_table[i].bits ); - sc = tcsetattr( test, TCSANOW, &attr ); + sc = tcsetattr( test, TCSADRAIN, &attr ); + if ( sc != 0 ) { + printf( "ERROR - return %d\n", sc ); + rtems_test_exit(0); + } + + printf( "tcsetattr(TCSAFLUSH, CS%d) - OK\n", char_size_table[i].bits ); + sc = tcsetattr( test, TCSAFLUSH, &attr ); + if ( sc != 0 ) { + printf( "ERROR - return %d\n", sc ); + rtems_test_exit(0); + } + + printf( "tcsetattr(TCSASOFT, CS%d) - OK\n", char_size_table[i].bits ); + sc = tcsetattr( test, TCSASOFT, &attr ); if ( sc != 0 ) { printf( "ERROR - return %d\n", sc ); rtems_test_exit(0); @@ -344,7 +372,21 @@ static void test_termios_set_parity( } printf( "tcsetattr(TCSADRAIN, %s) - OK\n", parity_table[i].parity ); - sc = tcsetattr( test, TCSANOW, &attr ); + sc = tcsetattr( test, TCSADRAIN, &attr ); + if ( sc != 0 ) { + printf( "ERROR - return %d\n", sc ); + rtems_test_exit(0); + } + + printf( "tcsetattr(TCSAFLUSH, %s) - OK\n", parity_table[i].parity ); + sc = tcsetattr( test, TCSAFLUSH, &attr ); + if ( sc != 0 ) { + printf( "ERROR - return %d\n", sc ); + rtems_test_exit(0); + } + + printf( "tcsetattr(TCSASOFT, %s) - OK\n", parity_table[i].parity ); + sc = tcsetattr( test, TCSASOFT, &attr ); if ( sc != 0 ) { printf( "ERROR - return %d\n", sc ); rtems_test_exit(0); @@ -390,7 +432,21 @@ static void test_termios_set_stop_bits( } printf( "tcsetattr(TCSADRAIN, %d bits) - OK\n", stop_bits_table[i].stop ); - sc = tcsetattr( test, TCSANOW, &attr ); + sc = tcsetattr( test, TCSADRAIN, &attr ); + if ( sc != 0 ) { + printf( "ERROR - return %d\n", sc ); + rtems_test_exit(0); + } + + printf( "tcsetattr(TCSAFLUSH, %d bits) - OK\n", stop_bits_table[i].stop ); + sc = tcsetattr( test, TCSAFLUSH, &attr ); + if ( sc != 0 ) { + printf( "ERROR - return %d\n", sc ); + rtems_test_exit(0); + } + + printf( "tcsetattr(TCSASOFT, %d bits) - OK\n", stop_bits_table[i].stop ); + sc = tcsetattr( test, TCSASOFT, &attr ); if ( sc != 0 ) { printf( "ERROR - return %d\n", sc ); rtems_test_exit(0); @@ -404,9 +460,9 @@ static void test_termios_cfoutspeed(void) int sc; speed_t speed; struct termios term; - tcflag_t bad; + speed_t bad; - bad = CBAUD << 1; + bad = B921600 << 1; memset( &term, '\0', sizeof(term) ); puts( "cfsetospeed(BAD BAUD) - EINVAL" ); sc = cfsetospeed( &term, bad ); @@ -436,9 +492,9 @@ static void test_termios_cfinspeed(void) int sc; speed_t speed; struct termios term; - tcflag_t bad; + speed_t bad; - bad = CBAUD << 1; + bad = B921600 << 1; memset( &term, '\0', sizeof(term) ); puts( "cfsetispeed(BAD BAUD) - EINVAL" ); sc = cfsetispeed( &term, bad ); @@ -469,9 +525,9 @@ static void test_termios_cfsetspeed(void) int status; speed_t speed; struct termios term; - tcflag_t bad; + speed_t bad; - bad = CBAUD << 1; + bad = B921600 << 1; memset( &term, '\0', sizeof(term) ); puts( "cfsetspeed(BAD BAUD) - EINVAL" ); status = cfsetspeed( &term, bad ); @@ -508,15 +564,45 @@ static void test_termios_cfmakeraw(void) puts( "cfmakeraw - OK" ); /* Check that all of the flags were set correctly */ - rtems_test_assert( ~(term.c_iflag & (IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON)) ); + rtems_test_assert( ~(term.c_iflag & (IMAXBEL|IXOFF|INPCK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IGNPAR)) ); + + rtems_test_assert( term.c_iflag & (IGNBRK) ); rtems_test_assert( ~(term.c_oflag & OPOST) ); - rtems_test_assert( ~(term.c_lflag & (ECHO|ECHONL|ICANON|ISIG|IEXTEN)) ); + rtems_test_assert( ~(term.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN|NOFLSH|TOSTOP|PENDIN)) ); rtems_test_assert( ~(term.c_cflag & (CSIZE|PARENB)) ); - rtems_test_assert( term.c_cflag & CS8 ); + rtems_test_assert( term.c_cflag & (CS8|CREAD) ); + + rtems_test_assert( term.c_cc[VMIN] == 1 ); + + rtems_test_assert( term.c_cc[VTIME] == 0 ); +} + +static void test_termios_cfmakesane(void) +{ + struct termios term; + + memset( &term, '\0', sizeof(term) ); + cfmakesane( &term ); + puts( "cfmakesane - OK" ); + + /* Check that all of the flags were set correctly */ + rtems_test_assert( term.c_iflag == TTYDEF_IFLAG ); + + rtems_test_assert( term.c_oflag == TTYDEF_OFLAG ); + + rtems_test_assert( term.c_lflag == TTYDEF_LFLAG ); + + rtems_test_assert( term.c_cflag == TTYDEF_CFLAG ); + + rtems_test_assert( term.c_ispeed == TTYDEF_SPEED ); + + rtems_test_assert( term.c_ospeed == TTYDEF_SPEED ); + + rtems_test_assert( memcmp(&term.c_cc, ttydefchars, sizeof(term.c_cc)) == 0 ); } typedef struct { @@ -684,7 +770,7 @@ static void test_set_attributes_error(void) rtems_test_assert( !ctx.done ); errno = 0; - rv = ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, &term ); + rv = ioctl( fd, TIOCSETA, &term ); rtems_test_assert( rv == -1 ); rtems_test_assert( errno == EIO ); rtems_test_assert( ctx.done ); @@ -702,8 +788,8 @@ static void test_set_best_baud(void) { static const struct { uint32_t baud; - tcflag_t cflag; - } baud_to_cflag_table[] = { + speed_t speed; + } baud_to_speed_table[] = { { 0, B0 }, { 25, B0 }, { 26, B50 }, @@ -731,19 +817,17 @@ static void test_set_best_baud(void) { 0xffffffff, B460800 } }; - size_t n = RTEMS_ARRAY_SIZE(baud_to_cflag_table); + size_t n = RTEMS_ARRAY_SIZE(baud_to_speed_table); size_t i; for ( i = 0; i < n; ++i ) { struct termios term; - tcflag_t cbaud_mask = CBAUD; memset( &term, 0xff, sizeof( term ) ); - rtems_termios_set_best_baud( &term, baud_to_cflag_table[ i ].baud ); + rtems_termios_set_best_baud( &term, baud_to_speed_table[ i ].baud ); - rtems_test_assert( - (term.c_cflag & cbaud_mask) == baud_to_cflag_table[ i ].cflag - ); + rtems_test_assert( term.c_ispeed == baud_to_speed_table[ i ].speed ); + rtems_test_assert( term.c_ospeed == baud_to_speed_table[ i ].speed ); } } @@ -791,13 +875,14 @@ static rtems_task Init( /* * tcsetattr - ERROR invalid operation */ - puts( "tcsetattr - invalid operation - ENOTSUP" ); + puts( "tcsetattr - invalid operation - EINVAL" ); rc = tcsetattr( test, INT_MAX, &t ); rtems_test_assert( rc == -1 ); - rtems_test_assert( errno == ENOTSUP ); + rtems_test_assert( errno == EINVAL ); test_termios_cfmakeraw(); - + test_termios_cfmakesane(); + /* * tcsetattr - TCSADRAIN */ diff --git a/testsuites/libtests/termios01/termios01.scn b/testsuites/libtests/termios01/termios01.scn index c1c5470..36f1b8e 100644 --- a/testsuites/libtests/termios01/termios01.scn +++ b/testsuites/libtests/termios01/termios01.scn @@ -1,4 +1,4 @@ -*** TEST TERMIOS 01 *** +*** BEGIN OF TEST TERMIOS 1 *** Test termios_baud2index... termios_baud_to_index(-2) - NOT OK termios_baud_to_index(B0) - OK @@ -17,10 +17,15 @@ termios_baud_to_index(B4800) - OK termios_baud_to_index(B9600) - OK termios_baud_to_index(B19200) - OK termios_baud_to_index(B38400) - OK +termios_baud_to_index(B7200) - OK +termios_baud_to_index(B14400) - OK +termios_baud_to_index(B28800) - OK termios_baud_to_index(B57600) - OK +termios_baud_to_index(B76800) - OK termios_baud_to_index(B115200) - OK termios_baud_to_index(B230400) - OK termios_baud_to_index(B460800) - OK +termios_baud_to_index(B921600) - OK Test termios_baud2number... termios_baud_to_number(-2) - NOT OK @@ -40,10 +45,15 @@ termios_baud_to_number(B4800) - OK termios_baud_to_number(B9600) - OK termios_baud_to_number(B19200) - OK termios_baud_to_number(B38400) - OK +termios_baud_to_number(B7200) - OK +termios_baud_to_number(B14400) - OK +termios_baud_to_number(B28800) - OK termios_baud_to_number(B57600) - OK +termios_baud_to_number(B76800) - OK termios_baud_to_number(B115200) - OK termios_baud_to_number(B230400) - OK termios_baud_to_number(B460800) - OK +termios_baud_to_number(B921600) - OK Test termios_number_to_baud... termios_number_to_baud(-2) - NOT OK @@ -63,103 +73,179 @@ termios_number_to_baud(B4800) - OK termios_number_to_baud(B9600) - OK termios_number_to_baud(B19200) - OK termios_number_to_baud(B38400) - OK +termios_number_to_baud(B7200) - OK +termios_number_to_baud(B14400) - OK +termios_number_to_baud(B28800) - OK termios_number_to_baud(B57600) - OK +termios_number_to_baud(B76800) - OK termios_number_to_baud(B115200) - OK termios_number_to_baud(B230400) - OK termios_number_to_baud(B460800) - OK +termios_number_to_baud(B921600) - OK Init - rtems_io_register_driver - Termios Test Driver - OK Termios_test_driver - rtems_io_register /dev/test - OK -Init - Major slot returned = 2 +Init - Major slot returned = 3 Init - open - /dev/test - OK Termios_test_driver - rtems_set_initial_baud - bad baud - OK Termios_test_driver - rtems_set_initial_baud - 38400 - OK -tcsetattr - invalid operation - ENOTSUP +tcsetattr - invalid operation - EINVAL cfmakeraw - OK +cfmakesane - OK tcsetattr - drain - OK -set_attributes - B0 5-NONE-1 +set_attributes - B0 8-NONE-2 Test termios setting device baud rate... tcsetattr(TCSANOW, B0) - OK -set_attributes - B0 5-NONE-1 +set_attributes - B0 8-NONE-2 tcsetattr(TCSADRAIN, B0) - OK -set_attributes - B0 5-NONE-1 +set_attributes - B0 8-NONE-2 +tcsetattr(TCSAFLUSH, B0) - OK +set_attributes - B0 8-NONE-2 tcsetattr(TCSANOW, B50) - OK -set_attributes - B50 5-NONE-1 +set_attributes - B50 8-NONE-2 tcsetattr(TCSADRAIN, B50) - OK -set_attributes - B50 5-NONE-1 +set_attributes - B50 8-NONE-2 +tcsetattr(TCSAFLUSH, B50) - OK +set_attributes - B50 8-NONE-2 tcsetattr(TCSANOW, B75) - OK -set_attributes - B75 5-NONE-1 +set_attributes - B75 8-NONE-2 tcsetattr(TCSADRAIN, B75) - OK -set_attributes - B75 5-NONE-1 +set_attributes - B75 8-NONE-2 +tcsetattr(TCSAFLUSH, B75) - OK +set_attributes - B75 8-NONE-2 tcsetattr(TCSANOW, B110) - OK -set_attributes - B110 5-NONE-1 +set_attributes - B110 8-NONE-2 tcsetattr(TCSADRAIN, B110) - OK -set_attributes - B110 5-NONE-1 +set_attributes - B110 8-NONE-2 +tcsetattr(TCSAFLUSH, B110) - OK +set_attributes - B110 8-NONE-2 tcsetattr(TCSANOW, B134) - OK -set_attributes - B134 5-NONE-1 +set_attributes - B134 8-NONE-2 tcsetattr(TCSADRAIN, B134) - OK -set_attributes - B134 5-NONE-1 +set_attributes - B134 8-NONE-2 +tcsetattr(TCSAFLUSH, B134) - OK +set_attributes - B134 8-NONE-2 tcsetattr(TCSANOW, B150) - OK -set_attributes - B150 5-NONE-1 +set_attributes - B150 8-NONE-2 tcsetattr(TCSADRAIN, B150) - OK -set_attributes - B150 5-NONE-1 +set_attributes - B150 8-NONE-2 +tcsetattr(TCSAFLUSH, B150) - OK +set_attributes - B150 8-NONE-2 tcsetattr(TCSANOW, B200) - OK -set_attributes - B200 5-NONE-1 +set_attributes - B200 8-NONE-2 tcsetattr(TCSADRAIN, B200) - OK -set_attributes - B200 5-NONE-1 +set_attributes - B200 8-NONE-2 +tcsetattr(TCSAFLUSH, B200) - OK +set_attributes - B200 8-NONE-2 tcsetattr(TCSANOW, B300) - OK -set_attributes - B300 5-NONE-1 +set_attributes - B300 8-NONE-2 tcsetattr(TCSADRAIN, B300) - OK -set_attributes - B300 5-NONE-1 +set_attributes - B300 8-NONE-2 +tcsetattr(TCSAFLUSH, B300) - OK +set_attributes - B300 8-NONE-2 tcsetattr(TCSANOW, B600) - OK -set_attributes - B600 5-NONE-1 +set_attributes - B600 8-NONE-2 tcsetattr(TCSADRAIN, B600) - OK -set_attributes - B600 5-NONE-1 +set_attributes - B600 8-NONE-2 +tcsetattr(TCSAFLUSH, B600) - OK +set_attributes - B600 8-NONE-2 tcsetattr(TCSANOW, B1200) - OK -set_attributes - B1200 5-NONE-1 +set_attributes - B1200 8-NONE-2 tcsetattr(TCSADRAIN, B1200) - OK -set_attributes - B1200 5-NONE-1 +set_attributes - B1200 8-NONE-2 +tcsetattr(TCSAFLUSH, B1200) - OK +set_attributes - B1200 8-NONE-2 tcsetattr(TCSANOW, B1800) - OK -set_attributes - B1800 5-NONE-1 +set_attributes - B1800 8-NONE-2 tcsetattr(TCSADRAIN, B1800) - OK -set_attributes - B1800 5-NONE-1 +set_attributes - B1800 8-NONE-2 +tcsetattr(TCSAFLUSH, B1800) - OK +set_attributes - B1800 8-NONE-2 tcsetattr(TCSANOW, B2400) - OK -set_attributes - B2400 5-NONE-1 +set_attributes - B2400 8-NONE-2 tcsetattr(TCSADRAIN, B2400) - OK -set_attributes - B2400 5-NONE-1 +set_attributes - B2400 8-NONE-2 +tcsetattr(TCSAFLUSH, B2400) - OK +set_attributes - B2400 8-NONE-2 tcsetattr(TCSANOW, B4800) - OK -set_attributes - B4800 5-NONE-1 +set_attributes - B4800 8-NONE-2 tcsetattr(TCSADRAIN, B4800) - OK -set_attributes - B4800 5-NONE-1 +set_attributes - B4800 8-NONE-2 +tcsetattr(TCSAFLUSH, B4800) - OK +set_attributes - B4800 8-NONE-2 tcsetattr(TCSANOW, B9600) - OK -set_attributes - B9600 5-NONE-1 +set_attributes - B9600 8-NONE-2 tcsetattr(TCSADRAIN, B9600) - OK -set_attributes - B9600 5-NONE-1 +set_attributes - B9600 8-NONE-2 +tcsetattr(TCSAFLUSH, B9600) - OK +set_attributes - B9600 8-NONE-2 tcsetattr(TCSANOW, B19200) - OK -set_attributes - B19200 5-NONE-1 +set_attributes - B19200 8-NONE-2 tcsetattr(TCSADRAIN, B19200) - OK -set_attributes - B19200 5-NONE-1 +set_attributes - B19200 8-NONE-2 +tcsetattr(TCSAFLUSH, B19200) - OK +set_attributes - B19200 8-NONE-2 tcsetattr(TCSANOW, B38400) - OK -set_attributes - B38400 5-NONE-1 +set_attributes - B38400 8-NONE-2 tcsetattr(TCSADRAIN, B38400) - OK -set_attributes - B38400 5-NONE-1 +set_attributes - B38400 8-NONE-2 +tcsetattr(TCSAFLUSH, B38400) - OK +set_attributes - B38400 8-NONE-2 +tcsetattr(TCSANOW, B7200) - OK +set_attributes - B7200 8-NONE-2 +tcsetattr(TCSADRAIN, B7200) - OK +set_attributes - B7200 8-NONE-2 +tcsetattr(TCSAFLUSH, B7200) - OK +set_attributes - B7200 8-NONE-2 +tcsetattr(TCSANOW, B14400) - OK +set_attributes - B14400 8-NONE-2 +tcsetattr(TCSADRAIN, B14400) - OK +set_attributes - B14400 8-NONE-2 +tcsetattr(TCSAFLUSH, B14400) - OK +set_attributes - B14400 8-NONE-2 +tcsetattr(TCSANOW, B28800) - OK +set_attributes - B28800 8-NONE-2 +tcsetattr(TCSADRAIN, B28800) - OK +set_attributes - B28800 8-NONE-2 +tcsetattr(TCSAFLUSH, B28800) - OK +set_attributes - B28800 8-NONE-2 tcsetattr(TCSANOW, B57600) - OK -set_attributes - B57600 5-NONE-1 +set_attributes - B57600 8-NONE-2 tcsetattr(TCSADRAIN, B57600) - OK -set_attributes - B57600 5-NONE-1 +set_attributes - B57600 8-NONE-2 +tcsetattr(TCSAFLUSH, B57600) - OK +set_attributes - B57600 8-NONE-2 +tcsetattr(TCSANOW, B76800) - OK +set_attributes - B76800 8-NONE-2 +tcsetattr(TCSADRAIN, B76800) - OK +set_attributes - B76800 8-NONE-2 +tcsetattr(TCSAFLUSH, B76800) - OK +set_attributes - B76800 8-NONE-2 tcsetattr(TCSANOW, B115200) - OK -set_attributes - B115200 5-NONE-1 +set_attributes - B115200 8-NONE-2 tcsetattr(TCSADRAIN, B115200) - OK -set_attributes - B115200 5-NONE-1 +set_attributes - B115200 8-NONE-2 +tcsetattr(TCSAFLUSH, B115200) - OK +set_attributes - B115200 8-NONE-2 tcsetattr(TCSANOW, B230400) - OK -set_attributes - B230400 5-NONE-1 +set_attributes - B230400 8-NONE-2 tcsetattr(TCSADRAIN, B230400) - OK -set_attributes - B230400 5-NONE-1 +set_attributes - B230400 8-NONE-2 +tcsetattr(TCSAFLUSH, B230400) - OK +set_attributes - B230400 8-NONE-2 tcsetattr(TCSANOW, B460800) - OK -set_attributes - B460800 5-NONE-1 +set_attributes - B460800 8-NONE-2 tcsetattr(TCSADRAIN, B460800) - OK -set_attributes - B460800 5-NONE-1 +set_attributes - B460800 8-NONE-2 +tcsetattr(TCSAFLUSH, B460800) - OK +set_attributes - B460800 8-NONE-2 +tcsetattr(TCSANOW, B921600) - OK +set_attributes - B921600 8-NONE-2 +tcsetattr(TCSADRAIN, B921600) - OK +set_attributes - B921600 8-NONE-2 +tcsetattr(TCSAFLUSH, B921600) - OK +set_attributes - B921600 8-NONE-2 Init - close - /dev/test - OK Init - open - /dev/test - OK @@ -168,21 +254,37 @@ Termios_test_driver - rtems_set_initial_baud - 38400 - OK Test termios setting device character size ... tcsetattr(TCSANOW, CS5) - OK -set_attributes - B38400 5-NONE-1 +set_attributes - B38400 5-NONE-2 tcsetattr(TCSADRAIN, CS5) - OK -set_attributes - B38400 5-NONE-1 +set_attributes - B38400 5-NONE-2 +tcsetattr(TCSAFLUSH, CS5) - OK +set_attributes - B38400 5-NONE-2 +tcsetattr(TCSASOFT, CS5) - OK +set_attributes - B38400 5-NONE-2 tcsetattr(TCSANOW, CS6) - OK -set_attributes - B38400 6-NONE-1 +set_attributes - B38400 6-NONE-2 tcsetattr(TCSADRAIN, CS6) - OK -set_attributes - B38400 6-NONE-1 +set_attributes - B38400 6-NONE-2 +tcsetattr(TCSAFLUSH, CS6) - OK +set_attributes - B38400 6-NONE-2 +tcsetattr(TCSASOFT, CS6) - OK +set_attributes - B38400 6-NONE-2 tcsetattr(TCSANOW, CS7) - OK -set_attributes - B38400 7-NONE-1 +set_attributes - B38400 7-NONE-2 tcsetattr(TCSADRAIN, CS7) - OK -set_attributes - B38400 7-NONE-1 +set_attributes - B38400 7-NONE-2 +tcsetattr(TCSAFLUSH, CS7) - OK +set_attributes - B38400 7-NONE-2 +tcsetattr(TCSASOFT, CS7) - OK +set_attributes - B38400 7-NONE-2 tcsetattr(TCSANOW, CS8) - OK -set_attributes - B38400 8-NONE-1 +set_attributes - B38400 8-NONE-2 tcsetattr(TCSADRAIN, CS8) - OK -set_attributes - B38400 8-NONE-1 +set_attributes - B38400 8-NONE-2 +tcsetattr(TCSAFLUSH, CS8) - OK +set_attributes - B38400 8-NONE-2 +tcsetattr(TCSASOFT, CS8) - OK +set_attributes - B38400 8-NONE-2 Init - close - /dev/test - OK Init - open - /dev/test - OK @@ -191,17 +293,29 @@ Termios_test_driver - rtems_set_initial_baud - 38400 - OK Test termios setting device parity ... tcsetattr(TCSANOW, none) - OK -set_attributes - B38400 8-NONE-1 +set_attributes - B38400 8-NONE-2 tcsetattr(TCSADRAIN, none) - OK -set_attributes - B38400 8-NONE-1 +set_attributes - B38400 8-NONE-2 +tcsetattr(TCSAFLUSH, none) - OK +set_attributes - B38400 8-NONE-2 +tcsetattr(TCSASOFT, none) - OK +set_attributes - B38400 8-NONE-2 tcsetattr(TCSANOW, even) - OK -set_attributes - B38400 8-ODD-1 +set_attributes - B38400 8-ODD-2 tcsetattr(TCSADRAIN, even) - OK -set_attributes - B38400 8-ODD-1 +set_attributes - B38400 8-ODD-2 +tcsetattr(TCSAFLUSH, even) - OK +set_attributes - B38400 8-ODD-2 +tcsetattr(TCSASOFT, even) - OK +set_attributes - B38400 8-ODD-2 tcsetattr(TCSANOW, odd) - OK -set_attributes - B38400 8-EVEN-1 +set_attributes - B38400 8-EVEN-2 tcsetattr(TCSADRAIN, odd) - OK -set_attributes - B38400 8-EVEN-1 +set_attributes - B38400 8-EVEN-2 +tcsetattr(TCSAFLUSH, odd) - OK +set_attributes - B38400 8-EVEN-2 +tcsetattr(TCSASOFT, odd) - OK +set_attributes - B38400 8-EVEN-2 Init - close - /dev/test - OK Init - open - /dev/test - OK @@ -213,10 +327,18 @@ tcsetattr(TCSANOW, 1 bit) - OK set_attributes - B38400 8-NONE-1 tcsetattr(TCSADRAIN, 1 bits) - OK set_attributes - B38400 8-NONE-1 +tcsetattr(TCSAFLUSH, 1 bits) - OK +set_attributes - B38400 8-NONE-1 +tcsetattr(TCSASOFT, 1 bits) - OK +set_attributes - B38400 8-NONE-1 tcsetattr(TCSANOW, 2 bits) - OK set_attributes - B38400 8-NONE-2 tcsetattr(TCSADRAIN, 2 bits) - OK set_attributes - B38400 8-NONE-2 +tcsetattr(TCSAFLUSH, 2 bits) - OK +set_attributes - B38400 8-NONE-2 +tcsetattr(TCSASOFT, 2 bits) - OK +set_attributes - B38400 8-NONE-2 cfsetospeed(BAD BAUD) - EINVAL cfsetospeed(B0) - OK cfgetospeed(B0) - OK @@ -250,14 +372,24 @@ cfsetospeed(B19200) - OK cfgetospeed(B19200) - OK cfsetospeed(B38400) - OK cfgetospeed(B38400) - OK +cfsetospeed(B7200) - OK +cfgetospeed(B7200) - OK +cfsetospeed(B14400) - OK +cfgetospeed(B14400) - OK +cfsetospeed(B28800) - OK +cfgetospeed(B28800) - OK cfsetospeed(B57600) - OK cfgetospeed(B57600) - OK +cfsetospeed(B76800) - OK +cfgetospeed(B76800) - OK cfsetospeed(B115200) - OK cfgetospeed(B115200) - OK cfsetospeed(B230400) - OK cfgetospeed(B230400) - OK cfsetospeed(B460800) - OK cfgetospeed(B460800) - OK +cfsetospeed(B921600) - OK +cfgetospeed(B921600) - OK cfsetispeed(BAD BAUD) - EINVAL cfsetispeed(B0) - OK cfgetispeed(B0) - OK @@ -291,14 +423,24 @@ cfsetispeed(B19200) - OK cfgetispeed(B19200) - OK cfsetispeed(B38400) - OK cfgetispeed(B38400) - OK +cfsetispeed(B7200) - OK +cfgetispeed(B7200) - OK +cfsetispeed(B14400) - OK +cfgetispeed(B14400) - OK +cfsetispeed(B28800) - OK +cfgetispeed(B28800) - OK cfsetispeed(B57600) - OK cfgetispeed(B57600) - OK +cfsetispeed(B76800) - OK +cfgetispeed(B76800) - OK cfsetispeed(B115200) - OK cfgetispeed(B115200) - OK cfsetispeed(B230400) - OK cfgetispeed(B230400) - OK cfsetispeed(B460800) - OK cfgetispeed(B460800) - OK +cfsetispeed(B921600) - OK +cfgetispeed(B921600) - OK cfsetspeed(BAD BAUD) - EINVAL cfsetspeed(B0) - OK cfgetspeed(B0) - checking both inspeed and outspeed - OK @@ -332,14 +474,24 @@ cfsetspeed(B19200) - OK cfgetspeed(B19200) - checking both inspeed and outspeed - OK cfsetspeed(B38400) - OK cfgetspeed(B38400) - checking both inspeed and outspeed - OK +cfsetspeed(B7200) - OK +cfgetspeed(B7200) - checking both inspeed and outspeed - OK +cfsetspeed(B14400) - OK +cfgetspeed(B14400) - checking both inspeed and outspeed - OK +cfsetspeed(B28800) - OK +cfgetspeed(B28800) - checking both inspeed and outspeed - OK cfsetspeed(B57600) - OK cfgetspeed(B57600) - checking both inspeed and outspeed - OK +cfsetspeed(B76800) - OK +cfgetspeed(B76800) - checking both inspeed and outspeed - OK cfsetspeed(B115200) - OK cfgetspeed(B115200) - checking both inspeed and outspeed - OK cfsetspeed(B230400) - OK cfgetspeed(B230400) - checking both inspeed and outspeed - OK cfsetspeed(B460800) - OK cfgetspeed(B460800) - checking both inspeed and outspeed - OK +cfsetspeed(B921600) - OK +cfgetspeed(B921600) - checking both inspeed and outspeed - OK Init - close - /dev/test - OK Multiple open of the device Termios_test_driver - rtems_set_initial_baud - bad baud - OK @@ -395,4 +547,4 @@ Termios_test_driver - rtems_set_initial_baud - 38400 - OK Termios_test_driver - rtems_set_initial_baud - bad baud - OK Termios_test_driver - rtems_set_initial_baud - 38400 - OK -*** END OF TEST TERMIOS 01 *** +*** END OF TEST TERMIOS 1 *** diff --git a/testsuites/libtests/termios01/termios_testdriver.c b/testsuites/libtests/termios01/termios_testdriver.c index 43aeccd..bd5c7a1 100644 --- a/testsuites/libtests/termios01/termios_testdriver.c +++ b/testsuites/libtests/termios01/termios_testdriver.c @@ -85,7 +85,7 @@ int termios_test_driver_set_attributes( const char *char_size = "5"; const char *stop = "NONE"; - baud_requested = t->c_cflag & CBAUD; + baud_requested = t->c_ispeed; number = rtems_termios_baud_to_number( baud_requested ); @@ -164,7 +164,7 @@ rtems_device_driver termios_test_driver_open( int rc; rtems_libio_open_close_args_t *args = arg; static bool firstCall = true; - + static const rtems_termios_callbacks Callbacks = { NULL, /* firstOpen */ NULL, /* lastClose */ @@ -192,7 +192,7 @@ rtems_device_driver termios_test_driver_open( size_t i; firstCall = false; - + for (i = 0; i < sizeof( allocSizes ) / sizeof( allocSizes [0] ); ++i) { void *opaque = rtems_heap_greedy_allocate( allocSizes, i ); diff --git a/testsuites/libtests/termios02/termios02.scn b/testsuites/libtests/termios02/termios02.scn index 9b38d69..be46893 100644 --- a/testsuites/libtests/termios02/termios02.scn +++ b/testsuites/libtests/termios02/termios02.scn @@ -1,4 +1,4 @@ -*** TERMIOS 02 TEST *** +*** BEGIN OF TEST TERMIOS 2 *** tcdrain(12) - EBADF tcdrain(stdin) - OK tcdrain(stdout) - OK @@ -24,4 +24,4 @@ ctermid( NULL ) - OK ctermid ==> /dev/console ctermid( term_name ) - OK ctermid ==> /dev/console -*** END OF TERMIOS 02 TEST *** +*** END OF TEST TERMIOS 2 *** diff --git a/testsuites/libtests/termios03/termios03.scn b/testsuites/libtests/termios03/termios03.scn index 17802fe..e18c0af 100644 --- a/testsuites/libtests/termios03/termios03.scn +++ b/testsuites/libtests/termios03/termios03.scn @@ -1,100 +1,100 @@ -*** TEST TERMIOS03 *** -open(/dev/test) - OK -Writing: This is test output. -Transmitted 22 characters -54 68 69 73 20 69 73 20 74 65 73 74 20 6f 75 74 |This is test out| -70 75 74 2e 0d 0a |put... | - -Reading (expected): -54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this | -69 73 2e |is. | -Read 20 bytes from read(2) -54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this | -69 73 2e 0a |is.. | -Echoed 21 characters -54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this | -69 73 2e 0d 0a |is... | - -Reading (expected): -31 32 33 35 08 34 35 36 2e |1235.456. | -Read 10 bytes from read(2) -31 32 33 35 08 34 35 36 2e 0a |1235.456.. | -Echoed 12 characters -31 32 33 35 5e 48 34 35 36 2e 0d 0a |1235^H456... | - -Reading (expected): -74 61 62 09 74 61 62 2e |tab.tab. | -Read 9 bytes from read(2) -74 61 62 09 74 61 62 2e 0a |tab.tab.. | -Echoed 14 characters -74 61 62 20 20 20 20 20 74 61 62 2e 0d 0a |tab tab... | - -Reading (expected): -63 72 0d |cr. | -Read 3 bytes from read(2) -63 72 0a |cr. | -Echoed 4 characters -63 72 0d 0a |cr.. | - -Reading (expected): -61 42 63 44 65 46 67 48 2e |aBcDeFgH. | -Read 10 bytes from read(2) -61 42 63 44 65 46 67 48 2e 0a |aBcDeFgH.. | -Echoed 11 characters -61 42 63 44 65 46 67 48 2e 0d 0a |aBcDeFgH... | -Changing c_iflag to: Enable to lower case mapping on input - -Reading (expected): -61 42 63 44 65 46 67 48 2e |aBcDeFgH. | -Read 10 bytes from read(2) -61 62 63 64 65 66 67 68 2e 0a |abcdefgh.. | -Echoed 11 characters -61 62 63 64 65 66 67 68 2e 0d 0a |abcdefgh... | -Changing c_iflag to: Disable to lower case mapping on input - -Reading (expected): -54 65 73 74 69 6e 67 20 56 45 52 41 53 45 7f 2e |Testing VERASE..| -Read 15 bytes from read(2) -54 65 73 74 69 6e 67 20 56 45 52 41 53 2e 0a |Testing VERAS.. | -Echoed 20 characters -54 65 73 74 69 6e 67 20 56 45 52 41 53 45 08 20 |Testing VERASE. | -08 2e 0d 0a |.... | - -Reading (expected): -54 65 73 74 69 6e 67 20 56 4b 49 4c 4c 15 2e |Testing VKILL.. | -Read 2 bytes from read(2) -2e 0a |.. | -Echoed 55 characters -54 65 73 74 69 6e 67 20 56 4b 49 4c 4c 08 20 08 |Testing VKILL. .| -08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 |. .. .. .. .. ..| -20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 | .. .. .. .. .. | -08 08 20 08 2e 0d 0a - -Reading (expected): -7f 54 65 73 74 69 6e 67 20 56 45 52 41 53 45 20 |.Testing VERASE | -69 6e 20 63 6f 6c 75 6d 6e 20 31 2e |in column 1. | -Read 28 bytes from read(2) -54 65 73 74 69 6e 67 20 56 45 52 41 53 45 20 69 |Testing VERASE i| -6e 20 63 6f 6c 75 6d 6e 20 31 2e 0a |n column 1.. | -Echoed 29 characters -54 65 73 74 69 6e 67 20 56 45 52 41 53 45 20 69 |Testing VERASE i| -6e 20 63 6f 6c 75 6d 6e 20 31 2e 0d 0a |n column 1... | - -Reading (expected): -09 20 74 61 62 20 09 54 65 73 74 69 6e 67 20 56 |. tab .Testing V| -4b 49 4c 4c 20 61 66 74 65 72 20 74 61 62 2e 15 |KILL after tab..| -Read 1 bytes from read(2) -0a |. | -Echoed 140 characters -20 20 20 20 20 20 20 20 20 74 61 62 20 20 20 20 | tab | -54 65 73 74 69 6e 67 20 56 4b 49 4c 4c 20 61 66 |Testing VKILL af| -74 65 72 20 74 61 62 2e 08 20 08 08 20 08 08 20 |ter tab.. .. .. | -08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 |.. .. .. .. .. .| -08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 |. .. .. .. .. ..| -20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 | .. .. .. .. .. | -08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 |.. .. .. .. .. .| -08 08 08 08 20 08 08 20 08 08 20 08 08 20 08 08 |.... .. .. .. ..| -20 08 08 08 08 08 08 08 08 08 0d 0a | ........... | - -close(/dev/test) - OK -*** END OF TEST TERMIOS03 *** +*** BEGIN OF TEST TERMIOS 3 *** +open(/dev/test) - OK +Writing: This is test output. +Transmitted 22 characters +54 68 69 73 20 69 73 20 74 65 73 74 20 6f 75 74 |This is test out| +70 75 74 2e 0d 0a |put... | + +Reading (expected): +54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this | +69 73 2e |is. | +Read 20 bytes from read(2) +54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this | +69 73 2e 0a |is.. | +Echoed 21 characters +54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this | +69 73 2e 0d 0a |is... | + +Reading (expected): +31 32 33 35 08 34 35 36 2e |1235.456. | +Read 10 bytes from read(2) +31 32 33 35 08 34 35 36 2e 0a |1235.456.. | +Echoed 12 characters +31 32 33 35 5e 48 34 35 36 2e 0d 0a |1235^H456... | + +Reading (expected): +74 61 62 09 74 61 62 2e |tab.tab. | +Read 9 bytes from read(2) +74 61 62 09 74 61 62 2e 0a |tab.tab.. | +Echoed 14 characters +74 61 62 20 20 20 20 20 74 61 62 2e 0d 0a |tab tab... | + +Reading (expected): +63 72 0d |cr. | +Read 3 bytes from read(2) +63 72 0a |cr. | +Echoed 4 characters +63 72 0d 0a |cr.. | + +Reading (expected): +61 42 63 44 65 46 67 48 2e |aBcDeFgH. | +Read 10 bytes from read(2) +61 42 63 44 65 46 67 48 2e 0a |aBcDeFgH.. | +Echoed 11 characters +61 42 63 44 65 46 67 48 2e 0d 0a |aBcDeFgH... | +Changing c_iflag to: Enable to lower case mapping on input + +Reading (expected): +61 42 63 44 65 46 67 48 2e |aBcDeFgH. | +Read 10 bytes from read(2) +61 62 63 64 65 66 67 68 2e 0a |abcdefgh.. | +Echoed 11 characters +61 62 63 64 65 66 67 68 2e 0d 0a |abcdefgh... | +Changing c_iflag to: Disable to lower case mapping on input + +Reading (expected): +54 65 73 74 69 6e 67 20 56 45 52 41 53 45 7f 2e |Testing VERASE..| +Read 15 bytes from read(2) +54 65 73 74 69 6e 67 20 56 45 52 41 53 2e 0a |Testing VERAS.. | +Echoed 20 characters +54 65 73 74 69 6e 67 20 56 45 52 41 53 45 08 20 |Testing VERASE. | +08 2e 0d 0a |.... | + +Reading (expected): +54 65 73 74 69 6e 67 20 56 4b 49 4c 4c 15 2e |Testing VKILL.. | +Read 2 bytes from read(2) +2e 0a |.. | +Echoed 55 characters +54 65 73 74 69 6e 67 20 56 4b 49 4c 4c 08 20 08 |Testing VKILL. .| +08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 |. .. .. .. .. ..| +20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 | .. .. .. .. .. | +08 08 20 08 2e 0d 0a |.. .... | + +Reading (expected): +7f 54 65 73 74 69 6e 67 20 56 45 52 41 53 45 20 |.Testing VERASE | +69 6e 20 63 6f 6c 75 6d 6e 20 31 2e |in column 1. | +Read 28 bytes from read(2) +54 65 73 74 69 6e 67 20 56 45 52 41 53 45 20 69 |Testing VERASE i| +6e 20 63 6f 6c 75 6d 6e 20 31 2e 0a |n column 1.. | +Echoed 29 characters +54 65 73 74 69 6e 67 20 56 45 52 41 53 45 20 69 |Testing VERASE i| +6e 20 63 6f 6c 75 6d 6e 20 31 2e 0d 0a |n column 1... | + +Reading (expected): +09 20 74 61 62 20 09 54 65 73 74 69 6e 67 20 56 |. tab .Testing V| +4b 49 4c 4c 20 61 66 74 65 72 20 74 61 62 2e 15 |KILL after tab..| +Read 1 bytes from read(2) +0a |. | +Echoed 140 characters +20 20 20 20 20 20 20 20 20 74 61 62 20 20 20 20 | tab | +54 65 73 74 69 6e 67 20 56 4b 49 4c 4c 20 61 66 |Testing VKILL af| +74 65 72 20 74 61 62 2e 08 20 08 08 20 08 08 20 |ter tab.. .. .. | +08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 |.. .. .. .. .. .| +08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 |. .. .. .. .. ..| +20 08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 | .. .. .. .. .. | +08 08 20 08 08 20 08 08 20 08 08 20 08 08 20 08 |.. .. .. .. .. .| +08 08 08 08 20 08 08 20 08 08 20 08 08 20 08 08 |.... .. .. .. ..| +20 08 08 08 08 08 08 08 08 08 0d 0a | ........... | + +close(/dev/test) - OK +*** END OF TEST TERMIOS 3 *** diff --git a/testsuites/libtests/termios04/termios04.scn b/testsuites/libtests/termios04/termios04.scn index 99b8eb0..812369a 100644 --- a/testsuites/libtests/termios04/termios04.scn +++ b/testsuites/libtests/termios04/termios04.scn @@ -1,5 +1,5 @@ -*** TEST TERMIOS04 *** -open(/dev/test) - OK +*** BEGIN OF TEST TERMIOS 4 *** +open(/dev/test) - OK Writing: This is interrupt driven test output. Transmitted 39 characters 54 68 69 73 20 69 73 20 69 6e 74 65 72 72 75 70 |This is interrup| @@ -29,5 +29,5 @@ As Read 37 characters 4e 6f 6e 2d 42 6c 6f 63 6b 69 6e 67 20 69 6e 74 |Non-Blocking int| 65 72 72 75 70 74 20 64 72 69 76 65 6e 20 72 65 |errupt driven re| 61 64 2e 0d 0a |ad... | -close(/dev/test) - OK -*** END OF TEST TERMIOS04 *** +close(/dev/test) - OK +*** END OF TEST TERMIOS 4 *** diff --git a/testsuites/libtests/termios05/termios05.scn b/testsuites/libtests/termios05/termios05.scn index 4d2988f..e30a243 100644 --- a/testsuites/libtests/termios05/termios05.scn +++ b/testsuites/libtests/termios05/termios05.scn @@ -1,5 +1,5 @@ -*** TEST TERMIOS05 *** -open(/dev/test) - OK +*** BEGIN OF TEST TERMIOS 5 *** +open(/dev/test) - OK Writing: This is test output. Transmitted 20 characters 54 68 69 73 20 69 73 20 74 65 73 74 20 6f 75 74 |This is test out| @@ -55,5 +55,5 @@ Read 10 bytes from read(2) Echoed 12 characters 0a 61 62 63 64 65 66 67 68 2e 0d 0a |.abcdefgh... | Changing c_iflag to: Disable to lower case mapping on input -close(/dev/test) - OK -*** END OF TEST TERMIOS05 *** +close(/dev/test) - OK +*** END OF TEST TERMIOS 5 *** diff --git a/testsuites/libtests/termios06/init.c b/testsuites/libtests/termios06/init.c index 759b444..16748d0 100644 --- a/testsuites/libtests/termios06/init.c +++ b/testsuites/libtests/termios06/init.c @@ -75,12 +75,12 @@ void set_wakeups(void) { int sc; - puts( "ioctl - RTEMS_IO_SNDWAKEUP - OK" ); - sc = ioctl( Test_fd, RTEMS_IO_SNDWAKEUP, &TxWake ); + puts( "ioctl - TIOCSNDWU - OK" ); + sc = ioctl( Test_fd, TIOCSNDWU, &TxWake ); rtems_test_assert( sc == 0 ); - puts( "ioctl - RTEMS_IO_RCVWAKEUP - OK" ); - sc = ioctl( Test_fd, RTEMS_IO_RCVWAKEUP, &RxWake ); + puts( "ioctl - TIOCRCVWU - OK" ); + sc = ioctl( Test_fd, TIOCRCVWU, &RxWake ); rtems_test_assert( sc == 0 ); } diff --git a/testsuites/libtests/termios06/termios06.scn b/testsuites/libtests/termios06/termios06.scn index b558077..91dc4de 100644 --- a/testsuites/libtests/termios06/termios06.scn +++ b/testsuites/libtests/termios06/termios06.scn @@ -1,23 +1,20 @@ - - -*** TEST TERMIOS06 *** -open(/dev/test) - OK -ioctl - RTEMS_IO_SNDWAKEUP - OK -ioctl - RTEMS_IO_RCVWAKEUP - OK +*** BEGIN OF TEST TERMIOS 6 *** +open(/dev/test) - OK +ioctl - TIOCSNDWU - OK +ioctl - TIOCRCVWU - OK ioctl - TIOCGETD - OK ioctl - TIOCSETD - OK pppopen called ioctl - TIOCSETD - OK pppclose called pppopen called -write(PPPD TEST) - OK +write(PPPD TEST) - OK pppwrite called - 10 bytes 50 50 50 44 20 54 45 53 54 00 |PPPD TEST. | - pppstart called -ioctl(/dev/test) - OK +ioctl(/dev/test) - OK pppioctl called -tcgetattr(/dev/test) - OK +tcgetattr(/dev/test) - OK Turn on flow control on output - OK Turn off flow control on output - OK Turn on flow control on input - OK @@ -25,9 +22,7 @@ Turn off flow control on input - OK Reading (expected): 54 68 69 73 20 69 73 20 74 65 73 74 20 50 50 50 |This is test PPP| - 20 69 6e 70 75 74 | input | - pppread called pppinput called - with (T) pppinput called - with (h) @@ -53,8 +48,7 @@ pppinput called - with (u) pppinput called - with (t) pppinput called - with (.) Rx_Wake - invoked - Read 0 bytes from read(2) -close(/dev/test) - OK +Error: length must be greater than zero.close(/dev/test) - OK pppclose called -*** END OF TEST TERMIOS06 *** +*** END OF TEST TERMIOS 6 *** diff --git a/testsuites/libtests/termios07/termios07.scn b/testsuites/libtests/termios07/termios07.scn index a636120..e5630db 100644 --- a/testsuites/libtests/termios07/termios07.scn +++ b/testsuites/libtests/termios07/termios07.scn @@ -1 +1,20 @@ -XXX fill in with test output +*** BEGIN OF TEST TERMIOS 7 *** +rtems_termios_bufsize( 64, 64, 64 ) - OK +open(/dev/test) - OK +Changing c_iflag to: Set XON/XOFF +Writing: 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789Transmitted 200 characters +30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 |0123456789012345| +36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 |6789012345678901| +32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 |2345678901234567| +38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 |8901234567890123| +34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 |4567890123456789| +30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 |0123456789012345| +36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 |6789012345678901| +32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 |2345678901234567| +38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 |8901234567890123| +34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 |4567890123456789| +30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 |0123456789012345| +36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 |6789012345678901| +32 33 34 35 36 37 38 39 |23456789 | +close(/dev/test) - OK +*** END OF TEST TERMIOS 7 *** diff --git a/testsuites/libtests/termios08/termios08.scn b/testsuites/libtests/termios08/termios08.scn index a636120..469d537 100644 --- a/testsuites/libtests/termios08/termios08.scn +++ b/testsuites/libtests/termios08/termios08.scn @@ -1 +1,18 @@ -XXX fill in with test output +*** BEGIN OF TEST TERMIOS 8 *** +open(/dev/test) - OK +Changing c_lflag to: non-canonical +Changing to polling - VMIN=0 VTIME=0 +read - 0 expected +Changing to half-second timeout - VMIN=0 VTIME=5 +read - 0 expected +Changing to half-second timeout - VMIN=5 VTIME=3 +Enqueue 2 characters +read - 2 expected +Changing to half-second timeout - VMIN=5 VTIME=3 +Enqueue 1 character +read - 1 expected +Enqueue 7 characters +read - 5 expected +read - 2 expected +close(/dev/test) - OK +*** END OF TEST TERMIOS 8 *** -- 1.9.1 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel