<<< Breaking change >>>
In the functions unpack() and parse(),
Old behavior: If any parse error is happend, offset is NOT updated.
New behavior: If any parse error is happend, offset is updated to the
position the error happened.

It helps MessagePack format error analysis.

If you want to old behavior, copy the original value of offset and then call unpack()
and/or parse().
This commit is contained in:
Takatoshi Kondo
2017-10-22 17:49:38 +09:00
parent 9513734040
commit 5ece2ef2c7
7 changed files with 338 additions and 37 deletions

View File

@@ -370,7 +370,7 @@ TEST(unpack, insufficient_bytes_ref)
}
catch (msgpack::insufficient_bytes const&) {
EXPECT_TRUE(true);
EXPECT_EQ(off, 0u);
EXPECT_EQ(1u, off);
}
}
@@ -387,7 +387,7 @@ TEST(unpack, insufficient_bytes_object_handle)
}
catch (msgpack::insufficient_bytes const&) {
EXPECT_TRUE(true);
EXPECT_EQ(off, 0u);
EXPECT_EQ(1u, off);
}
}
@@ -405,7 +405,7 @@ TEST(unpack, insufficient_bytes_zone)
}
catch (msgpack::insufficient_bytes const&) {
EXPECT_TRUE(true);
EXPECT_EQ(off, 0u);
EXPECT_EQ(1u, off);
}
}