summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-28 17:05:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-28 17:05:25 +0000
commit33ece501be15fa64e76fb8c9faed0dcef12a7ba9 (patch)
tree6aa00902ad9adce43b9fdf136178892463e8fef5 /testsuites/libtests
parent2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-33ece501be15fa64e76fb8c9faed0dcef12a7ba9.tar.bz2
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.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/ChangeLog5
-rw-r--r--testsuites/libtests/Makefile.am1
-rw-r--r--testsuites/libtests/configure.ac1
-rw-r--r--testsuites/libtests/malloctest/init.c23
-rw-r--r--testsuites/libtests/termios03/init.c10
-rw-r--r--testsuites/libtests/termios03/termios03.scn49
6 files changed, 72 insertions, 17 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog
index c774242524..1f82e000dc 100644
--- a/testsuites/libtests/ChangeLog
+++ b/testsuites/libtests/ChangeLog
@@ -1,5 +1,10 @@
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
interrupt driven IO support.
* termios04/.cvsignore, termios04/Makefile.am, termios04/init.c,
diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am
index 4ca02f5077..8aef8ea3f2 100644
--- a/testsuites/libtests/Makefile.am
+++ b/testsuites/libtests/Makefile.am
@@ -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
diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac
index e361ae7791..fa91dfff3d 100644
--- a/testsuites/libtests/configure.ac
+++ b/testsuites/libtests/configure.ac
@@ -62,6 +62,7 @@ termios01/Makefile
termios02/Makefile
termios03/Makefile
termios04/Makefile
+termios05/Makefile
tztest/Makefile
POSIX/Makefile
])
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
index a2054f6d77..4b88f3b03f 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -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);
}
}
diff --git a/testsuites/libtests/termios03/init.c b/testsuites/libtests/termios03/init.c
index 555b7bdbc5..0d21d20dd2 100644
--- a/testsuites/libtests/termios03/init.c
+++ b/testsuites/libtests/termios03/init.c
@@ -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 ***" );
diff --git a/testsuites/libtests/termios03/termios03.scn b/testsuites/libtests/termios03/termios03.scn
index bfd154b797..17802fed0e 100644
--- a/testsuites/libtests/termios03/termios03.scn
+++ b/testsuites/libtests/termios03/termios03.scn
@@ -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 ***