Changeset 11b9b5d in rtems
- Timestamp:
- 09/16/11 09:24:52 (12 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 3ce764a
- Parents:
- 7c9d27e
- Location:
- testsuites/libtests
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/libtests/ChangeLog
r7c9d27e r11b9b5d 1 2011-09-16 Sebastian Huber <Sebastian.Huber@embedded-brains.de> 2 3 * monitor/monitor.scn, termios/termios.scn: New files. 4 * monitor/init.c, termios01/init.c: Use rtems_shell_wait_for_input(). 5 1 6 2011-09-02 Sebastian Huber <sebastian.huber@embedded-brains.de> 2 7 -
testsuites/libtests/monitor/init.c
r7c9d27e r11b9b5d 22 22 23 23 #include <rtems/monitor.h> 24 #include <rtems/shell.h> 24 25 25 26 rtems_task_priority Priorities[6] = { 0, 1, 1, 3, 4, 5 }; … … 37 38 } 38 39 39 40 static void notification(int fd, int seconds_remaining, void *arg) 41 { 42 printf( 43 "Press any key to enter monitor (%is remaining)\n", 44 seconds_remaining 45 ); 46 } 40 47 41 48 rtems_task Init( … … 46 53 rtems_status_code status; 47 54 48 puts( "\n\n*** MONITOR TASK TEST***" );55 puts( "\n\n*** TEST MONITOR ***" ); 49 56 50 57 Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); … … 71 78 } 72 79 73 rtems_monitor_init( 0 ); 80 status = rtems_shell_wait_for_input( 81 STDIN_FILENO, 82 20, 83 notification, 84 NULL 85 ); 86 if (status == RTEMS_SUCCESSFUL) { 87 rtems_monitor_init( 0 ); 74 88 75 status = rtems_task_delete( RTEMS_SELF ); 76 directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); 89 status = rtems_task_delete( RTEMS_SELF ); 90 directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); 91 } else { 92 puts( "*** END OF TEST MONITOR ***" ); 93 94 rtems_test_exit( 0 ); 95 } 77 96 } -
testsuites/libtests/termios/init.c
r7c9d27e r11b9b5d 44 44 45 45 #include <rtems/confdefs.h> 46 #include <rtems/shell.h> 46 47 47 48 #include <stdio.h> … … 712 713 } 713 714 715 static void notification( int fd, int seconds_remaining, void *arg ) 716 { 717 printf( 718 "Press any key to check the termios input capabilities (%is remaining)\n", 719 seconds_remaining 720 ); 721 } 714 722 715 723 /* … … 719 727 Init (rtems_task_argument ignored) 720 728 { 729 rtems_status_code status; 721 730 char c ; 722 731 struct termios orig_termios, test_termios; 723 732 724 printf( "\n\n*** TEST OF TERMIOS INPUT CAPABILITIES ***\n" ); 725 726 if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) { 727 perror( "tcgetattr() failed" ); 733 puts( "\n\n*** TEST TERMIOS INPUT CAPABILITIES ***" ); 734 735 status = rtems_shell_wait_for_input( 736 STDIN_FILENO, 737 20, 738 notification, 739 NULL 740 ); 741 if (status == RTEMS_SUCCESSFUL) { 742 if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) { 743 perror( "tcgetattr() failed" ); 744 rtems_test_exit( 0 ); 745 } 746 747 test_termios = orig_termios; 748 749 usage(); 750 for(;;) { 751 switch( c = getchar() ) { 752 case '1': 753 printf( "\nResetting the line to the original termios setting\n\n" ); 754 test_termios = orig_termios; 755 if( tcsetattr( fileno( stdin ), TCSADRAIN, &test_termios ) < 0 ) { 756 perror( "tcsetattr() failed" ); 757 rtems_test_exit( 1 ); 758 } 759 usage(); 760 break; 761 762 case '2': 763 print_termios( &test_termios ); 764 usage(); 765 break; 766 767 case '3': 768 change_line_settings( &test_termios ); 769 usage(); 770 break; 771 772 case '4': 773 canonical_input( &test_termios ); 774 usage(); 775 break; 776 777 case '5': 778 raw_input( &test_termios ); 779 usage(); 780 break; 781 782 case '9': 783 rtems_test_exit( 1 ); 784 785 case '\n': 786 break; 787 788 default: 789 printf( "\n%c is not a valid choice. Try again\n\n", c ); 790 usage(); 791 break; 792 } 793 } 794 } else { 795 puts( "*** END OF TEST TERMIOS INPUT CAPABILITIES ***" ); 796 728 797 rtems_test_exit( 0 ); 729 798 } 730 731 test_termios = orig_termios; 732 733 usage(); 734 for(;;) { 735 switch( c = getchar() ) { 736 case '1': 737 printf( "\nResetting the line to the original termios setting\n\n" ); 738 test_termios = orig_termios; 739 if( tcsetattr( fileno( stdin ), TCSADRAIN, &test_termios ) < 0 ) { 740 perror( "tcsetattr() failed" ); 741 rtems_test_exit( 1 ); 742 } 743 usage(); 744 break; 745 746 case '2': 747 print_termios( &test_termios ); 748 usage(); 749 break; 750 751 case '3': 752 change_line_settings( &test_termios ); 753 usage(); 754 break; 755 756 case '4': 757 canonical_input( &test_termios ); 758 usage(); 759 break; 760 761 case '5': 762 raw_input( &test_termios ); 763 usage(); 764 break; 765 766 case '9': 767 rtems_test_exit( 1 ); 768 769 case '\n': 770 break; 771 772 default: 773 printf( "\n%c is not a valid choice. Try again\n\n", c ); 774 usage(); 775 break; 776 } 777 } 778 } 799 }
Note: See TracChangeset
for help on using the changeset viewer.