google-protobuf 3.5.0 → 3.23.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of google-protobuf might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/ext/google/protobuf_c/convert.c +361 -0
- data/ext/google/protobuf_c/convert.h +75 -0
- data/ext/google/protobuf_c/defs.c +770 -1254
- data/ext/google/protobuf_c/defs.h +107 -0
- data/ext/google/protobuf_c/extconf.rb +15 -5
- data/ext/google/protobuf_c/map.c +312 -474
- data/ext/google/protobuf_c/map.h +66 -0
- data/ext/google/protobuf_c/message.c +1139 -372
- data/ext/google/protobuf_c/message.h +104 -0
- data/ext/google/protobuf_c/protobuf.c +418 -51
- data/ext/google/protobuf_c/protobuf.h +53 -485
- data/ext/google/protobuf_c/repeated_field.c +319 -316
- data/ext/google/protobuf_c/repeated_field.h +63 -0
- data/ext/google/protobuf_c/ruby-upb.c +13974 -0
- data/ext/google/protobuf_c/ruby-upb.h +11780 -0
- data/ext/google/protobuf_c/third_party/utf8_range/LICENSE +22 -0
- data/ext/google/protobuf_c/third_party/utf8_range/naive.c +92 -0
- data/ext/google/protobuf_c/third_party/utf8_range/range2-neon.c +157 -0
- data/ext/google/protobuf_c/third_party/utf8_range/range2-sse.c +170 -0
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.h +21 -0
- data/ext/google/protobuf_c/wrap_memcpy.c +4 -3
- data/lib/google/protobuf/any_pb.rb +26 -5
- data/lib/google/protobuf/api_pb.rb +31 -25
- data/lib/google/protobuf/descriptor_dsl.rb +465 -0
- data/lib/google/protobuf/descriptor_pb.rb +75 -0
- data/lib/google/protobuf/duration_pb.rb +26 -5
- data/lib/google/protobuf/empty_pb.rb +26 -3
- data/lib/google/protobuf/field_mask_pb.rb +26 -4
- data/lib/google/protobuf/message_exts.rb +9 -4
- data/lib/google/protobuf/plugin_pb.rb +47 -0
- data/lib/google/protobuf/repeated_field.rb +17 -4
- data/lib/google/protobuf/source_context_pb.rb +26 -4
- data/lib/google/protobuf/struct_pb.rb +28 -22
- data/lib/google/protobuf/timestamp_pb.rb +26 -5
- data/lib/google/protobuf/type_pb.rb +37 -76
- data/lib/google/protobuf/well_known_types.rb +32 -4
- data/lib/google/protobuf/wrappers_pb.rb +35 -37
- data/lib/google/protobuf.rb +11 -8
- metadata +29 -37
- data/ext/google/protobuf_c/encode_decode.c +0 -1307
- data/ext/google/protobuf_c/storage.c +0 -904
- data/ext/google/protobuf_c/upb.c +0 -14913
- data/ext/google/protobuf_c/upb.h +0 -8969
- data/tests/basic.rb +0 -1403
- data/tests/generated_code_test.rb +0 -19
- data/tests/stress.rb +0 -38
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
|
3
|
-
# generated_code.rb is in the same directory as this test.
|
4
|
-
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
|
5
|
-
|
6
|
-
require 'generated_code_pb'
|
7
|
-
require 'test_import_pb'
|
8
|
-
require 'test/unit'
|
9
|
-
|
10
|
-
class GeneratedCodeTest < Test::Unit::TestCase
|
11
|
-
def test_generated_msg
|
12
|
-
# just test that we can instantiate the message. The purpose of this test
|
13
|
-
# is to ensure that the output of the code generator is valid Ruby and
|
14
|
-
# successfully creates message definitions and classes, not to test every
|
15
|
-
# aspect of the extension (basic.rb is for that).
|
16
|
-
m = A::B::C::TestMessage.new()
|
17
|
-
m2 = FooBar::TestImportedMessage.new()
|
18
|
-
end
|
19
|
-
end
|
data/tests/stress.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
|
3
|
-
require 'google/protobuf'
|
4
|
-
require 'test/unit'
|
5
|
-
|
6
|
-
module StressTest
|
7
|
-
pool = Google::Protobuf::DescriptorPool.new
|
8
|
-
pool.build do
|
9
|
-
add_message "TestMessage" do
|
10
|
-
optional :a, :int32, 1
|
11
|
-
repeated :b, :message, 2, "M"
|
12
|
-
end
|
13
|
-
add_message "M" do
|
14
|
-
optional :foo, :string, 1
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
TestMessage = pool.lookup("TestMessage").msgclass
|
19
|
-
M = pool.lookup("M").msgclass
|
20
|
-
|
21
|
-
class StressTest < Test::Unit::TestCase
|
22
|
-
def get_msg
|
23
|
-
TestMessage.new(:a => 1000,
|
24
|
-
:b => [M.new(:foo => "hello"),
|
25
|
-
M.new(:foo => "world")])
|
26
|
-
end
|
27
|
-
def test_stress
|
28
|
-
m = get_msg
|
29
|
-
data = TestMessage.encode(m)
|
30
|
-
100_000.times do
|
31
|
-
mnew = TestMessage.decode(data)
|
32
|
-
mnew = mnew.dup
|
33
|
-
assert_equal mnew.inspect, m.inspect
|
34
|
-
assert TestMessage.encode(mnew) == data
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|