aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/message_unittest.cc
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:32:48 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:33:05 -0700
commitd36c0c538a545fac5d9db6ba65c525246d4efa95 (patch)
tree3fd29af0f137dfaf5df892723e60600f674392b3 /src/google/protobuf/message_unittest.cc
parent4a0dd03e52e09332c8fd0f8f26a8e0ae9f911182 (diff)
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/message_unittest.cc')
-rw-r--r--src/google/protobuf/message_unittest.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc
index c1b05bc1..0469f4ca 100644
--- a/src/google/protobuf/message_unittest.cc
+++ b/src/google/protobuf/message_unittest.cc
@@ -551,6 +551,17 @@ TEST(MessageTest, MergeFrom) {
ASSERT_EQ(0, dest.repeated_uint64_size());
}
+TEST(MessageTest, IsInitialized) {
+ protobuf_unittest::TestIsInitialized msg;
+ EXPECT_TRUE(msg.IsInitialized());
+ protobuf_unittest::TestIsInitialized::SubMessage* sub_message = msg.mutable_sub_message();
+ EXPECT_TRUE(msg.IsInitialized());
+ protobuf_unittest::TestIsInitialized::SubMessage::SubGroup* sub_group = sub_message->mutable_subgroup();
+ EXPECT_FALSE(msg.IsInitialized());
+ sub_group->set_i(1);
+ EXPECT_TRUE(msg.IsInitialized());
+}
+
TEST(MessageFactoryTest, GeneratedFactoryLookup) {
EXPECT_EQ(
MessageFactory::generated_factory()->GetPrototype(