ruby-changes:32771
From: naruse <ko1@a...>
Date: Thu, 6 Feb 2014 00:47:40 +0900 (JST)
Subject: [ruby-changes:32771] naruse:r44850 (ruby_2_1): merge revision(s) 44555:
naruse 2014-02-06 00:47:37 +0900 (Thu, 06 Feb 2014) New Revision: 44850 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44850 Log: merge revision(s) 44555: test_weakref.rb: find collected weakref * test/test_weakref.rb (test_recycled): retry and find a WeakRef whose the target is collected, to fix circumstance dependent. Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/test/test_weakref.rb branches/ruby_2_1/version.h Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 44849) +++ ruby_2_1/version.h (revision 44850) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.1" -#define RUBY_RELEASE_DATE "2014-02-05" -#define RUBY_PATCHLEVEL 23 +#define RUBY_RELEASE_DATE "2014-02-06" +#define RUBY_PATCHLEVEL 24 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 5 +#define RUBY_RELEASE_DAY 6 #include "ruby/version.h" Index: ruby_2_1/test/test_weakref.rb =================================================================== --- ruby_2_1/test/test_weakref.rb (revision 44849) +++ ruby_2_1/test/test_weakref.rb (revision 44850) @@ -19,9 +19,14 @@ class TestWeakRef < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/test_weakref.rb#L19 end def test_recycled - weak = make_weakref - ObjectSpace.garbage_collect - ObjectSpace.garbage_collect + weaks = [] + weak = nil + 100.times do + weaks << make_weakref + ObjectSpace.garbage_collect + ObjectSpace.garbage_collect + break if weak = weaks.find {|w| !w.weakref_alive?} + end assert_raise(WeakRef::RefError) {weak.to_s} assert_not_predicate(weak, :weakref_alive?) end Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r44555 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/