Merge pull request #378 from whoshuu/add-nil-pack-test

Add test for packing/unpacking nil
This commit is contained in:
Takatoshi Kondo 2015-10-25 19:06:50 +09:00
commit ea991d5a01

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;