From d64a2d9941c36a7bc2a7959ea10ab8363192ac14 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Wed, 29 Jun 2016 15:23:27 -0700 Subject: Integrated internal changes from Google This includes all internal changes from around May 20 to now. --- src/google/protobuf/descriptor_unittest.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/google/protobuf/descriptor_unittest.cc') diff --git a/src/google/protobuf/descriptor_unittest.cc b/src/google/protobuf/descriptor_unittest.cc index f937b9ea..4183138f 100644 --- a/src/google/protobuf/descriptor_unittest.cc +++ b/src/google/protobuf/descriptor_unittest.cc @@ -55,7 +55,6 @@ #include #include #include -#include #include #include @@ -2705,6 +2704,7 @@ TEST(CustomOptions, OptionLocations) { protobuf_unittest::TestMessageWithCustomOptions::descriptor(); const FileDescriptor* file = message->file(); const FieldDescriptor* field = message->FindFieldByName("field1"); + const OneofDescriptor* oneof = message->FindOneofByName("AnOneof"); const EnumDescriptor* enm = message->FindEnumTypeByName("AnEnum"); // TODO(benjy): Support EnumValue options, once the compiler does. const ServiceDescriptor* service = @@ -2719,6 +2719,8 @@ TEST(CustomOptions, OptionLocations) { field->options().GetExtension(protobuf_unittest::field_opt1)); EXPECT_EQ(42, // Check that we get the default for an option we don't set. field->options().GetExtension(protobuf_unittest::field_opt2)); + EXPECT_EQ(-99, + oneof->options().GetExtension(protobuf_unittest::oneof_opt1)); EXPECT_EQ(-789, enm->options().GetExtension(protobuf_unittest::enum_opt1)); EXPECT_EQ(123, @@ -5027,7 +5029,7 @@ TEST_F(ValidationErrorTest, AggregateValueParseError) { BuildFileWithErrors( EmbedAggregateValue("aggregate_value: \"1+2\""), "foo.proto: foo.proto: OPTION_VALUE: Error while parsing option " - "value for \"foo\": Expected identifier.\n"); + "value for \"foo\": Expected identifier, got: 1\n"); } TEST_F(ValidationErrorTest, AggregateValueUnknownFields) { @@ -5834,7 +5836,7 @@ TEST_F(ValidationErrorTest, ValidateProto3JsonName) { " field { name:'name' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 }" " field { name:'Name' number:2 label:LABEL_OPTIONAL type:TYPE_INT32 }" "}", - "foo.proto: Foo: OTHER: The JSON camcel-case name of field \"Name\" " + "foo.proto: Foo: OTHER: The JSON camel-case name of field \"Name\" " "conflicts with field \"name\". This is not allowed in proto3.\n"); // Underscores are ignored. BuildFileWithErrors( @@ -5845,7 +5847,7 @@ TEST_F(ValidationErrorTest, ValidateProto3JsonName) { " field { name:'ab' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 }" " field { name:'_a__b_' number:2 label:LABEL_OPTIONAL type:TYPE_INT32 }" "}", - "foo.proto: Foo: OTHER: The JSON camcel-case name of field \"_a__b_\" " + "foo.proto: Foo: OTHER: The JSON camel-case name of field \"_a__b_\" " "conflicts with field \"ab\". This is not allowed in proto3.\n"); } -- cgit v1.2.3