summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjeikabu <jeikabu@users.noreply.github.com>2020-06-16 21:06:51 +0300
committerGarrett D'Amore <garrett@damore.org>2020-06-16 11:22:10 -0700
commitb12081bebe85dfc02bbc2b23d48458613be20fa2 (patch)
treec6d50c8ff3db7b32b72149e11f7ad35155ee823a /tests
parent59301ab3f80991086519124d020edbe94a74615c (diff)
downloadnng-b12081bebe85dfc02bbc2b23d48458613be20fa2.tar.gz
nng-b12081bebe85dfc02bbc2b23d48458613be20fa2.tar.bz2
nng-b12081bebe85dfc02bbc2b23d48458613be20fa2.zip
fix #1252
- nng_msg_clear should only clear the message body and not the head. Add test to verify
Diffstat (limited to 'tests')
-rw-r--r--tests/message.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/message.c b/tests/message.c
index 22dd2852..1eda09b1 100644
--- a/tests/message.c
+++ b/tests/message.c
@@ -91,10 +91,13 @@ TestMain("Message Tests", {
});
Convey("Clearing the body works", {
+ nng_msg_header_append(msg, "bogus", 6);
So(nng_msg_append(msg, "bogus", 6) == 0);
So(nng_msg_len(msg) == 6);
nng_msg_clear(msg);
So(nng_msg_len(msg) == 0);
+ // It shouldn't clear the header
+ So(nng_msg_header_len(msg) == 6);
});
Convey("We cannot delete more header than exists", {