summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-11-05 13:17:31 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-11-05 13:17:31 +0100
commite0b571f22a640d39f0c7197dc6498b0644c29e8e (patch)
tree18342558c8b36277606f3c38431bbd067bdd731f /tests
parentaefc9282dc7bd056aa66cc34b7a2ab90e7a77cd9 (diff)
downloadgnutls-e0b571f22a640d39f0c7197dc6498b0644c29e8e.tar.gz
tests: enhanced test to check the return value of gnutls_record_send()
Diffstat (limited to 'tests')
-rw-r--r--tests/anonself.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/anonself.c b/tests/anonself.c
index 12f0df992b..e3e0008e58 100644
--- a/tests/anonself.c
+++ b/tests/anonself.c
@@ -122,7 +122,11 @@ static void client(int sd)
gnutls_protocol_get_name
(gnutls_protocol_get_version(session)));
- gnutls_record_send(session, MSG, strlen(MSG));
+ ret = gnutls_record_send(session, MSG, sizeof(MSG)-1);
+ if (ret != sizeof(MSG)-1) {
+ fail("return value of gnutls_record_send() is bogus\n");
+ exit(1);
+ }
ret = gnutls_record_recv(session, buffer, MAX_BUF);
if (ret == 0) {
@@ -135,7 +139,7 @@ static void client(int sd)
goto end;
}
- if (ret != strlen(MSG) || memcmp(buffer, MSG, ret) != 0) {
+ if (ret != sizeof(MSG)-1 || memcmp(buffer, MSG, ret) != 0) {
fail("client: received data of different size! (expected: %d, have: %d)\n",
(int)strlen(MSG), ret);
goto end;