Selaa lähdekoodia

add message set test case

Yilun Chong 8 vuotta sitten
vanhempi
commit
364502102a

+ 1 - 0
conformance/conformance.proto

@@ -78,6 +78,7 @@ message ConformanceRequest {
   // Which format should the testee serialize its message to?
   // Which format should the testee serialize its message to?
   WireFormat requested_output_format = 3;
   WireFormat requested_output_format = 3;
 
 
+  // should be set to either "proto2" or "proto3"
   string message_type = 4;
   string message_type = 4;
 }
 }
 
 

+ 20 - 0
src/google/protobuf/test_messages_proto2.proto

@@ -179,6 +179,26 @@ message TestAllTypesProto2 {
   optional int32 field__Name16 = 416;
   optional int32 field__Name16 = 416;
   optional int32 field_name17__ = 417;
   optional int32 field_name17__ = 417;
   optional int32 Field_name18__ = 418;
   optional int32 Field_name18__ = 418;
+
+  // message_set test case.
+  message mset_correct {
+    option message_set_wire_format = true;
+    extensions 4 to max;
+  }
+
+  message mset_correct_extension1 {
+    extend mset_correct {
+      optional mset_correct_extension1 message_set_extension = 1547769;
+    }
+    optional string str = 25;
+  }
+
+  message mset_correct_extension2 {
+    extend mset_correct {
+      optional mset_correct_extension1 message_set_extension = 4135312;
+    }
+    optional int32 i = 9;
+  }
 }
 }
 
 
 message ForeignMessage {
 message ForeignMessage {