|
|
@ -217,10 +217,16 @@ TEST(Proto3OptionalTest, OptionalFieldDescriptor) { |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < d->field_count(); i++) { |
|
|
|
for (int i = 0; i < d->field_count(); i++) { |
|
|
|
const FieldDescriptor* f = d->field(i); |
|
|
|
const FieldDescriptor* f = d->field(i); |
|
|
|
|
|
|
|
if (HasPrefixString(f->name(), "singular")) { |
|
|
|
|
|
|
|
EXPECT_FALSE(f->has_optional_keyword()) << f->full_name(); |
|
|
|
|
|
|
|
EXPECT_FALSE(f->has_presence()) << f->full_name(); |
|
|
|
|
|
|
|
EXPECT_FALSE(f->containing_oneof()) << f->full_name(); |
|
|
|
|
|
|
|
} else { |
|
|
|
EXPECT_TRUE(f->has_optional_keyword()) << f->full_name(); |
|
|
|
EXPECT_TRUE(f->has_optional_keyword()) << f->full_name(); |
|
|
|
EXPECT_TRUE(f->has_presence()) << f->full_name(); |
|
|
|
EXPECT_TRUE(f->has_presence()) << f->full_name(); |
|
|
|
EXPECT_TRUE(f->containing_oneof()) << f->full_name(); |
|
|
|
EXPECT_TRUE(f->containing_oneof()) << f->full_name(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST(Proto3OptionalTest, OptionalField) { |
|
|
|
TEST(Proto3OptionalTest, OptionalField) { |
|
|
|