aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/protobuf/ruby/tests/stress.rb
diff options
context:
space:
mode:
authorGravatar Jakob Buchgraber <buchgr@google.com>2017-04-13 15:08:11 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-04-13 15:08:11 +0200
commitd90737372d370d920e390aff6138dbc2aec2f3b1 (patch)
treee3915abfd4d8f42b3d184f3104a7d6b484bfe181 /third_party/protobuf/ruby/tests/stress.rb
parentea82aa115794b019472b44d4f94ed902c1217f30 (diff)
Revert "protobuf: Update protobuf to @laszlocsomor's master at commit 421d909."
Diffstat (limited to 'third_party/protobuf/ruby/tests/stress.rb')
-rw-r--r--third_party/protobuf/ruby/tests/stress.rb38
1 files changed, 0 insertions, 38 deletions
diff --git a/third_party/protobuf/ruby/tests/stress.rb b/third_party/protobuf/ruby/tests/stress.rb
deleted file mode 100644
index 082d5e22df..0000000000
--- a/third_party/protobuf/ruby/tests/stress.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/ruby
-
-require 'google/protobuf'
-require 'test/unit'
-
-module StressTest
- pool = Google::Protobuf::DescriptorPool.new
- pool.build do
- add_message "TestMessage" do
- optional :a, :int32, 1
- repeated :b, :message, 2, "M"
- end
- add_message "M" do
- optional :foo, :string, 1
- end
- end
-
- TestMessage = pool.lookup("TestMessage").msgclass
- M = pool.lookup("M").msgclass
-
- class StressTest < Test::Unit::TestCase
- def get_msg
- TestMessage.new(:a => 1000,
- :b => [M.new(:foo => "hello"),
- M.new(:foo => "world")])
- end
- def test_stress
- m = get_msg
- data = TestMessage.encode(m)
- 100_000.times do
- mnew = TestMessage.decode(data)
- mnew = mnew.dup
- assert_equal mnew.inspect, m.inspect
- assert TestMessage.encode(mnew) == data
- end
- end
- end
-end