google-protobuf 3.7.0 → 3.8.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.
Potentially problematic release.
This version of google-protobuf might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/defs.c +7 -7
- data/ext/google/protobuf_c/encode_decode.c +41 -1
- data/ext/google/protobuf_c/map.c +8 -2
- data/ext/google/protobuf_c/message.c +124 -8
- data/ext/google/protobuf_c/protobuf.h +5 -3
- data/ext/google/protobuf_c/repeated_field.c +9 -3
- data/ext/google/protobuf_c/storage.c +66 -23
- data/ext/google/protobuf_c/upb.c +478 -316
- data/ext/google/protobuf_c/upb.h +1390 -504
- data/tests/basic.rb +22 -2
- metadata +4 -5
data/tests/basic.rb
CHANGED
@@ -154,12 +154,12 @@ module BasicTest
|
|
154
154
|
e = assert_raise ArgumentError do
|
155
155
|
MapMessage.new(:map_string_int32 => "hello")
|
156
156
|
end
|
157
|
-
assert_equal e.message, "Expected Hash object as initializer value for map field 'map_string_int32'."
|
157
|
+
assert_equal e.message, "Expected Hash object as initializer value for map field 'map_string_int32' (given String)."
|
158
158
|
|
159
159
|
e = assert_raise ArgumentError do
|
160
160
|
TestMessage.new(:repeated_uint32 => "hello")
|
161
161
|
end
|
162
|
-
assert_equal e.message, "Expected array as initializer value for repeated field 'repeated_uint32'."
|
162
|
+
assert_equal e.message, "Expected array as initializer value for repeated field 'repeated_uint32' (given String)."
|
163
163
|
end
|
164
164
|
|
165
165
|
def test_map_field
|
@@ -357,5 +357,25 @@ module BasicTest
|
|
357
357
|
assert_equal nil, file_descriptor.name
|
358
358
|
assert_equal :proto3, file_descriptor.syntax
|
359
359
|
end
|
360
|
+
|
361
|
+
# Ruby 2.5 changed to raise FrozenError instead of RuntimeError
|
362
|
+
FrozenErrorType = Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5') ? RuntimeError : FrozenError
|
363
|
+
|
364
|
+
def test_map_freeze
|
365
|
+
m = proto_module::MapMessage.new
|
366
|
+
m.map_string_int32['a'] = 5
|
367
|
+
m.map_string_msg['b'] = proto_module::TestMessage2.new
|
368
|
+
|
369
|
+
m.map_string_int32.freeze
|
370
|
+
m.map_string_msg.freeze
|
371
|
+
|
372
|
+
assert m.map_string_int32.frozen?
|
373
|
+
assert m.map_string_msg.frozen?
|
374
|
+
|
375
|
+
assert_raise(FrozenErrorType) { m.map_string_int32['foo'] = 1 }
|
376
|
+
assert_raise(FrozenErrorType) { m.map_string_msg['bar'] = proto_module::TestMessage2.new }
|
377
|
+
assert_raise(FrozenErrorType) { m.map_string_int32.delete('a') }
|
378
|
+
assert_raise(FrozenErrorType) { m.map_string_int32.clear }
|
379
|
+
end
|
360
380
|
end
|
361
381
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Protobuf Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler-dock
|
@@ -120,15 +120,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
121
121
|
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
123
|
+
version: '2.3'
|
124
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
126
|
- - ">="
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
|
131
|
-
rubygems_version: 2.7.8
|
130
|
+
rubygems_version: 3.0.3
|
132
131
|
signing_key:
|
133
132
|
specification_version: 4
|
134
133
|
summary: Protocol Buffers
|