2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>

* Makefile.am, configure.ac, malloctest/init.c, termios03/init.c,
	termios03/termios03.scn: Handle some of the VKILL and VERASE cases.
This commit is contained in:
Joel Sherrill
2010-06-28 17:05:25 +00:00
parent 170f26aa17
commit 33ece501be
6 changed files with 72 additions and 17 deletions

View File

@@ -1,3 +1,8 @@
2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, malloctest/init.c, termios03/init.c,
termios03/termios03.scn: Handle some of the VKILL and VERASE cases.
2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add new test to exercise termios RX and TX

View File

@@ -8,6 +8,7 @@ SUBDIRS = POSIX
SUBDIRS += bspcmdline01 cpuuse malloctest malloc02 malloc03 heapwalk \
putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
termios termios01 termios02 termios03 termios04 termios05 \
termios termios01 termios02 termios03 termios04 \
rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
block08 block09 block10 stringto01

View File

@@ -62,6 +62,7 @@ termios01/Makefile
termios02/Makefile
termios03/Makefile
termios04/Makefile
termios05/Makefile
tztest/Makefile
POSIX/Makefile
])

View File

@@ -1045,20 +1045,13 @@ static void test_posix_memalign(void)
sc = posix_memalign( &p1, 2, 8 );
fatal_posix_service_status( sc, EINVAL, "posix_memalign alignment of 2" );
if ( sizeof(int) == 4 )
maximumShift = 31;
else if ( sizeof(int) == 2 )
maximumShift = 15;
else {
printf( "Unsupported int size == %zu\n", sizeof(int) );
rtems_test_exit(0);
}
for ( i=2 ; i<maximumShift ; i++ ) {
printf( "posix_memalign - alignment of %" PRId32 " -- OK\n",
(int32_t) 1 << i );
sc = posix_memalign( &p1, 1 << i, 8 );
maximumShift = (sizeof(size_t) * CHAR_BIT) - 1;
for ( i=sizeof(void *) ; i<maximumShift ; i++ ) {
size_t alignment = 1 << i;
printf( "posix_memalign - alignment of %zd -- OK\n", alignment);
sc = posix_memalign( &p1, alignment, 8 );
if ( sc == ENOMEM ) {
printf( "posix_memalign - ran out of memory trying %d\n", 1<<i );
printf( "posix_memalign - ran out of memory trying %zd\n", alignment );
break;
}
posix_service_failed( sc, "posix_memalign alignment OK" );
@@ -1066,8 +1059,8 @@ static void test_posix_memalign(void)
free( p1 );
}
for ( ; i<maximumShift ; i++ ) {
printf( "posix_memalign - alignment of %" PRId32 " -- SKIPPED\n",
(int32_t) 1 << i );
size_t alignment = 1 << i;
printf( "posix_memalign - alignment of %zd -- SKIPPED\n", alignment);
}
}

View File

@@ -103,6 +103,10 @@ const char ExpectedInput_2[] = "1235\b456.\n";
const char ExpectedInput_3[] = "tab\ttab.\n";
const char ExpectedInput_4[] = "cr\r.";
const char ExpectedInput_5[] = "aBcDeFgH.\n";
const char ExpectedInput_6[] = "Testing VERASE\177.\n";
const char ExpectedInput_7[] = "Testing VKILL\025.\n";
const char ExpectedInput_8[] = "\177Testing VERASE in column 1.\n";
const char ExpectedInput_9[] = "\t tab \tTesting VKILL after tab.\025\n";
rtems_task Init(
rtems_task_argument argument
@@ -125,6 +129,12 @@ rtems_task Init(
read_helper( Test_fd, ExpectedInput_5 );
change_iflag( "Disable to lower case mapping on input", IUCLC, 0 );
read_helper( Test_fd, ExpectedInput_6 );
read_helper( Test_fd, ExpectedInput_7 );
read_helper( Test_fd, ExpectedInput_8 );
read_helper( Test_fd, ExpectedInput_9 );
puts( "" );
close_it();
puts( "*** END OF TEST TERMIOS03 ***" );

View File

@@ -14,7 +14,7 @@ Read 20 bytes from read(2)
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)
@@ -51,5 +51,50 @@ Read 10 bytes from read(2)
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
close(/dev/test) - OK
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 ***