Treat kParseError logically kDirty.

PiperOrigin-RevId: 550564661
pull/13381/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 004f54af8f
commit 46ddd14efd
  1. 10
      src/google/protobuf/message_unittest.inc

@ -342,6 +342,16 @@ TEST(MESSAGE_TEST_NAME, ExplicitLazyExceedRecursionLimit) {
EXPECT_NE(parsed.lazy_child().child().payload().optional_int32(), -1);
}
TEST(MESSAGE_TEST_NAME, UnparsedEmpty) {
// lazy_child, LEN=100 with no payload.
const char encoded[] = {'\042', 100};
UNITTEST::NestedTestAllTypes message;
EXPECT_FALSE(message.ParseFromArray(encoded, sizeof(encoded)));
EXPECT_TRUE(message.has_lazy_child());
EXPECT_EQ(message.lazy_child().ByteSizeLong(), 0);
}
TEST(MESSAGE_TEST_NAME, ParseFailNonCanonicalZeroTag) {
const char encoded[] = {"\n\x3\x80\0\0"};
UNITTEST::NestedTestAllTypes parsed;

Loading…
Cancel
Save