summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2009-10-27 11:43:29 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2009-10-27 11:43:29 +0000
commit14664255e8e15353b1735a118f72a60c0f651dc5 (patch)
treec4becfa4ab49d59c87ad78f81460dfe2a99b5c54 /testsuites/libtests
parent2009-10-27 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-14664255e8e15353b1735a118f72a60c0f651dc5.tar.bz2
Fix parity_table_Entry type.
Correct parity_table initialization. Add PRIdrtems_termios_baud_t. Use PRIdrtems_termios_baud_t to print rtems_termios_baud_t's.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/termios01/init.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/testsuites/libtests/termios01/init.c b/testsuites/libtests/termios01/init.c
index dba3a4791e..dffbc43919 100644
--- a/testsuites/libtests/termios01/init.c
+++ b/testsuites/libtests/termios01/init.c
@@ -16,6 +16,9 @@
#include <fcntl.h>
#include <sys/errno.h>
+/* rtems_termios_baud_t is a typedefs to int32_t */
+#define PRIdrtems_termios_baud_t PRId32
+
/*
* Termios Test Driver
*/
@@ -82,7 +85,7 @@ termios_character_size_test_r char_size_table[] = {
*/
typedef struct {
int constant;
- const char parity[5];
+ const char *parity;
} termios_parity_test_r;
/*
@@ -92,7 +95,7 @@ termios_parity_test_r parity_table[] = {
{ 0, "none" },
{ PARENB, "even" },
{ PARENB | PARODD, "odd" },
- { -1, -1 }
+ { -1, NULL }
};
/*
@@ -134,7 +137,7 @@ void test_termios_baud2index(void)
if ( i != -1 )
for (i=0 ; baud_table[i].constant != -1 ; i++ ) {
- printf( "termios_baud_to_index(B%d) - OK\n", baud_table[i].baud );
+ printf( "termios_baud_to_index(B%" PRIdrtems_termios_baud_t ") - OK\n", baud_table[i].baud );
index = rtems_termios_baud_to_index( baud_table[i].constant );
if ( index != i ) {
printf( "ERROR - returned %d should be %d\n", index, i );
@@ -164,11 +167,11 @@ void test_termios_baud2number(void)
assert ( i == -1 );
for (i=0 ; baud_table[i].constant != -1 ; i++ ) {
- printf( "termios_baud_to_number(B%d) - OK\n", baud_table[i].baud );
+ printf( "termios_baud_to_number(B%" PRIdrtems_termios_baud_t ") - OK\n", baud_table[i].baud );
number = rtems_termios_baud_to_number( baud_table[i].constant );
if ( number != baud_table[i].baud ) {
printf(
- "ERROR - returned %d should be %d\n",
+ "ERROR - returned %d should be %" PRIdrtems_termios_baud_t "\n",
number,
baud_table[i].baud
);
@@ -198,7 +201,7 @@ void test_termios_number_to_baud(void)
assert ( i == -1 );
for (i=0 ; baud_table[i].constant != -1 ; i++ ) {
- printf( "termios_number_to_baud(B%d) - OK\n", baud_table[i].baud );
+ printf( "termios_number_to_baud(B%" PRIdrtems_termios_baud_t ") - OK\n", baud_table[i].baud );
termios_baud = rtems_termios_number_to_baud( baud_table[i].baud );
if ( termios_baud != baud_table[i].constant ) {
printf(
@@ -233,14 +236,14 @@ void test_termios_set_baud(
attr.c_cflag &= ~CBAUD;
attr.c_cflag |= baud_table[i].constant;
- printf( "tcsetattr(TCSANOW, B%d) - OK\n", baud_table[i].baud );
+ printf( "tcsetattr(TCSANOW, B%" PRIdrtems_termios_baud_t ") - OK\n", baud_table[i].baud );
sc = tcsetattr( test, TCSANOW, &attr );
if ( sc != 0 ) {
printf( "ERROR - return %d\n", sc );
rtems_test_exit(0);
}
- printf( "tcsetattr(TCSADRAIN, B%d) - OK\n", baud_table[i].baud );
+ printf( "tcsetattr(TCSADRAIN, B%" PRIdrtems_termios_baud_t ") - OK\n", baud_table[i].baud );
sc = tcsetattr( test, TCSANOW, &attr );
if ( sc != 0 ) {
printf( "ERROR - return %d\n", sc );