aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-27 13:49:43 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-27 13:49:43 +0000
commitdddc9485da5e96d9406f7c4e942aa253d21a12c0 (patch)
tree0abe4e5da81e0d1bed68c87dc3830a5777c93569
parent9f2b8eafdd89d351ff86b461ba0e8f1061ae210c (diff)
downloadruby-dddc9485da5e96d9406f7c4e942aa253d21a12c0.tar.gz
* test/rinda/test_rinda.rb (test_remote_array_and_hash):
add local variables to protect objects from GC. [ruby-dev:44253] [Bug #5104] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/rinda/test_rinda.rb8
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ab53b27196..0dc9fc272d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jul 27 22:46:59 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/rinda/test_rinda.rb (test_remote_array_and_hash):
+ add local variables to protect objects from GC. [ruby-dev:44253]
+ [Bug #5104]
+
Wed Jul 27 17:55:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
* include/ruby/missing.h: define __syscall if the platform has
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index b69b63ac78..e91ecf395f 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -539,9 +539,13 @@ class TupleSpaceProxyTest < Test::Unit::TestCase
end
def test_remote_array_and_hash
- @ts.write(DRbObject.new([1, 2, 3]))
+ # Don't remove ary/hsh local variables.
+ # These are necessary to protect objects from GC.
+ ary = [1, 2, 3]
+ @ts.write(DRbObject.new(ary))
assert_equal([1, 2, 3], @ts.take([1, 2, 3], 0))
- @ts.write(DRbObject.new({'head' => 1, 'tail' => 2}))
+ hsh = {'head' => 1, 'tail' => 2}
+ @ts.write(DRbObject.new(hsh))
assert_equal({'head' => 1, 'tail' => 2},
@ts.take({'head' => 1, 'tail' => 2}, 0))
end