protobuf 2.8.13 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +84 -5
- data/CONTRIBUTING.md +3 -3
- data/Rakefile +46 -7
- data/lib/protobuf/cli.rb +2 -20
- data/lib/protobuf/decoder.rb +74 -0
- data/lib/protobuf/deprecator.rb +42 -0
- data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +17 -16
- data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +86 -85
- data/lib/protobuf/encoder.rb +62 -0
- data/lib/protobuf/enum.rb +298 -37
- data/lib/protobuf/field/base_field.rb +41 -27
- data/lib/protobuf/field/bool_field.rb +22 -4
- data/lib/protobuf/field/bytes_field.rb +36 -15
- data/lib/protobuf/field/double_field.rb +10 -3
- data/lib/protobuf/field/enum_field.rb +21 -18
- data/lib/protobuf/field/field_array.rb +26 -16
- data/lib/protobuf/field/fixed32_field.rb +10 -4
- data/lib/protobuf/field/fixed64_field.rb +10 -3
- data/lib/protobuf/field/float_field.rb +18 -5
- data/lib/protobuf/field/int32_field.rb +14 -4
- data/lib/protobuf/field/int64_field.rb +14 -4
- data/lib/protobuf/field/integer_field.rb +9 -4
- data/lib/protobuf/field/message_field.rb +16 -7
- data/lib/protobuf/field/sfixed32_field.rb +10 -3
- data/lib/protobuf/field/sfixed64_field.rb +12 -7
- data/lib/protobuf/field/signed_integer_field.rb +7 -0
- data/lib/protobuf/field/sint32_field.rb +14 -4
- data/lib/protobuf/field/sint64_field.rb +14 -4
- data/lib/protobuf/field/string_field.rb +11 -1
- data/lib/protobuf/field/uint32_field.rb +14 -4
- data/lib/protobuf/field/uint64_field.rb +14 -4
- data/lib/protobuf/field/varint_field.rb +11 -9
- data/lib/protobuf/field.rb +42 -25
- data/lib/protobuf/generators/enum_generator.rb +12 -1
- data/lib/protobuf/generators/field_generator.rb +1 -1
- data/lib/protobuf/lifecycle.rb +3 -4
- data/lib/protobuf/message/fields.rb +122 -0
- data/lib/protobuf/message/serialization.rb +84 -0
- data/lib/protobuf/message.rb +21 -221
- data/lib/protobuf/optionable.rb +23 -0
- data/lib/protobuf/rpc/client.rb +2 -4
- data/lib/protobuf/rpc/connector.rb +0 -2
- data/lib/protobuf/rpc/connectors/common.rb +2 -2
- data/lib/protobuf/rpc/dynamic_discovery.pb.rb +14 -16
- data/lib/protobuf/rpc/env.rb +58 -0
- data/lib/protobuf/rpc/error.rb +8 -5
- data/lib/protobuf/rpc/middleware/exception_handler.rb +36 -0
- data/lib/protobuf/rpc/middleware/logger.rb +91 -0
- data/lib/protobuf/rpc/middleware/request_decoder.rb +83 -0
- data/lib/protobuf/rpc/middleware/response_encoder.rb +88 -0
- data/lib/protobuf/rpc/middleware/runner.rb +18 -0
- data/lib/protobuf/rpc/middleware.rb +25 -0
- data/lib/protobuf/rpc/rpc.pb.rb +15 -16
- data/lib/protobuf/rpc/server.rb +14 -64
- data/lib/protobuf/rpc/servers/socket/server.rb +0 -2
- data/lib/protobuf/rpc/servers/socket/worker.rb +11 -15
- data/lib/protobuf/rpc/servers/zmq/util.rb +4 -1
- data/lib/protobuf/rpc/servers/zmq/worker.rb +5 -13
- data/lib/protobuf/rpc/servers/zmq_runner.rb +1 -1
- data/lib/protobuf/rpc/service.rb +38 -72
- data/lib/protobuf/rpc/service_dispatcher.rb +20 -108
- data/lib/protobuf/version.rb +1 -2
- data/lib/protobuf.rb +5 -13
- data/protobuf.gemspec +5 -5
- data/spec/benchmark/tasks.rb +2 -77
- data/spec/functional/zmq_server_spec.rb +13 -21
- data/spec/lib/protobuf/cli_spec.rb +5 -43
- data/spec/lib/protobuf/enum_spec.rb +194 -61
- data/spec/lib/protobuf/field_spec.rb +194 -0
- data/spec/lib/protobuf/generators/enum_generator_spec.rb +24 -1
- data/spec/lib/protobuf/generators/field_generator_spec.rb +6 -6
- data/spec/lib/protobuf/message_spec.rb +52 -70
- data/spec/lib/protobuf/optionable_spec.rb +46 -0
- data/spec/lib/protobuf/rpc/client_spec.rb +1 -93
- data/spec/lib/protobuf/rpc/connector_spec.rb +1 -7
- data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +8 -0
- data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +62 -0
- data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +49 -0
- data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +115 -0
- data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +75 -0
- data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +0 -6
- data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +10 -0
- data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +30 -105
- data/spec/lib/protobuf/rpc/service_filters_spec.rb +4 -4
- data/spec/lib/protobuf/rpc/service_spec.rb +20 -24
- data/spec/lib/protobuf_spec.rb +3 -3
- data/spec/spec_helper.rb +5 -4
- data/spec/support/packed_field.rb +15 -14
- data/spec/support/server.rb +4 -21
- data/spec/support/test/defaults.pb.rb +4 -4
- data/spec/support/test/enum.pb.rb +13 -1
- data/spec/support/test/enum.proto +15 -0
- data/spec/support/test/extended.pb.rb +1 -1
- data/spec/support/test/google_unittest.pb.rb +239 -241
- data/spec/support/test/google_unittest_import.pb.rb +2 -2
- data/spec/support/test/multi_field_extensions.pb.rb +2 -2
- data/spec/support/test/resource.pb.rb +19 -18
- data/spec/support/test/resource.proto +1 -0
- data/spec/support/test/resource_service.rb +5 -0
- metadata +78 -57
- data/bin/rprotoc +0 -8
- data/lib/protobuf/enum_value.rb +0 -85
- data/lib/protobuf/evented.rb +0 -37
- data/lib/protobuf/ext/eventmachine.rb +0 -14
- data/lib/protobuf/field/extension_fields.rb +0 -32
- data/lib/protobuf/message/decoder.rb +0 -72
- data/lib/protobuf/message/message.rb +0 -1
- data/lib/protobuf/rpc/connectors/em_client.rb +0 -84
- data/lib/protobuf/rpc/connectors/eventmachine.rb +0 -87
- data/lib/protobuf/rpc/servers/evented/server.rb +0 -36
- data/lib/protobuf/rpc/servers/evented_runner.rb +0 -31
- data/spec/functional/embedded_service_spec.rb +0 -7
- data/spec/functional/evented_server_spec.rb +0 -64
- data/spec/lib/protobuf/enum_value_spec.rb +0 -29
- data/spec/lib/protobuf/rpc/servers/evented_server_spec.rb +0 -19
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
##
|
4
2
|
# This file is auto-generated. DO NOT EDIT!
|
5
3
|
#
|
@@ -112,205 +110,205 @@ module GoogleUnittest
|
|
112
110
|
#
|
113
111
|
class TestAllTypes
|
114
112
|
class NestedMessage
|
115
|
-
optional
|
113
|
+
optional :int32, :bb, 1
|
116
114
|
end
|
117
115
|
|
118
|
-
optional
|
119
|
-
optional
|
120
|
-
optional
|
121
|
-
optional
|
122
|
-
optional
|
123
|
-
optional
|
124
|
-
optional
|
125
|
-
optional
|
126
|
-
optional
|
127
|
-
optional
|
128
|
-
optional
|
129
|
-
optional
|
130
|
-
optional
|
131
|
-
optional
|
132
|
-
optional
|
116
|
+
optional :int32, :optional_int32, 1
|
117
|
+
optional :int64, :optional_int64, 2
|
118
|
+
optional :uint32, :optional_uint32, 3
|
119
|
+
optional :uint64, :optional_uint64, 4
|
120
|
+
optional :sint32, :optional_sint32, 5
|
121
|
+
optional :sint64, :optional_sint64, 6
|
122
|
+
optional :fixed32, :optional_fixed32, 7
|
123
|
+
optional :fixed64, :optional_fixed64, 8
|
124
|
+
optional :sfixed32, :optional_sfixed32, 9
|
125
|
+
optional :sfixed64, :optional_sfixed64, 10
|
126
|
+
optional :float, :optional_float, 11
|
127
|
+
optional :double, :optional_double, 12
|
128
|
+
optional :bool, :optional_bool, 13
|
129
|
+
optional :string, :optional_string, 14
|
130
|
+
optional :bytes, :optional_bytes, 15
|
133
131
|
optional ::GoogleUnittest::TestAllTypes::NestedMessage, :optional_nested_message, 18
|
134
132
|
optional ::GoogleUnittest::ForeignMessage, :optional_foreign_message, 19
|
135
133
|
optional ::GoogleUnittestImport::ImportMessage, :optional_import_message, 20
|
136
134
|
optional ::GoogleUnittest::TestAllTypes::NestedEnum, :optional_nested_enum, 21
|
137
135
|
optional ::GoogleUnittest::ForeignEnum, :optional_foreign_enum, 22
|
138
136
|
optional ::GoogleUnittestImport::ImportEnum, :optional_import_enum, 23
|
139
|
-
optional
|
140
|
-
optional
|
137
|
+
optional :string, :optional_string_piece, 24
|
138
|
+
optional :string, :optional_cord, 25
|
141
139
|
optional ::GoogleUnittestImport::PublicImportMessage, :optional_public_import_message, 26
|
142
140
|
optional ::GoogleUnittest::TestAllTypes::NestedMessage, :optional_lazy_message, 27
|
143
|
-
repeated
|
144
|
-
repeated
|
145
|
-
repeated
|
146
|
-
repeated
|
147
|
-
repeated
|
148
|
-
repeated
|
149
|
-
repeated
|
150
|
-
repeated
|
151
|
-
repeated
|
152
|
-
repeated
|
153
|
-
repeated
|
154
|
-
repeated
|
155
|
-
repeated
|
156
|
-
repeated
|
157
|
-
repeated
|
141
|
+
repeated :int32, :repeated_int32, 31
|
142
|
+
repeated :int64, :repeated_int64, 32
|
143
|
+
repeated :uint32, :repeated_uint32, 33
|
144
|
+
repeated :uint64, :repeated_uint64, 34
|
145
|
+
repeated :sint32, :repeated_sint32, 35
|
146
|
+
repeated :sint64, :repeated_sint64, 36
|
147
|
+
repeated :fixed32, :repeated_fixed32, 37
|
148
|
+
repeated :fixed64, :repeated_fixed64, 38
|
149
|
+
repeated :sfixed32, :repeated_sfixed32, 39
|
150
|
+
repeated :sfixed64, :repeated_sfixed64, 40
|
151
|
+
repeated :float, :repeated_float, 41
|
152
|
+
repeated :double, :repeated_double, 42
|
153
|
+
repeated :bool, :repeated_bool, 43
|
154
|
+
repeated :string, :repeated_string, 44
|
155
|
+
repeated :bytes, :repeated_bytes, 45
|
158
156
|
repeated ::GoogleUnittest::TestAllTypes::NestedMessage, :repeated_nested_message, 48
|
159
157
|
repeated ::GoogleUnittest::ForeignMessage, :repeated_foreign_message, 49
|
160
158
|
repeated ::GoogleUnittestImport::ImportMessage, :repeated_import_message, 50
|
161
159
|
repeated ::GoogleUnittest::TestAllTypes::NestedEnum, :repeated_nested_enum, 51
|
162
160
|
repeated ::GoogleUnittest::ForeignEnum, :repeated_foreign_enum, 52
|
163
161
|
repeated ::GoogleUnittestImport::ImportEnum, :repeated_import_enum, 53
|
164
|
-
repeated
|
165
|
-
repeated
|
162
|
+
repeated :string, :repeated_string_piece, 54
|
163
|
+
repeated :string, :repeated_cord, 55
|
166
164
|
repeated ::GoogleUnittest::TestAllTypes::NestedMessage, :repeated_lazy_message, 57
|
167
|
-
optional
|
168
|
-
optional
|
169
|
-
optional
|
170
|
-
optional
|
171
|
-
optional
|
172
|
-
optional
|
173
|
-
optional
|
174
|
-
optional
|
175
|
-
optional
|
176
|
-
optional
|
177
|
-
optional
|
178
|
-
optional
|
179
|
-
optional
|
180
|
-
optional
|
181
|
-
optional
|
165
|
+
optional :int32, :default_int32, 61, :default => 41
|
166
|
+
optional :int64, :default_int64, 62, :default => 42
|
167
|
+
optional :uint32, :default_uint32, 63, :default => 43
|
168
|
+
optional :uint64, :default_uint64, 64, :default => 44
|
169
|
+
optional :sint32, :default_sint32, 65, :default => -45
|
170
|
+
optional :sint64, :default_sint64, 66, :default => 46
|
171
|
+
optional :fixed32, :default_fixed32, 67, :default => 47
|
172
|
+
optional :fixed64, :default_fixed64, 68, :default => 48
|
173
|
+
optional :sfixed32, :default_sfixed32, 69, :default => 49
|
174
|
+
optional :sfixed64, :default_sfixed64, 70, :default => -50
|
175
|
+
optional :float, :default_float, 71, :default => 51.5
|
176
|
+
optional :double, :default_double, 72, :default => 52000
|
177
|
+
optional :bool, :default_bool, 73, :default => true
|
178
|
+
optional :string, :default_string, 74, :default => "hello"
|
179
|
+
optional :bytes, :default_bytes, 75, :default => "world"
|
182
180
|
optional ::GoogleUnittest::TestAllTypes::NestedEnum, :default_nested_enum, 81, :default => ::GoogleUnittest::TestAllTypes::NestedEnum::BAR
|
183
181
|
optional ::GoogleUnittest::ForeignEnum, :default_foreign_enum, 82, :default => ::GoogleUnittest::ForeignEnum::FOREIGN_BAR
|
184
182
|
optional ::GoogleUnittestImport::ImportEnum, :default_import_enum, 83, :default => ::GoogleUnittestImport::ImportEnum::IMPORT_BAR
|
185
|
-
optional
|
186
|
-
optional
|
183
|
+
optional :string, :default_string_piece, 84, :default => "abc"
|
184
|
+
optional :string, :default_cord, 85, :default => "123"
|
187
185
|
end
|
188
186
|
|
189
187
|
class TestDeprecatedFields
|
190
|
-
optional
|
188
|
+
optional :int32, :deprecated_int32, 1, :deprecated => true
|
191
189
|
end
|
192
190
|
|
193
191
|
class ForeignMessage
|
194
|
-
optional
|
192
|
+
optional :int32, :c, 1
|
195
193
|
end
|
196
194
|
|
197
195
|
class TestAllExtensions
|
198
196
|
# Extension Fields
|
199
197
|
extensions 1...536870912
|
200
|
-
optional
|
201
|
-
optional
|
202
|
-
optional
|
203
|
-
optional
|
204
|
-
optional
|
205
|
-
optional
|
206
|
-
optional
|
207
|
-
optional
|
208
|
-
optional
|
209
|
-
optional
|
210
|
-
optional
|
211
|
-
optional
|
212
|
-
optional
|
213
|
-
optional
|
214
|
-
optional
|
198
|
+
optional :int32, :optional_int32_extension, 1, :extension => true
|
199
|
+
optional :int64, :optional_int64_extension, 2, :extension => true
|
200
|
+
optional :uint32, :optional_uint32_extension, 3, :extension => true
|
201
|
+
optional :uint64, :optional_uint64_extension, 4, :extension => true
|
202
|
+
optional :sint32, :optional_sint32_extension, 5, :extension => true
|
203
|
+
optional :sint64, :optional_sint64_extension, 6, :extension => true
|
204
|
+
optional :fixed32, :optional_fixed32_extension, 7, :extension => true
|
205
|
+
optional :fixed64, :optional_fixed64_extension, 8, :extension => true
|
206
|
+
optional :sfixed32, :optional_sfixed32_extension, 9, :extension => true
|
207
|
+
optional :sfixed64, :optional_sfixed64_extension, 10, :extension => true
|
208
|
+
optional :float, :optional_float_extension, 11, :extension => true
|
209
|
+
optional :double, :optional_double_extension, 12, :extension => true
|
210
|
+
optional :bool, :optional_bool_extension, 13, :extension => true
|
211
|
+
optional :string, :optional_string_extension, 14, :extension => true
|
212
|
+
optional :bytes, :optional_bytes_extension, 15, :extension => true
|
215
213
|
optional ::GoogleUnittest::TestAllTypes::NestedMessage, :optional_nested_message_extension, 18, :extension => true
|
216
214
|
optional ::GoogleUnittest::ForeignMessage, :optional_foreign_message_extension, 19, :extension => true
|
217
215
|
optional ::GoogleUnittestImport::ImportMessage, :optional_import_message_extension, 20, :extension => true
|
218
216
|
optional ::GoogleUnittest::TestAllTypes::NestedEnum, :optional_nested_enum_extension, 21, :extension => true
|
219
217
|
optional ::GoogleUnittest::ForeignEnum, :optional_foreign_enum_extension, 22, :extension => true
|
220
218
|
optional ::GoogleUnittestImport::ImportEnum, :optional_import_enum_extension, 23, :extension => true
|
221
|
-
optional
|
222
|
-
optional
|
219
|
+
optional :string, :optional_string_piece_extension, 24, :extension => true
|
220
|
+
optional :string, :optional_cord_extension, 25, :extension => true
|
223
221
|
optional ::GoogleUnittestImport::PublicImportMessage, :optional_public_import_message_extension, 26, :extension => true
|
224
222
|
optional ::GoogleUnittest::TestAllTypes::NestedMessage, :optional_lazy_message_extension, 27, :extension => true
|
225
|
-
repeated
|
226
|
-
repeated
|
227
|
-
repeated
|
228
|
-
repeated
|
229
|
-
repeated
|
230
|
-
repeated
|
231
|
-
repeated
|
232
|
-
repeated
|
233
|
-
repeated
|
234
|
-
repeated
|
235
|
-
repeated
|
236
|
-
repeated
|
237
|
-
repeated
|
238
|
-
repeated
|
239
|
-
repeated
|
223
|
+
repeated :int32, :repeated_int32_extension, 31, :extension => true
|
224
|
+
repeated :int64, :repeated_int64_extension, 32, :extension => true
|
225
|
+
repeated :uint32, :repeated_uint32_extension, 33, :extension => true
|
226
|
+
repeated :uint64, :repeated_uint64_extension, 34, :extension => true
|
227
|
+
repeated :sint32, :repeated_sint32_extension, 35, :extension => true
|
228
|
+
repeated :sint64, :repeated_sint64_extension, 36, :extension => true
|
229
|
+
repeated :fixed32, :repeated_fixed32_extension, 37, :extension => true
|
230
|
+
repeated :fixed64, :repeated_fixed64_extension, 38, :extension => true
|
231
|
+
repeated :sfixed32, :repeated_sfixed32_extension, 39, :extension => true
|
232
|
+
repeated :sfixed64, :repeated_sfixed64_extension, 40, :extension => true
|
233
|
+
repeated :float, :repeated_float_extension, 41, :extension => true
|
234
|
+
repeated :double, :repeated_double_extension, 42, :extension => true
|
235
|
+
repeated :bool, :repeated_bool_extension, 43, :extension => true
|
236
|
+
repeated :string, :repeated_string_extension, 44, :extension => true
|
237
|
+
repeated :bytes, :repeated_bytes_extension, 45, :extension => true
|
240
238
|
repeated ::GoogleUnittest::TestAllTypes::NestedMessage, :repeated_nested_message_extension, 48, :extension => true
|
241
239
|
repeated ::GoogleUnittest::ForeignMessage, :repeated_foreign_message_extension, 49, :extension => true
|
242
240
|
repeated ::GoogleUnittestImport::ImportMessage, :repeated_import_message_extension, 50, :extension => true
|
243
241
|
repeated ::GoogleUnittest::TestAllTypes::NestedEnum, :repeated_nested_enum_extension, 51, :extension => true
|
244
242
|
repeated ::GoogleUnittest::ForeignEnum, :repeated_foreign_enum_extension, 52, :extension => true
|
245
243
|
repeated ::GoogleUnittestImport::ImportEnum, :repeated_import_enum_extension, 53, :extension => true
|
246
|
-
repeated
|
247
|
-
repeated
|
244
|
+
repeated :string, :repeated_string_piece_extension, 54, :extension => true
|
245
|
+
repeated :string, :repeated_cord_extension, 55, :extension => true
|
248
246
|
repeated ::GoogleUnittest::TestAllTypes::NestedMessage, :repeated_lazy_message_extension, 57, :extension => true
|
249
|
-
optional
|
250
|
-
optional
|
251
|
-
optional
|
252
|
-
optional
|
253
|
-
optional
|
254
|
-
optional
|
255
|
-
optional
|
256
|
-
optional
|
257
|
-
optional
|
258
|
-
optional
|
259
|
-
optional
|
260
|
-
optional
|
261
|
-
optional
|
262
|
-
optional
|
263
|
-
optional
|
247
|
+
optional :int32, :default_int32_extension, 61, :default => 41, :extension => true
|
248
|
+
optional :int64, :default_int64_extension, 62, :default => 42, :extension => true
|
249
|
+
optional :uint32, :default_uint32_extension, 63, :default => 43, :extension => true
|
250
|
+
optional :uint64, :default_uint64_extension, 64, :default => 44, :extension => true
|
251
|
+
optional :sint32, :default_sint32_extension, 65, :default => -45, :extension => true
|
252
|
+
optional :sint64, :default_sint64_extension, 66, :default => 46, :extension => true
|
253
|
+
optional :fixed32, :default_fixed32_extension, 67, :default => 47, :extension => true
|
254
|
+
optional :fixed64, :default_fixed64_extension, 68, :default => 48, :extension => true
|
255
|
+
optional :sfixed32, :default_sfixed32_extension, 69, :default => 49, :extension => true
|
256
|
+
optional :sfixed64, :default_sfixed64_extension, 70, :default => -50, :extension => true
|
257
|
+
optional :float, :default_float_extension, 71, :default => 51.5, :extension => true
|
258
|
+
optional :double, :default_double_extension, 72, :default => 52000, :extension => true
|
259
|
+
optional :bool, :default_bool_extension, 73, :default => true, :extension => true
|
260
|
+
optional :string, :default_string_extension, 74, :default => "hello", :extension => true
|
261
|
+
optional :bytes, :default_bytes_extension, 75, :default => "world", :extension => true
|
264
262
|
optional ::GoogleUnittest::TestAllTypes::NestedEnum, :default_nested_enum_extension, 81, :default => ::GoogleUnittest::TestAllTypes::NestedEnum::BAR, :extension => true
|
265
263
|
optional ::GoogleUnittest::ForeignEnum, :default_foreign_enum_extension, 82, :default => ::GoogleUnittest::ForeignEnum::FOREIGN_BAR, :extension => true
|
266
264
|
optional ::GoogleUnittestImport::ImportEnum, :default_import_enum_extension, 83, :default => ::GoogleUnittestImport::ImportEnum::IMPORT_BAR, :extension => true
|
267
|
-
optional
|
268
|
-
optional
|
269
|
-
optional
|
265
|
+
optional :string, :default_string_piece_extension, 84, :default => "abc", :extension => true
|
266
|
+
optional :string, :default_cord_extension, 85, :default => "123", :extension => true
|
267
|
+
optional :string, :test, 1002, :default => "test", :extension => true
|
270
268
|
optional ::GoogleUnittest::TestRequired, :single, 1000, :extension => true
|
271
269
|
repeated ::GoogleUnittest::TestRequired, :multi, 1001, :extension => true
|
272
270
|
end
|
273
271
|
|
274
272
|
class TestRequired
|
275
|
-
required
|
276
|
-
optional
|
277
|
-
required
|
278
|
-
optional
|
279
|
-
optional
|
280
|
-
optional
|
281
|
-
optional
|
282
|
-
optional
|
283
|
-
optional
|
284
|
-
optional
|
285
|
-
optional
|
286
|
-
optional
|
287
|
-
optional
|
288
|
-
optional
|
289
|
-
optional
|
290
|
-
optional
|
291
|
-
optional
|
292
|
-
optional
|
293
|
-
optional
|
294
|
-
optional
|
295
|
-
optional
|
296
|
-
optional
|
297
|
-
optional
|
298
|
-
optional
|
299
|
-
optional
|
300
|
-
optional
|
301
|
-
optional
|
302
|
-
optional
|
303
|
-
optional
|
304
|
-
optional
|
305
|
-
optional
|
306
|
-
optional
|
307
|
-
required
|
273
|
+
required :int32, :a, 1
|
274
|
+
optional :int32, :dummy2, 2
|
275
|
+
required :int32, :b, 3
|
276
|
+
optional :int32, :dummy4, 4
|
277
|
+
optional :int32, :dummy5, 5
|
278
|
+
optional :int32, :dummy6, 6
|
279
|
+
optional :int32, :dummy7, 7
|
280
|
+
optional :int32, :dummy8, 8
|
281
|
+
optional :int32, :dummy9, 9
|
282
|
+
optional :int32, :dummy10, 10
|
283
|
+
optional :int32, :dummy11, 11
|
284
|
+
optional :int32, :dummy12, 12
|
285
|
+
optional :int32, :dummy13, 13
|
286
|
+
optional :int32, :dummy14, 14
|
287
|
+
optional :int32, :dummy15, 15
|
288
|
+
optional :int32, :dummy16, 16
|
289
|
+
optional :int32, :dummy17, 17
|
290
|
+
optional :int32, :dummy18, 18
|
291
|
+
optional :int32, :dummy19, 19
|
292
|
+
optional :int32, :dummy20, 20
|
293
|
+
optional :int32, :dummy21, 21
|
294
|
+
optional :int32, :dummy22, 22
|
295
|
+
optional :int32, :dummy23, 23
|
296
|
+
optional :int32, :dummy24, 24
|
297
|
+
optional :int32, :dummy25, 25
|
298
|
+
optional :int32, :dummy26, 26
|
299
|
+
optional :int32, :dummy27, 27
|
300
|
+
optional :int32, :dummy28, 28
|
301
|
+
optional :int32, :dummy29, 29
|
302
|
+
optional :int32, :dummy30, 30
|
303
|
+
optional :int32, :dummy31, 31
|
304
|
+
optional :int32, :dummy32, 32
|
305
|
+
required :int32, :c, 33
|
308
306
|
end
|
309
307
|
|
310
308
|
class TestRequiredForeign
|
311
309
|
optional ::GoogleUnittest::TestRequired, :optional_message, 1
|
312
310
|
repeated ::GoogleUnittest::TestRequired, :repeated_message, 2
|
313
|
-
optional
|
311
|
+
optional :int32, :dummy, 3
|
314
312
|
end
|
315
313
|
|
316
314
|
class TestForeignNested
|
@@ -318,13 +316,13 @@ module GoogleUnittest
|
|
318
316
|
end
|
319
317
|
|
320
318
|
class TestReallyLargeTagNumber
|
321
|
-
optional
|
322
|
-
optional
|
319
|
+
optional :int32, :a, 1
|
320
|
+
optional :int32, :bb, 268435455
|
323
321
|
end
|
324
322
|
|
325
323
|
class TestRecursiveMessage
|
326
324
|
optional ::GoogleUnittest::TestRecursiveMessage, :a, 1
|
327
|
-
optional
|
325
|
+
optional :int32, :i, 2
|
328
326
|
end
|
329
327
|
|
330
328
|
class TestMutualRecursionA
|
@@ -333,11 +331,11 @@ module GoogleUnittest
|
|
333
331
|
|
334
332
|
class TestMutualRecursionB
|
335
333
|
optional ::GoogleUnittest::TestMutualRecursionA, :a, 1
|
336
|
-
optional
|
334
|
+
optional :int32, :optional_int32, 2
|
337
335
|
end
|
338
336
|
|
339
337
|
class TestDupFieldNumber
|
340
|
-
optional
|
338
|
+
optional :int32, :a, 1
|
341
339
|
end
|
342
340
|
|
343
341
|
class TestEagerMessage
|
@@ -350,7 +348,7 @@ module GoogleUnittest
|
|
350
348
|
|
351
349
|
class TestNestedMessageHasBits
|
352
350
|
class NestedMessage
|
353
|
-
repeated
|
351
|
+
repeated :int32, :nestedmessage_repeated_int32, 1
|
354
352
|
repeated ::GoogleUnittest::ForeignMessage, :nestedmessage_repeated_foreignmessage, 2
|
355
353
|
end
|
356
354
|
|
@@ -358,58 +356,58 @@ module GoogleUnittest
|
|
358
356
|
end
|
359
357
|
|
360
358
|
class TestCamelCaseFieldNames
|
361
|
-
optional
|
362
|
-
optional
|
359
|
+
optional :int32, :PrimitiveField, 1
|
360
|
+
optional :string, :StringField, 2
|
363
361
|
optional ::GoogleUnittest::ForeignEnum, :EnumField, 3
|
364
362
|
optional ::GoogleUnittest::ForeignMessage, :MessageField, 4
|
365
|
-
optional
|
366
|
-
optional
|
367
|
-
repeated
|
368
|
-
repeated
|
363
|
+
optional :string, :StringPieceField, 5
|
364
|
+
optional :string, :CordField, 6
|
365
|
+
repeated :int32, :RepeatedPrimitiveField, 7
|
366
|
+
repeated :string, :RepeatedStringField, 8
|
369
367
|
repeated ::GoogleUnittest::ForeignEnum, :RepeatedEnumField, 9
|
370
368
|
repeated ::GoogleUnittest::ForeignMessage, :RepeatedMessageField, 10
|
371
|
-
repeated
|
372
|
-
repeated
|
369
|
+
repeated :string, :RepeatedStringPieceField, 11
|
370
|
+
repeated :string, :RepeatedCordField, 12
|
373
371
|
end
|
374
372
|
|
375
373
|
class TestFieldOrderings
|
376
|
-
optional
|
377
|
-
optional
|
378
|
-
optional
|
374
|
+
optional :string, :my_string, 11
|
375
|
+
optional :int64, :my_int, 1
|
376
|
+
optional :float, :my_float, 101
|
379
377
|
# Extension Fields
|
380
378
|
extensions 2...11
|
381
379
|
extensions 12...101
|
382
|
-
optional
|
383
|
-
optional
|
380
|
+
optional :string, :my_extension_string, 50, :extension => true
|
381
|
+
optional :int32, :my_extension_int, 5, :extension => true
|
384
382
|
end
|
385
383
|
|
386
384
|
class TestExtremeDefaultValues
|
387
|
-
optional
|
388
|
-
optional
|
389
|
-
optional
|
390
|
-
optional
|
391
|
-
optional
|
392
|
-
optional
|
393
|
-
optional
|
394
|
-
optional
|
395
|
-
optional
|
396
|
-
optional
|
397
|
-
optional
|
398
|
-
optional
|
399
|
-
optional
|
400
|
-
optional
|
401
|
-
optional
|
402
|
-
optional
|
403
|
-
optional
|
404
|
-
optional
|
405
|
-
optional
|
406
|
-
optional
|
407
|
-
optional
|
408
|
-
optional
|
409
|
-
optional
|
410
|
-
optional
|
411
|
-
optional
|
412
|
-
optional
|
385
|
+
optional :bytes, :escaped_bytes, 1, :default => "\000\001\007\010\014\n\r\t\013\\\\'\"\376"
|
386
|
+
optional :uint32, :large_uint32, 2, :default => 4294967295
|
387
|
+
optional :uint64, :large_uint64, 3, :default => 18446744073709551615
|
388
|
+
optional :int32, :small_int32, 4, :default => -2147483647
|
389
|
+
optional :int64, :small_int64, 5, :default => -9223372036854775807
|
390
|
+
optional :int32, :really_small_int32, 21, :default => -2147483648
|
391
|
+
optional :int64, :really_small_int64, 22, :default => -9223372036854775808
|
392
|
+
optional :string, :utf8_string, 6, :default => "ሴ"
|
393
|
+
optional :float, :zero_float, 7, :default => 0
|
394
|
+
optional :float, :one_float, 8, :default => 1
|
395
|
+
optional :float, :small_float, 9, :default => 1.5
|
396
|
+
optional :float, :negative_one_float, 10, :default => -1
|
397
|
+
optional :float, :negative_float, 11, :default => -1.5
|
398
|
+
optional :float, :large_float, 12, :default => 2e+08
|
399
|
+
optional :float, :small_negative_float, 13, :default => -8e-28
|
400
|
+
optional :double, :inf_double, 14, :default => ::Float::INFINITY
|
401
|
+
optional :double, :neg_inf_double, 15, :default => -::Float::INFINITY
|
402
|
+
optional :double, :nan_double, 16, :default => ::Float::NAN
|
403
|
+
optional :float, :inf_float, 17, :default => ::Float::INFINITY
|
404
|
+
optional :float, :neg_inf_float, 18, :default => -::Float::INFINITY
|
405
|
+
optional :float, :nan_float, 19, :default => ::Float::NAN
|
406
|
+
optional :string, :cpp_trigraph, 20, :default => "? ? ?? ?? ??? ??/ ??-"
|
407
|
+
optional :string, :string_with_zero, 23, :default => "hello"
|
408
|
+
optional :bytes, :bytes_with_zero, 24, :default => "wor\000ld"
|
409
|
+
optional :string, :string_piece_with_zero, 25, :default => "abc"
|
410
|
+
optional :string, :cord_with_zero, 26, :default => "123"
|
413
411
|
end
|
414
412
|
|
415
413
|
class SparseEnumMessage
|
@@ -417,95 +415,95 @@ module GoogleUnittest
|
|
417
415
|
end
|
418
416
|
|
419
417
|
class OneString
|
420
|
-
optional
|
418
|
+
optional :string, :data, 1
|
421
419
|
end
|
422
420
|
|
423
421
|
class MoreString
|
424
|
-
repeated
|
422
|
+
repeated :string, :data, 1
|
425
423
|
end
|
426
424
|
|
427
425
|
class OneBytes
|
428
|
-
optional
|
426
|
+
optional :bytes, :data, 1
|
429
427
|
end
|
430
428
|
|
431
429
|
class MoreBytes
|
432
|
-
repeated
|
430
|
+
repeated :bytes, :data, 1
|
433
431
|
end
|
434
432
|
|
435
433
|
class TestPackedTypes
|
436
|
-
repeated
|
437
|
-
repeated
|
438
|
-
repeated
|
439
|
-
repeated
|
440
|
-
repeated
|
441
|
-
repeated
|
442
|
-
repeated
|
443
|
-
repeated
|
444
|
-
repeated
|
445
|
-
repeated
|
446
|
-
repeated
|
447
|
-
repeated
|
448
|
-
repeated
|
434
|
+
repeated :int32, :packed_int32, 90, :packed => true
|
435
|
+
repeated :int64, :packed_int64, 91, :packed => true
|
436
|
+
repeated :uint32, :packed_uint32, 92, :packed => true
|
437
|
+
repeated :uint64, :packed_uint64, 93, :packed => true
|
438
|
+
repeated :sint32, :packed_sint32, 94, :packed => true
|
439
|
+
repeated :sint64, :packed_sint64, 95, :packed => true
|
440
|
+
repeated :fixed32, :packed_fixed32, 96, :packed => true
|
441
|
+
repeated :fixed64, :packed_fixed64, 97, :packed => true
|
442
|
+
repeated :sfixed32, :packed_sfixed32, 98, :packed => true
|
443
|
+
repeated :sfixed64, :packed_sfixed64, 99, :packed => true
|
444
|
+
repeated :float, :packed_float, 100, :packed => true
|
445
|
+
repeated :double, :packed_double, 101, :packed => true
|
446
|
+
repeated :bool, :packed_bool, 102, :packed => true
|
449
447
|
repeated ::GoogleUnittest::ForeignEnum, :packed_enum, 103, :packed => true
|
450
448
|
end
|
451
449
|
|
452
450
|
class TestUnpackedTypes
|
453
|
-
repeated
|
454
|
-
repeated
|
455
|
-
repeated
|
456
|
-
repeated
|
457
|
-
repeated
|
458
|
-
repeated
|
459
|
-
repeated
|
460
|
-
repeated
|
461
|
-
repeated
|
462
|
-
repeated
|
463
|
-
repeated
|
464
|
-
repeated
|
465
|
-
repeated
|
451
|
+
repeated :int32, :unpacked_int32, 90
|
452
|
+
repeated :int64, :unpacked_int64, 91
|
453
|
+
repeated :uint32, :unpacked_uint32, 92
|
454
|
+
repeated :uint64, :unpacked_uint64, 93
|
455
|
+
repeated :sint32, :unpacked_sint32, 94
|
456
|
+
repeated :sint64, :unpacked_sint64, 95
|
457
|
+
repeated :fixed32, :unpacked_fixed32, 96
|
458
|
+
repeated :fixed64, :unpacked_fixed64, 97
|
459
|
+
repeated :sfixed32, :unpacked_sfixed32, 98
|
460
|
+
repeated :sfixed64, :unpacked_sfixed64, 99
|
461
|
+
repeated :float, :unpacked_float, 100
|
462
|
+
repeated :double, :unpacked_double, 101
|
463
|
+
repeated :bool, :unpacked_bool, 102
|
466
464
|
repeated ::GoogleUnittest::ForeignEnum, :unpacked_enum, 103
|
467
465
|
end
|
468
466
|
|
469
467
|
class TestPackedExtensions
|
470
468
|
# Extension Fields
|
471
469
|
extensions 1...536870912
|
472
|
-
repeated
|
473
|
-
repeated
|
474
|
-
repeated
|
475
|
-
repeated
|
476
|
-
repeated
|
477
|
-
repeated
|
478
|
-
repeated
|
479
|
-
repeated
|
480
|
-
repeated
|
481
|
-
repeated
|
482
|
-
repeated
|
483
|
-
repeated
|
484
|
-
repeated
|
470
|
+
repeated :int32, :packed_int32_extension, 90, :packed => true, :extension => true
|
471
|
+
repeated :int64, :packed_int64_extension, 91, :packed => true, :extension => true
|
472
|
+
repeated :uint32, :packed_uint32_extension, 92, :packed => true, :extension => true
|
473
|
+
repeated :uint64, :packed_uint64_extension, 93, :packed => true, :extension => true
|
474
|
+
repeated :sint32, :packed_sint32_extension, 94, :packed => true, :extension => true
|
475
|
+
repeated :sint64, :packed_sint64_extension, 95, :packed => true, :extension => true
|
476
|
+
repeated :fixed32, :packed_fixed32_extension, 96, :packed => true, :extension => true
|
477
|
+
repeated :fixed64, :packed_fixed64_extension, 97, :packed => true, :extension => true
|
478
|
+
repeated :sfixed32, :packed_sfixed32_extension, 98, :packed => true, :extension => true
|
479
|
+
repeated :sfixed64, :packed_sfixed64_extension, 99, :packed => true, :extension => true
|
480
|
+
repeated :float, :packed_float_extension, 100, :packed => true, :extension => true
|
481
|
+
repeated :double, :packed_double_extension, 101, :packed => true, :extension => true
|
482
|
+
repeated :bool, :packed_bool_extension, 102, :packed => true, :extension => true
|
485
483
|
repeated ::GoogleUnittest::ForeignEnum, :packed_enum_extension, 103, :packed => true, :extension => true
|
486
484
|
end
|
487
485
|
|
488
486
|
class TestDynamicExtensions
|
489
487
|
class DynamicMessageType
|
490
|
-
optional
|
488
|
+
optional :int32, :dynamic_field, 2100
|
491
489
|
end
|
492
490
|
|
493
|
-
optional
|
491
|
+
optional :fixed32, :scalar_extension, 2000
|
494
492
|
optional ::GoogleUnittest::ForeignEnum, :enum_extension, 2001
|
495
493
|
optional ::GoogleUnittest::TestDynamicExtensions::DynamicEnumType, :dynamic_enum_extension, 2002
|
496
494
|
optional ::GoogleUnittest::ForeignMessage, :message_extension, 2003
|
497
495
|
optional ::GoogleUnittest::TestDynamicExtensions::DynamicMessageType, :dynamic_message_extension, 2004
|
498
|
-
repeated
|
499
|
-
repeated
|
496
|
+
repeated :string, :repeated_extension, 2005
|
497
|
+
repeated :sint32, :packed_extension, 2006, :packed => true
|
500
498
|
end
|
501
499
|
|
502
500
|
class TestRepeatedScalarDifferentTagSizes
|
503
|
-
repeated
|
504
|
-
repeated
|
505
|
-
repeated
|
506
|
-
repeated
|
507
|
-
repeated
|
508
|
-
repeated
|
501
|
+
repeated :fixed32, :repeated_fixed32, 12
|
502
|
+
repeated :int32, :repeated_int32, 13
|
503
|
+
repeated :fixed64, :repeated_fixed64, 2046
|
504
|
+
repeated :int64, :repeated_int64, 2047
|
505
|
+
repeated :float, :repeated_float, 262142
|
506
|
+
repeated :uint64, :repeated_uint64, 262143
|
509
507
|
end
|
510
508
|
|
511
509
|
class TestParsingMerge
|
@@ -527,7 +525,7 @@ module GoogleUnittest
|
|
527
525
|
end
|
528
526
|
|
529
527
|
class TestCommentInjectionMessage
|
530
|
-
optional
|
528
|
+
optional :string, :a, 1, :default => "*/ <- Neither should this."
|
531
529
|
end
|
532
530
|
|
533
531
|
|