Minor test improvements

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@84 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2007-03-17 22:44:37 +00:00
parent efa050ddfa
commit 5a8969b00c

View File

@ -39,6 +39,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <pthread.h> #include <pthread.h>
#include <mqueue.h> #include <mqueue.h>
#include <sched.h> #include <sched.h>
@ -185,6 +186,7 @@ static void *receiver_thread(void *arg)
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
{ {
memset(msg_buffer, 0xaa, TEST_MSGLEN);
nbytes = mq_receive(mqfd, msg_buffer, TEST_MSGLEN, 0); nbytes = mq_receive(mqfd, msg_buffer, TEST_MSGLEN, 0);
if (nbytes < 0) if (nbytes < 0)
{ {
@ -205,11 +207,19 @@ static void *receiver_thread(void *arg)
for (j = 0; j < TEST_MSGLEN-1; j++) for (j = 0; j < TEST_MSGLEN-1; j++)
{ {
printf("receiver_thread: %2d %02x (%c) %02x\n", if (isprint(msg_buffer[j]))
j, TEST_MESSAGE[j], TEST_MESSAGE[j], msg_buffer[j] & 0x0ff); {
printf("receiver_thread: %2d %02x (%c) %02x (%c)\n",
j, TEST_MESSAGE[j], TEST_MESSAGE[j], msg_buffer[j], msg_buffer[j]);
}
else
{
printf("receiver_thread: %2d %02x (%c) %02x\n",
j, TEST_MESSAGE[j], TEST_MESSAGE[j], msg_buffer[j]);
}
} }
printf("receiver_thread: %2d 00 %02x\n", printf("receiver_thread: %2d 00 %02x\n",
j, msg_buffer[j] & 0xff); j, msg_buffer[j]);
} }
else else
{ {