Changeset 3096f5c9 in rtems
- Timestamp:
- 12/06/13 22:13:27 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- a19a7077
- Parents:
- 1d325e7b
- git-author:
- Daniel Ramirez <javamonn@…> (12/06/13 22:13:27)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (01/09/14 15:21:49)
- Location:
- testsuites/libtests/termios01
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/libtests/termios01/init.c
r1d325e7b r3096f5c9 458 458 } 459 459 460 static void test_termios_cfsetspeed(void) 461 { 462 int i; 463 int status; 464 speed_t speed; 465 struct termios term; 466 tcflag_t bad; 467 468 bad = CBAUD << 1; 469 memset( &term, '\0', sizeof(term) ); 470 puts( "cfsetspeed(BAD BAUD) - EINVAL" ); 471 status = cfsetspeed( &term, bad ); 472 rtems_test_assert( status == -1 ); 473 rtems_test_assert( errno == EINVAL ); 474 475 for (i=0 ; baud_table[i].constant != INVALID_CONSTANT ; i++ ) { 476 memset( &term, '\0', sizeof(term) ); 477 printf( 478 "cfsetspeed(B%" PRIdrtems_termios_baud_t ") - OK\n", 479 baud_table[i].baud 480 ); 481 status = cfsetspeed( &term, baud_table[i].constant ); 482 rtems_test_assert( !status ); 483 484 printf( 485 "cfgetspeed(B%" PRIdrtems_termios_baud_t ") - checking both inspeed and outspeed - OK\n", 486 baud_table[i].baud 487 ); 488 speed = cfgetispeed( &term ); 489 rtems_test_assert( speed == baud_table[i].constant ); 490 491 speed = cfgetospeed( &term ); 492 rtems_test_assert( speed == baud_table[i].constant ); 493 } 494 } 495 496 static void test_termios_cfmakeraw(void) 497 { 498 struct termios term; 499 500 memset( &term, '\0', sizeof(term) ); 501 cfmakeraw( &term ); 502 puts( "cfmakeraw - OK" ); 503 504 /* Check that all of the flags were set correctly */ 505 rtems_test_assert( ~(term.c_iflag & (IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON)) ); 506 507 rtems_test_assert( ~(term.c_oflag & OPOST) ); 508 509 rtems_test_assert( ~(term.c_lflag & (ECHO|ECHONL|ICANON|ISIG|IEXTEN)) ); 510 511 rtems_test_assert( ~(term.c_cflag & (CSIZE|PARENB)) ); 512 513 rtems_test_assert( term.c_cflag & CS8 ); 514 } 515 460 516 static rtems_task Init( 461 517 rtems_task_argument ignored … … 506 562 rtems_test_assert( rc == -1 ); 507 563 rtems_test_assert( errno == ENOTSUP ); 564 565 test_termios_cfmakeraw(); 508 566 509 567 /* … … 589 647 test_termios_cfinspeed(); 590 648 649 test_termios_cfsetspeed(); 650 591 651 puts( "Init - close - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK" ); 592 652 rc = close( test ); -
testsuites/libtests/termios01/termios01.scn
r1d325e7b r3096f5c9 2 2 Test termios_baud2index... 3 3 termios_baud_to_index(-2) - NOT OK 4 termios_baud_to_index(572) - NOT OK5 4 termios_baud_to_index(B0) - OK 6 5 termios_baud_to_index(B50) - OK … … 26 25 Test termios_baud2number... 27 26 termios_baud_to_number(-2) - NOT OK 28 termios_baud_to_number(572) - NOT OK29 27 termios_baud_to_number(B0) - OK 30 28 termios_baud_to_number(B50) - OK … … 50 48 Test termios_number_to_baud... 51 49 termios_number_to_baud(-2) - NOT OK 52 termios_number_to_baud(572) - NOT OK53 50 termios_number_to_baud(B0) - OK 54 51 termios_number_to_baud(B50) - OK … … 79 76 Termios_test_driver - rtems_set_initial_baud - 38400 - OK 80 77 tcsetattr - invalid operation - ENOTSUP 78 cfmakeraw - OK 81 79 82 80 tcsetattr - drain - OK … … 302 300 cfsetispeed(B460800) - OK 303 301 cfgetispeed(B460800) - OK 302 cfsetspeed(BAD BAUD) - EINVAL 303 cfsetspeed(B0) - OK 304 cfgetspeed(B0) - checking both inspeed and outspeed - OK 305 cfsetspeed(B50) - OK 306 cfgetspeed(B50) - checking both inspeed and outspeed - OK 307 cfsetspeed(B75) - OK 308 cfgetspeed(B75) - checking both inspeed and outspeed - OK 309 cfsetspeed(B110) - OK 310 cfgetspeed(B110) - checking both inspeed and outspeed - OK 311 cfsetspeed(B134) - OK 312 cfgetspeed(B134) - checking both inspeed and outspeed - OK 313 cfsetspeed(B150) - OK 314 cfgetspeed(B150) - checking both inspeed and outspeed - OK 315 cfsetspeed(B200) - OK 316 cfgetspeed(B200) - checking both inspeed and outspeed - OK 317 cfsetspeed(B300) - OK 318 cfgetspeed(B300) - checking both inspeed and outspeed - OK 319 cfsetspeed(B600) - OK 320 cfgetspeed(B600) - checking both inspeed and outspeed - OK 321 cfsetspeed(B1200) - OK 322 cfgetspeed(B1200) - checking both inspeed and outspeed - OK 323 cfsetspeed(B1800) - OK 324 cfgetspeed(B1800) - checking both inspeed and outspeed - OK 325 cfsetspeed(B2400) - OK 326 cfgetspeed(B2400) - checking both inspeed and outspeed - OK 327 cfsetspeed(B4800) - OK 328 cfgetspeed(B4800) - checking both inspeed and outspeed - OK 329 cfsetspeed(B9600) - OK 330 cfgetspeed(B9600) - checking both inspeed and outspeed - OK 331 cfsetspeed(B19200) - OK 332 cfgetspeed(B19200) - checking both inspeed and outspeed - OK 333 cfsetspeed(B38400) - OK 334 cfgetspeed(B38400) - checking both inspeed and outspeed - OK 335 cfsetspeed(B57600) - OK 336 cfgetspeed(B57600) - checking both inspeed and outspeed - OK 337 cfsetspeed(B115200) - OK 338 cfgetspeed(B115200) - checking both inspeed and outspeed - OK 339 cfsetspeed(B230400) - OK 340 cfgetspeed(B230400) - checking both inspeed and outspeed - OK 341 cfsetspeed(B460800) - OK 342 cfgetspeed(B460800) - checking both inspeed and outspeed - OK 304 343 Init - close - /dev/test - OK 305 344 Multiple open of the device
Note: See TracChangeset
for help on using the changeset viewer.