summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-17 22:44:37 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-17 22:44:37 +0000
commit548e3a80c49949bb6cec2fa34d67872c05d09451 (patch)
tree4e997a6732dae07275151995bf9d7490e989f0b8
parent7f6888b1ae0e1f4e87ba2176b36a88d0d0370d74 (diff)
downloadnuttx-548e3a80c49949bb6cec2fa34d67872c05d09451.tar.gz
nuttx-548e3a80c49949bb6cec2fa34d67872c05d09451.tar.bz2
nuttx-548e3a80c49949bb6cec2fa34d67872c05d09451.zip
Minor test improvements
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@84 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/examples/ostest/mqueue.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/nuttx/examples/ostest/mqueue.c b/nuttx/examples/ostest/mqueue.c
index 9e9360726..a0c454e44 100644
--- a/nuttx/examples/ostest/mqueue.c
+++ b/nuttx/examples/ostest/mqueue.c
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
#include <pthread.h>
#include <mqueue.h>
#include <sched.h>
@@ -185,6 +186,7 @@ static void *receiver_thread(void *arg)
for (i = 0; i < 10; i++)
{
+ memset(msg_buffer, 0xaa, TEST_MSGLEN);
nbytes = mq_receive(mqfd, msg_buffer, TEST_MSGLEN, 0);
if (nbytes < 0)
{
@@ -205,11 +207,19 @@ static void *receiver_thread(void *arg)
for (j = 0; j < TEST_MSGLEN-1; j++)
{
- printf("receiver_thread: %2d %02x (%c) %02x\n",
- j, TEST_MESSAGE[j], TEST_MESSAGE[j], msg_buffer[j] & 0x0ff);
+ if (isprint(msg_buffer[j]))
+ {
+ 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",
- j, msg_buffer[j] & 0xff);
+ printf("receiver_thread: %2d 00 %02x\n",
+ j, msg_buffer[j]);
}
else
{