Lines Matching refs:new
15 pool = Google::Protobuf::DescriptorPool.new
35 m = TestSingularFields.new
37 m.singular_msg = TestMessage2.new
41 m = OneofMessage.new
50 m = TestSingularFields.new
72 m = TestMessage.new
82 m = TestSingularFields.new
97 m = TestSingularFields.new
119 m.singular_msg = TestMessage2.new(:foo => 42)
120 assert_equal TestMessage2.new(:foo => 42), m.singular_msg
126 m.singular_msg = TestMessage2.new(:foo => 42)
127 assert_equal TestMessage2.new(:foo => 42), m.singular_msg
133 m = TestMessage.new
145 m = OneofMessage.new
167 TestMessage.new(:hello => "world")
172 MapMessage.new(:map_string_int32 => "hello")
177 TestMessage.new(:repeated_uint32 => "hello")
183 m = MapMessage.new
187 m = MapMessage.new(
189 :map_string_msg => {"a" => TestMessage2.new(:foo => 1),
190 "b" => TestMessage2.new(:foo => 2)},
199 m.map_string_msg["c"] = TestMessage2.new(:foo => 3)
200 assert m.map_string_msg["c"] == TestMessage2.new(:foo => 3)
203 assert m.map_string_msg == { "a" => TestMessage2.new(:foo => 1) }
206 m.map_string_msg["e"] = TestMessage.new # wrong value type
209 assert m.map_string_msg == { "a" => TestMessage2.new(:foo => 1) }
211 m.map_string_int32 = Google::Protobuf::Map.new(:string, :int32)
213 m.map_string_int32 = Google::Protobuf::Map.new(:string, :int64)
220 m = MapMessage.new(:map_string_int32 => { 1 => "I am not a number" })
225 m = MapMessage.new
229 m = MapMessage.new(
231 :map_string_msg => {a: TestMessage2.new(:foo => 1),
232 b: TestMessage2.new(:foo => 10)})
239 m = MapMessage.new(
241 :map_string_msg => {"a" => TestMessage2.new(:foo => 1),
242 "b" => TestMessage2.new(:foo => 2)},
250 m = MapMessage.new(map_string_int32: { "aaa" => 1 })
268 m = proto_module::Wrapper.new(
269 map_double: {0 => Google::Protobuf::DoubleValue.new(value: 2.0)},
270 map_float: {0 => Google::Protobuf::FloatValue.new(value: 4.0)},
271 map_int32: {0 => Google::Protobuf::Int32Value.new(value: 3)},
272 map_int64: {0 => Google::Protobuf::Int64Value.new(value: 4)},
273 map_uint32: {0 => Google::Protobuf::UInt32Value.new(value: 5)},
274 map_uint64: {0 => Google::Protobuf::UInt64Value.new(value: 6)},
275 map_bool: {0 => Google::Protobuf::BoolValue.new(value: true)},
276 map_string: {0 => Google::Protobuf::StringValue.new(value: 'str')},
277 map_bytes: {0 => Google::Protobuf::BytesValue.new(value: 'fun')},
310 m = proto_module::Wrapper.new(
311 map_double: {0 => Google::Protobuf::DoubleValue.new(value: 0.0)},
312 map_float: {0 => Google::Protobuf::FloatValue.new(value: 0.0)},
313 map_int32: {0 => Google::Protobuf::Int32Value.new(value: 0)},
314 map_int64: {0 => Google::Protobuf::Int64Value.new(value: 0)},
315 map_uint32: {0 => Google::Protobuf::UInt32Value.new(value: 0)},
316 map_uint64: {0 => Google::Protobuf::UInt64Value.new(value: 0)},
317 map_bool: {0 => Google::Protobuf::BoolValue.new(value: false)},
318 map_string: {0 => Google::Protobuf::StringValue.new(value: '')},
319 map_bytes: {0 => Google::Protobuf::BytesValue.new(value: '')},
352 m = proto_module::Wrapper.new(
353 map_double: {0 => Google::Protobuf::DoubleValue.new()},
354 map_float: {0 => Google::Protobuf::FloatValue.new()},
355 map_int32: {0 => Google::Protobuf::Int32Value.new()},
356 map_int64: {0 => Google::Protobuf::Int64Value.new()},
357 map_uint32: {0 => Google::Protobuf::UInt32Value.new()},
358 map_uint64: {0 => Google::Protobuf::UInt64Value.new()},
359 map_bool: {0 => Google::Protobuf::BoolValue.new()},
360 map_string: {0 => Google::Protobuf::StringValue.new()},
361 map_bytes: {0 => Google::Protobuf::BytesValue.new()},
378 o = Outer.new
379 o.items[0] = Inner.new
383 Thread.new do
393 m = MapMessage.new(
395 :map_string_msg => {"a" => TestMessage2.new(:foo => 1),
396 "b" => TestMessage2.new(:foo => 2)},
410 assert kv == {"a" => TestMessage2.new(:foo => 1),
411 "b" => TestMessage2.new(:foo => 2)}
436 m = TestMessage.new(:optional_bool => true, :optional_double => -10.100001, :optional_string => 'foo', :repeated_string => ['bar1', 'bar2'], :repeated_msg => [TestMessage2.new(:foo => 100)])
463 m = MapMessage.new(
465 :map_string_msg => {"a" => TestMessage2.new(:foo => 1),
466 "b" => TestMessage2.new(:foo => 2)},
480 m = MapMessage.new(:map_string_int32 => {"a" => 1})
495 m = MapMessage.new(:map_string_msg => {"a" => TestMessage2.new})
506 msg = MapMessage.new
524 FrozenErrorType = Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5') ? RuntimeError : FrozenError
527 m = proto_module::MapMessage.new
529 m.map_string_msg['b'] = proto_module::TestMessage2.new
538 assert_raise(FrozenErrorType) { m.map_string_msg['bar'] = proto_module::TestMessage2.new }