Add test for packing/unpacking nil

This commit is contained in:
Huu Nguyen
2015-10-23 08:49:06 -07:00
parent 5e57dc5da7
commit 6a127eb24f

View File

@@ -278,6 +278,16 @@ TEST(MSGPACK, simple_buffer_double)
} }
} }
TEST(MSGPACK, simple_buffer_nil)
{
msgpack::sbuffer sbuf;
msgpack::packer<msgpack::sbuffer> packer(sbuf);
packer.pack_nil();
msgpack::unpacked ret;
msgpack::unpack(ret, sbuf.data(), sbuf.size());
EXPECT_EQ(ret.get().type, msgpack::type::NIL);
}
TEST(MSGPACK, simple_buffer_true) TEST(MSGPACK, simple_buffer_true)
{ {
msgpack::sbuffer sbuf; msgpack::sbuffer sbuf;