google-protobuf 3.0.0.alpha.1.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.

data/tests/stress.rb ADDED
@@ -0,0 +1,38 @@
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 mnew.inspect == m.inspect
34
+ assert TestMessage.encode(mnew) == data
35
+ end
36
+ end
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-protobuf
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0.alpha.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Protobuf Authors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Protocol Buffers are Google's data interchange format.
14
+ email: protobuf@googlegroups.com
15
+ executables: []
16
+ extensions:
17
+ - ext/google/protobuf_c/extconf.rb
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ext/google/protobuf_c/defs.c
21
+ - ext/google/protobuf_c/encode_decode.c
22
+ - ext/google/protobuf_c/extconf.rb
23
+ - ext/google/protobuf_c/message.c
24
+ - ext/google/protobuf_c/protobuf.c
25
+ - ext/google/protobuf_c/protobuf.h
26
+ - ext/google/protobuf_c/repeated_field.c
27
+ - ext/google/protobuf_c/storage.c
28
+ - ext/google/protobuf_c/upb.c
29
+ - ext/google/protobuf_c/upb.h
30
+ - lib/google/protobuf.rb
31
+ - tests/basic.rb
32
+ - tests/stress.rb
33
+ homepage:
34
+ licenses:
35
+ - BSD
36
+ metadata: {}
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ! '>'
49
+ - !ruby/object:Gem::Version
50
+ version: 1.3.1
51
+ requirements: []
52
+ rubyforge_project:
53
+ rubygems_version: 2.4.5
54
+ signing_key:
55
+ specification_version: 4
56
+ summary: Protocol Buffers
57
+ test_files:
58
+ - tests/basic.rb
59
+ - tests/stress.rb