protobuf 3.5.5 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGES.md +16 -0
- data/lib/protobuf/cli.rb +3 -1
- data/lib/protobuf/enum.rb +1 -0
- data/lib/protobuf/field/base_field.rb +1 -0
- data/lib/protobuf/field/varint_field.rb +16 -1
- data/lib/protobuf/message.rb +6 -7
- data/lib/protobuf/message/serialization.rb +0 -4
- data/lib/protobuf/rpc/connectors/ping.rb +87 -0
- data/lib/protobuf/rpc/connectors/zmq.rb +5 -16
- data/lib/protobuf/version.rb +1 -1
- data/spec/benchmark/tasks.rb +2 -1
- data/spec/encoding/all_types_spec.rb +28 -27
- data/spec/encoding/extreme_values_spec.rb +0 -0
- data/spec/functional/class_inheritance_spec.rb +1 -1
- data/spec/functional/socket_server_spec.rb +1 -1
- data/spec/functional/zmq_server_spec.rb +1 -1
- data/spec/lib/protobuf/field_spec.rb +1 -1
- data/spec/lib/protobuf/generators/base_spec.rb +2 -0
- data/spec/lib/protobuf/message_spec.rb +6 -4
- data/spec/lib/protobuf/rpc/client_spec.rb +1 -1
- data/spec/lib/protobuf/rpc/connectors/ping_spec.rb +69 -0
- data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +6 -13
- data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +1 -1
- data/spec/lib/protobuf/rpc/service_spec.rb +1 -1
- data/spec/lib/protobuf_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -7
- data/spec/support/{test → protos}/all_types.data.bin +0 -0
- data/spec/support/{test → protos}/all_types.data.txt +0 -0
- data/spec/support/{test → protos}/enum.pb.rb +1 -1
- data/spec/support/{test → protos}/enum.proto +3 -1
- data/spec/support/{test → protos}/extreme_values.data.bin +0 -0
- data/spec/support/protos/google_unittest.bin +0 -0
- data/spec/support/{test → protos}/google_unittest.pb.rb +318 -77
- data/spec/support/{test → protos}/google_unittest.proto +230 -66
- data/spec/support/{test → protos}/google_unittest_import.pb.rb +13 -6
- data/spec/support/{test → protos}/google_unittest_import.proto +19 -10
- data/spec/support/protos/google_unittest_import_public.pb.rb +24 -0
- data/spec/support/{test → protos}/google_unittest_import_public.proto +8 -5
- data/spec/support/{test → protos}/multi_field_extensions.pb.rb +0 -0
- data/spec/support/{test → protos}/multi_field_extensions.proto +2 -0
- data/spec/support/{test → protos}/resource.pb.rb +0 -0
- data/spec/support/{test → protos}/resource.proto +2 -0
- data/spec/support/{test/resource_service.rb → resource_service.rb} +1 -1
- data/spec/support/server.rb +2 -1
- metadata +111 -160
- data/spec/data/data.bin +0 -3
- data/spec/data/types.bin +0 -0
- data/spec/support/test/defaults.pb.rb +0 -27
- data/spec/support/test/defaults.proto +0 -9
- data/spec/support/test/extended.pb.rb +0 -24
- data/spec/support/test/extended.proto +0 -10
- data/spec/support/test/google_unittest_import_public.pb.rb +0 -10
@@ -1,6 +1,6 @@
|
|
1
1
|
// Protocol Buffers - Google's data interchange format
|
2
2
|
// Copyright 2008 Google Inc. All rights reserved.
|
3
|
-
//
|
3
|
+
// https://developers.google.com/protocol-buffers/
|
4
4
|
//
|
5
5
|
// Redistribution and use in source and binary forms, with or without
|
6
6
|
// modification, are permitted provided that the following conditions are
|
@@ -34,12 +34,28 @@
|
|
34
34
|
//
|
35
35
|
// A proto file we will use for unit testing.
|
36
36
|
|
37
|
-
|
37
|
+
syntax = "proto2";
|
38
|
+
|
39
|
+
// Some generic_services option(s) added automatically.
|
40
|
+
// See: http://go/proto2-generic-services-default
|
41
|
+
option cc_generic_services = true; // auto-added
|
42
|
+
option java_generic_services = true; // auto-added
|
43
|
+
option py_generic_services = true; // auto-added
|
44
|
+
option cc_enable_arenas = true;
|
45
|
+
|
46
|
+
import "protos/google_unittest_import.proto";
|
38
47
|
|
39
48
|
// We don't put this in a package within proto2 because we need to make sure
|
40
49
|
// that the generated code doesn't depend on being in the proto2 namespace.
|
41
|
-
// In test_util.h we do "using namespace unittest =
|
42
|
-
package
|
50
|
+
// In test_util.h we do "using namespace unittest = protobuf_unittest".
|
51
|
+
package protobuf_unittest;
|
52
|
+
|
53
|
+
// Protos optimized for SPEED use a strict superset of the generated code
|
54
|
+
// of equivalent ones optimized for CODE_SIZE, so we should optimize all our
|
55
|
+
// tests for speed unless explicitly testing code size optimization.
|
56
|
+
option optimize_for = SPEED;
|
57
|
+
|
58
|
+
option java_outer_classname = "UnittestProto";
|
43
59
|
|
44
60
|
// This proto includes every type of field in both singular and repeated
|
45
61
|
// forms.
|
@@ -55,6 +71,7 @@ message TestAllTypes {
|
|
55
71
|
FOO = 1;
|
56
72
|
BAR = 2;
|
57
73
|
BAZ = 3;
|
74
|
+
NEG = -1; // Intentionally negative.
|
58
75
|
}
|
59
76
|
|
60
77
|
// Singular
|
@@ -74,27 +91,26 @@ message TestAllTypes {
|
|
74
91
|
optional string optional_string = 14;
|
75
92
|
optional bytes optional_bytes = 15;
|
76
93
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
//}
|
94
|
+
optional group OptionalGroup = 16 {
|
95
|
+
optional int32 a = 17;
|
96
|
+
}
|
81
97
|
|
82
98
|
optional NestedMessage optional_nested_message = 18;
|
83
99
|
optional ForeignMessage optional_foreign_message = 19;
|
84
|
-
optional
|
100
|
+
optional protobuf_unittest_import.ImportMessage optional_import_message = 20;
|
85
101
|
|
86
102
|
optional NestedEnum optional_nested_enum = 21;
|
87
103
|
optional ForeignEnum optional_foreign_enum = 22;
|
88
|
-
optional
|
104
|
+
optional protobuf_unittest_import.ImportEnum optional_import_enum = 23;
|
89
105
|
|
90
106
|
optional string optional_string_piece = 24 [ctype=STRING_PIECE];
|
91
107
|
optional string optional_cord = 25 [ctype=CORD];
|
92
108
|
|
93
109
|
// Defined in unittest_import_public.proto
|
94
|
-
optional
|
110
|
+
optional protobuf_unittest_import.PublicImportMessage
|
95
111
|
optional_public_import_message = 26;
|
96
112
|
|
97
|
-
optional NestedMessage optional_lazy_message = 27
|
113
|
+
optional NestedMessage optional_lazy_message = 27 [lazy=true];
|
98
114
|
|
99
115
|
// Repeated
|
100
116
|
repeated int32 repeated_int32 = 31;
|
@@ -113,23 +129,22 @@ message TestAllTypes {
|
|
113
129
|
repeated string repeated_string = 44;
|
114
130
|
repeated bytes repeated_bytes = 45;
|
115
131
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
//}
|
132
|
+
repeated group RepeatedGroup = 46 {
|
133
|
+
optional int32 a = 47;
|
134
|
+
}
|
120
135
|
|
121
136
|
repeated NestedMessage repeated_nested_message = 48;
|
122
137
|
repeated ForeignMessage repeated_foreign_message = 49;
|
123
|
-
repeated
|
138
|
+
repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50;
|
124
139
|
|
125
140
|
repeated NestedEnum repeated_nested_enum = 51;
|
126
141
|
repeated ForeignEnum repeated_foreign_enum = 52;
|
127
|
-
repeated
|
142
|
+
repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
|
128
143
|
|
129
144
|
repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
|
130
145
|
repeated string repeated_cord = 55 [ctype=CORD];
|
131
146
|
|
132
|
-
repeated NestedMessage repeated_lazy_message = 57
|
147
|
+
repeated NestedMessage repeated_lazy_message = 57 [lazy=true];
|
133
148
|
|
134
149
|
// Singular with defaults
|
135
150
|
optional int32 default_int32 = 61 [default = 41 ];
|
@@ -150,11 +165,26 @@ message TestAllTypes {
|
|
150
165
|
|
151
166
|
optional NestedEnum default_nested_enum = 81 [default = BAR ];
|
152
167
|
optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
|
153
|
-
optional
|
168
|
+
optional protobuf_unittest_import.ImportEnum
|
154
169
|
default_import_enum = 83 [default = IMPORT_BAR];
|
155
170
|
|
156
171
|
optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"];
|
157
172
|
optional string default_cord = 85 [ctype=CORD,default="123"];
|
173
|
+
|
174
|
+
// For oneof test
|
175
|
+
oneof oneof_field {
|
176
|
+
uint32 oneof_uint32 = 111;
|
177
|
+
NestedMessage oneof_nested_message = 112;
|
178
|
+
string oneof_string = 113;
|
179
|
+
bytes oneof_bytes = 114;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
// This proto includes a recusively nested message.
|
184
|
+
message NestedTestAllTypes {
|
185
|
+
optional NestedTestAllTypes child = 1;
|
186
|
+
optional TestAllTypes payload = 2;
|
187
|
+
repeated NestedTestAllTypes repeated_child = 3;
|
158
188
|
}
|
159
189
|
|
160
190
|
message TestDeprecatedFields {
|
@@ -173,6 +203,11 @@ enum ForeignEnum {
|
|
173
203
|
FOREIGN_BAZ = 6;
|
174
204
|
}
|
175
205
|
|
206
|
+
message TestReservedFields {
|
207
|
+
reserved 2, 15, 9 to 11;
|
208
|
+
reserved "bar", "baz";
|
209
|
+
}
|
210
|
+
|
176
211
|
message TestAllExtensions {
|
177
212
|
extensions 1 to max;
|
178
213
|
}
|
@@ -195,29 +230,28 @@ extend TestAllExtensions {
|
|
195
230
|
optional string optional_string_extension = 14;
|
196
231
|
optional bytes optional_bytes_extension = 15;
|
197
232
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
//}
|
233
|
+
optional group OptionalGroup_extension = 16 {
|
234
|
+
optional int32 a = 17;
|
235
|
+
}
|
202
236
|
|
203
237
|
optional TestAllTypes.NestedMessage optional_nested_message_extension = 18;
|
204
238
|
optional ForeignMessage optional_foreign_message_extension = 19;
|
205
|
-
optional
|
239
|
+
optional protobuf_unittest_import.ImportMessage
|
206
240
|
optional_import_message_extension = 20;
|
207
241
|
|
208
242
|
optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21;
|
209
243
|
optional ForeignEnum optional_foreign_enum_extension = 22;
|
210
|
-
optional
|
244
|
+
optional protobuf_unittest_import.ImportEnum
|
211
245
|
optional_import_enum_extension = 23;
|
212
246
|
|
213
247
|
optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE];
|
214
248
|
optional string optional_cord_extension = 25 [ctype=CORD];
|
215
249
|
|
216
|
-
optional
|
250
|
+
optional protobuf_unittest_import.PublicImportMessage
|
217
251
|
optional_public_import_message_extension = 26;
|
218
252
|
|
219
253
|
optional TestAllTypes.NestedMessage
|
220
|
-
optional_lazy_message_extension = 27
|
254
|
+
optional_lazy_message_extension = 27 [lazy=true];
|
221
255
|
|
222
256
|
// Repeated
|
223
257
|
repeated int32 repeated_int32_extension = 31;
|
@@ -236,26 +270,25 @@ extend TestAllExtensions {
|
|
236
270
|
repeated string repeated_string_extension = 44;
|
237
271
|
repeated bytes repeated_bytes_extension = 45;
|
238
272
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
//}
|
273
|
+
repeated group RepeatedGroup_extension = 46 {
|
274
|
+
optional int32 a = 47;
|
275
|
+
}
|
243
276
|
|
244
277
|
repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48;
|
245
278
|
repeated ForeignMessage repeated_foreign_message_extension = 49;
|
246
|
-
repeated
|
279
|
+
repeated protobuf_unittest_import.ImportMessage
|
247
280
|
repeated_import_message_extension = 50;
|
248
281
|
|
249
282
|
repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51;
|
250
283
|
repeated ForeignEnum repeated_foreign_enum_extension = 52;
|
251
|
-
repeated
|
284
|
+
repeated protobuf_unittest_import.ImportEnum
|
252
285
|
repeated_import_enum_extension = 53;
|
253
286
|
|
254
287
|
repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE];
|
255
288
|
repeated string repeated_cord_extension = 55 [ctype=CORD];
|
256
289
|
|
257
290
|
repeated TestAllTypes.NestedMessage
|
258
|
-
repeated_lazy_message_extension = 57
|
291
|
+
repeated_lazy_message_extension = 57 [lazy=true];
|
259
292
|
|
260
293
|
// Singular with defaults
|
261
294
|
optional int32 default_int32_extension = 61 [default = 41 ];
|
@@ -278,12 +311,18 @@ extend TestAllExtensions {
|
|
278
311
|
default_nested_enum_extension = 81 [default = BAR];
|
279
312
|
optional ForeignEnum
|
280
313
|
default_foreign_enum_extension = 82 [default = FOREIGN_BAR];
|
281
|
-
optional
|
314
|
+
optional protobuf_unittest_import.ImportEnum
|
282
315
|
default_import_enum_extension = 83 [default = IMPORT_BAR];
|
283
316
|
|
284
317
|
optional string default_string_piece_extension = 84 [ctype=STRING_PIECE,
|
285
318
|
default="abc"];
|
286
319
|
optional string default_cord_extension = 85 [ctype=CORD, default="123"];
|
320
|
+
|
321
|
+
// For oneof test
|
322
|
+
optional uint32 oneof_uint32_extension = 111;
|
323
|
+
optional TestAllTypes.NestedMessage oneof_nested_message_extension = 112;
|
324
|
+
optional string oneof_string_extension = 113;
|
325
|
+
optional bytes oneof_bytes_extension = 114;
|
287
326
|
}
|
288
327
|
|
289
328
|
message TestNestedExtension {
|
@@ -291,6 +330,9 @@ message TestNestedExtension {
|
|
291
330
|
// Check for bug where string extensions declared in tested scope did not
|
292
331
|
// compile.
|
293
332
|
optional string test = 1002 [default="test"];
|
333
|
+
// Used to test if generated extension name is correct when there are
|
334
|
+
// underscores.
|
335
|
+
optional string nested_string_extension = 1003;
|
294
336
|
}
|
295
337
|
}
|
296
338
|
|
@@ -395,22 +437,21 @@ message TestMutualRecursionB {
|
|
395
437
|
}
|
396
438
|
|
397
439
|
// Test that groups have disjoint field numbers from their siblings and
|
398
|
-
// parents. This is NOT possible in proto1; only
|
440
|
+
// parents. This is NOT possible in proto1; only google.protobuf. When attempting
|
399
441
|
// to compile with proto1, this will emit an error; so we only include it
|
400
|
-
// in
|
442
|
+
// in protobuf_unittest_proto.
|
401
443
|
message TestDupFieldNumber { // NO_PROTO1
|
402
444
|
optional int32 a = 1; // NO_PROTO1
|
403
|
-
|
404
|
-
|
405
|
-
//optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1
|
445
|
+
optional group Foo = 2 { optional int32 a = 1; } // NO_PROTO1
|
446
|
+
optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1
|
406
447
|
} // NO_PROTO1
|
407
448
|
|
408
449
|
// Additional messages for testing lazy fields.
|
409
450
|
message TestEagerMessage {
|
410
|
-
optional TestAllTypes sub_message = 1
|
451
|
+
optional TestAllTypes sub_message = 1 [lazy=false];
|
411
452
|
}
|
412
453
|
message TestLazyMessage {
|
413
|
-
optional TestAllTypes sub_message = 1
|
454
|
+
optional TestAllTypes sub_message = 1 [lazy=true];
|
414
455
|
}
|
415
456
|
|
416
457
|
// Needed for a Python test.
|
@@ -424,15 +465,15 @@ message TestNestedMessageHasBits {
|
|
424
465
|
|
425
466
|
|
426
467
|
// Test an enum that has multiple values with the same number.
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
468
|
+
enum TestEnumWithDupValue {
|
469
|
+
option allow_alias = true;
|
470
|
+
|
471
|
+
FOO1 = 1;
|
472
|
+
BAR1 = 2;
|
473
|
+
BAZ = 3;
|
474
|
+
FOO2 = 1;
|
475
|
+
BAR2 = 2;
|
476
|
+
}
|
436
477
|
|
437
478
|
// Test an enum with large, unordered values.
|
438
479
|
enum TestSparseEnum {
|
@@ -472,6 +513,15 @@ message TestFieldOrderings {
|
|
472
513
|
optional int64 my_int = 1;
|
473
514
|
extensions 12 to 100;
|
474
515
|
optional float my_float = 101;
|
516
|
+
message NestedMessage {
|
517
|
+
optional int64 oo = 2;
|
518
|
+
// The field name "b" fails to compile in proto1 because it conflicts with
|
519
|
+
// a local variable named "b" in one of the generated methods. Doh.
|
520
|
+
// This file needs to compile in proto1 to test backwards-compatibility.
|
521
|
+
optional int32 bb = 1;
|
522
|
+
}
|
523
|
+
|
524
|
+
optional NestedMessage optional_nested_message = 200;
|
475
525
|
}
|
476
526
|
|
477
527
|
|
@@ -527,6 +577,7 @@ message TestExtremeDefaultValues {
|
|
527
577
|
default="ab\000c"];
|
528
578
|
optional string cord_with_zero = 26 [ctype=CORD,
|
529
579
|
default="12\0003"];
|
580
|
+
optional string replacement_string = 27 [default="${unknown}"];
|
530
581
|
}
|
531
582
|
|
532
583
|
message SparseEnumMessage {
|
@@ -550,6 +601,100 @@ message MoreBytes {
|
|
550
601
|
repeated bytes data = 1;
|
551
602
|
}
|
552
603
|
|
604
|
+
// Test int32, uint32, int64, uint64, and bool are all compatible
|
605
|
+
message Int32Message {
|
606
|
+
optional int32 data = 1;
|
607
|
+
}
|
608
|
+
|
609
|
+
message Uint32Message {
|
610
|
+
optional uint32 data = 1;
|
611
|
+
}
|
612
|
+
|
613
|
+
message Int64Message {
|
614
|
+
optional int64 data = 1;
|
615
|
+
}
|
616
|
+
|
617
|
+
message Uint64Message {
|
618
|
+
optional uint64 data = 1;
|
619
|
+
}
|
620
|
+
|
621
|
+
message BoolMessage {
|
622
|
+
optional bool data = 1;
|
623
|
+
}
|
624
|
+
|
625
|
+
// Test oneofs.
|
626
|
+
message TestOneof {
|
627
|
+
oneof foo {
|
628
|
+
int32 foo_int = 1;
|
629
|
+
string foo_string = 2;
|
630
|
+
TestAllTypes foo_message = 3;
|
631
|
+
group FooGroup = 4 {
|
632
|
+
optional int32 a = 5;
|
633
|
+
optional string b = 6;
|
634
|
+
}
|
635
|
+
}
|
636
|
+
}
|
637
|
+
|
638
|
+
message TestOneofBackwardsCompatible {
|
639
|
+
optional int32 foo_int = 1;
|
640
|
+
optional string foo_string = 2;
|
641
|
+
optional TestAllTypes foo_message = 3;
|
642
|
+
optional group FooGroup = 4 {
|
643
|
+
optional int32 a = 5;
|
644
|
+
optional string b = 6;
|
645
|
+
}
|
646
|
+
}
|
647
|
+
|
648
|
+
message TestOneof2 {
|
649
|
+
oneof foo {
|
650
|
+
int32 foo_int = 1;
|
651
|
+
string foo_string = 2;
|
652
|
+
string foo_cord = 3 [ctype=CORD];
|
653
|
+
string foo_string_piece = 4 [ctype=STRING_PIECE];
|
654
|
+
bytes foo_bytes = 5;
|
655
|
+
NestedEnum foo_enum = 6;
|
656
|
+
NestedMessage foo_message = 7;
|
657
|
+
group FooGroup = 8 {
|
658
|
+
optional int32 a = 9;
|
659
|
+
optional string b = 10;
|
660
|
+
}
|
661
|
+
NestedMessage foo_lazy_message = 11 [lazy=true];
|
662
|
+
}
|
663
|
+
|
664
|
+
oneof bar {
|
665
|
+
int32 bar_int = 12 [default = 5];
|
666
|
+
string bar_string = 13 [default = "STRING"];
|
667
|
+
string bar_cord = 14 [ctype=CORD, default = "CORD"];
|
668
|
+
string bar_string_piece = 15 [ctype=STRING_PIECE, default = "SPIECE"];
|
669
|
+
bytes bar_bytes = 16 [default = "BYTES"];
|
670
|
+
NestedEnum bar_enum = 17 [default = BAR];
|
671
|
+
}
|
672
|
+
|
673
|
+
optional int32 baz_int = 18;
|
674
|
+
optional string baz_string = 19 [default = "BAZ"];
|
675
|
+
|
676
|
+
message NestedMessage {
|
677
|
+
optional int64 qux_int = 1;
|
678
|
+
repeated int32 corge_int = 2;
|
679
|
+
}
|
680
|
+
|
681
|
+
enum NestedEnum {
|
682
|
+
FOO = 1;
|
683
|
+
BAR = 2;
|
684
|
+
BAZ = 3;
|
685
|
+
}
|
686
|
+
}
|
687
|
+
|
688
|
+
message TestRequiredOneof {
|
689
|
+
oneof foo {
|
690
|
+
int32 foo_int = 1;
|
691
|
+
string foo_string = 2;
|
692
|
+
NestedMessage foo_message = 3;
|
693
|
+
}
|
694
|
+
message NestedMessage {
|
695
|
+
required double required_double = 1;
|
696
|
+
}
|
697
|
+
}
|
553
698
|
|
554
699
|
// Test messages for packed fields
|
555
700
|
|
@@ -610,6 +755,27 @@ extend TestPackedExtensions {
|
|
610
755
|
repeated ForeignEnum packed_enum_extension = 103 [packed = true];
|
611
756
|
}
|
612
757
|
|
758
|
+
message TestUnpackedExtensions {
|
759
|
+
extensions 1 to max;
|
760
|
+
}
|
761
|
+
|
762
|
+
extend TestUnpackedExtensions {
|
763
|
+
repeated int32 unpacked_int32_extension = 90 [packed = false];
|
764
|
+
repeated int64 unpacked_int64_extension = 91 [packed = false];
|
765
|
+
repeated uint32 unpacked_uint32_extension = 92 [packed = false];
|
766
|
+
repeated uint64 unpacked_uint64_extension = 93 [packed = false];
|
767
|
+
repeated sint32 unpacked_sint32_extension = 94 [packed = false];
|
768
|
+
repeated sint64 unpacked_sint64_extension = 95 [packed = false];
|
769
|
+
repeated fixed32 unpacked_fixed32_extension = 96 [packed = false];
|
770
|
+
repeated fixed64 unpacked_fixed64_extension = 97 [packed = false];
|
771
|
+
repeated sfixed32 unpacked_sfixed32_extension = 98 [packed = false];
|
772
|
+
repeated sfixed64 unpacked_sfixed64_extension = 99 [packed = false];
|
773
|
+
repeated float unpacked_float_extension = 100 [packed = false];
|
774
|
+
repeated double unpacked_double_extension = 101 [packed = false];
|
775
|
+
repeated bool unpacked_bool_extension = 102 [packed = false];
|
776
|
+
repeated ForeignEnum unpacked_enum_extension = 103 [packed = false];
|
777
|
+
}
|
778
|
+
|
613
779
|
// Used by ExtensionSetTest/DynamicExtensions. The test actually builds
|
614
780
|
// a set of extensions to TestAllExtensions dynamically, based on the fields
|
615
781
|
// of this message type.
|
@@ -663,26 +829,24 @@ message TestParsingMerge {
|
|
663
829
|
repeated TestAllTypes field1 = 1;
|
664
830
|
repeated TestAllTypes field2 = 2;
|
665
831
|
repeated TestAllTypes field3 = 3;
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
//}
|
832
|
+
repeated group Group1 = 10 {
|
833
|
+
optional TestAllTypes field1 = 11;
|
834
|
+
}
|
835
|
+
repeated group Group2 = 20 {
|
836
|
+
optional TestAllTypes field1 = 21;
|
837
|
+
}
|
673
838
|
repeated TestAllTypes ext1 = 1000;
|
674
839
|
repeated TestAllTypes ext2 = 1001;
|
675
840
|
}
|
676
841
|
required TestAllTypes required_all_types = 1;
|
677
842
|
optional TestAllTypes optional_all_types = 2;
|
678
843
|
repeated TestAllTypes repeated_all_types = 3;
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
//}
|
844
|
+
optional group OptionalGroup = 10 {
|
845
|
+
optional TestAllTypes optional_group_all_types = 11;
|
846
|
+
}
|
847
|
+
repeated group RepeatedGroup = 20 {
|
848
|
+
optional TestAllTypes repeated_group_all_types = 21;
|
849
|
+
}
|
686
850
|
extensions 1000 to max;
|
687
851
|
extend TestParsingMerge {
|
688
852
|
optional TestAllTypes optional_ext = 1000;
|