Index: third_party/protobuf/src/google/protobuf/unittest_custom_options.proto |
diff --git a/third_party/protobuf/src/google/protobuf/unittest_custom_options.proto b/third_party/protobuf/src/google/protobuf/unittest_custom_options.proto |
index e591d29447505da667eac884ea170a726e978a73..4cc0e362c56c74374b4183965ddd69834583f0cc 100644 |
--- a/third_party/protobuf/src/google/protobuf/unittest_custom_options.proto |
+++ b/third_party/protobuf/src/google/protobuf/unittest_custom_options.proto |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -32,8 +32,9 @@ |
// Based on original Protocol Buffers design by |
// Sanjay Ghemawat, Jeff Dean, and others. |
// |
-// A proto file used to test the "custom options" feature of proto2. |
+// A proto file used to test the "custom options" feature of google.protobuf. |
+syntax = "proto2"; |
// Some generic_services option(s) added automatically. |
// See: http://go/proto2-generic-services-default |
@@ -218,6 +219,7 @@ message ComplexOptionType1 { |
optional int32 foo = 1; |
optional int32 foo2 = 2; |
optional int32 foo3 = 3; |
+ repeated int32 foo4 = 4; |
extensions 100 to max; |
} |
@@ -235,6 +237,7 @@ message ComplexOptionType2 { |
} |
optional ComplexOptionType4 fred = 3; |
+ repeated ComplexOptionType4 barney = 4; |
extensions 100 to max; |
} |
@@ -271,6 +274,8 @@ message VariousComplexOptions { |
option (.protobuf_unittest.complex_opt1).foo = 42; |
option (protobuf_unittest.complex_opt1).(.protobuf_unittest.quux) = 324; |
option (.protobuf_unittest.complex_opt1).(protobuf_unittest.corge).qux = 876; |
+ option (protobuf_unittest.complex_opt1).foo4 = 99; |
+ option (protobuf_unittest.complex_opt1).foo4 = 88; |
option (complex_opt2).baz = 987; |
option (complex_opt2).(grault) = 654; |
option (complex_opt2).bar.foo = 743; |
@@ -281,6 +286,8 @@ message VariousComplexOptions { |
option (complex_opt2).(protobuf_unittest.garply).(corge).qux = 2121; |
option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971; |
option (complex_opt2).fred.waldo = 321; |
+ option (complex_opt2).barney = { waldo: 101 }; |
+ option (complex_opt2).barney = { waldo: 212 }; |
option (protobuf_unittest.complex_opt3).qux = 9; |
option (complex_opt3).complexoptiontype5.plugh = 22; |
option (complexopt6).xyzzy = 24; |
@@ -385,3 +392,30 @@ message NestedOptionType { |
optional int32 nested_extension = 7912573 [(field_opt2) = 1005]; |
} |
} |
+ |
+// Custom message option that has a required enum field. |
+// WARNING: this is strongly discouraged! |
+message OldOptionType { |
+ enum TestEnum { |
+ OLD_VALUE = 0; |
+ } |
+ required TestEnum value = 1; |
+} |
+ |
+// Updated version of the custom option above. |
+message NewOptionType { |
+ enum TestEnum { |
+ OLD_VALUE = 0; |
+ NEW_VALUE = 1; |
+ } |
+ required TestEnum value = 1; |
+} |
+ |
+extend google.protobuf.MessageOptions { |
+ optional OldOptionType required_enum_opt = 106161807; |
+} |
+ |
+// Test message using the "required_enum_opt" option defined above. |
+message TestMessageWithRequiredEnumOption { |
+ option (required_enum_opt) = { value: OLD_VALUE }; |
+} |