From b12081bebe85dfc02bbc2b23d48458613be20fa2 Mon Sep 17 00:00:00 2001 From: jeikabu Date: Tue, 16 Jun 2020 21:06:51 +0300 Subject: fix #1252 - nng_msg_clear should only clear the message body and not the head. Add test to verify --- tests/message.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') 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", { -- cgit v1.2.3-70-g09d2