summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/test_client.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_client.c b/tests/test_client.c
index 5f5e44b..691dd6d 100644
--- a/tests/test_client.c
+++ b/tests/test_client.c
@@ -49,6 +49,17 @@ void newmsg_cb(const unsigned char *peer_id, const char* msgbuf, unsigned int nb
return;
}
+ if (random_message_mode)
+ {
+ //compare received & sent messages, fail if they do not match exactly
+ if (memcmp(msgbuf, buf, nb) != 0)
+ {
+ printf("sent and returned messages are not equal!\n");
+ return 1;
+ }
+
+ }
+
memcpy(buf, msgbuf, nb);
buf[nb] = 0;
printf(" %s: ", PICA_id_to_base64(peer_id, NULL));