[前][次][番号順一覧][スレッド一覧]

ruby-changes:34974

From: nagachika <ko1@a...>
Date: Mon, 4 Aug 2014 01:43:45 +0900 (JST)
Subject: [ruby-changes:34974] nagachika:r47056 (ruby_2_1): merge revision(s) r46585, r46595, r46822: [Backport #9977] [Backport #9978] [Backport #9983]

nagachika	2014-08-04 01:43:29 +0900 (Mon, 04 Aug 2014)

  New Revision: 47056

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47056

  Log:
    merge revision(s) r46585,r46595,r46822: [Backport #9977] [Backport #9978] [Backport #9983]
    
    test_env.rb: rehearsal
    
    * test/ruby/test_env.rb (test_memory_leak_{aset,select,shift}):
      have a rehearsal before the main loop.

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/test/ruby/test_env.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 47055)
+++ ruby_2_1/version.h	(revision 47056)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
 #define RUBY_RELEASE_DATE "2014-08-04"
-#define RUBY_PATCHLEVEL 194
+#define RUBY_PATCHLEVEL 195
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 8
Index: ruby_2_1/test/ruby/test_env.rb
===================================================================
--- ruby_2_1/test/ruby/test_env.rb	(revision 47055)
+++ ruby_2_1/test/ruby/test_env.rb	(revision 47056)
@@ -410,37 +410,45 @@ class TestEnv < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_env.rb#L410
     end
   end
 
-  def test_memory_leak_aset
-    bug9977 = '[ruby-dev:48323] [Bug #9977]'
-    assert_no_memory_leak([], <<-'end;', "5_000.times {ENV[k] = v}", bug9977)
-      ENV.clear
-      k = 'FOO'
-      v = (ENV[k] = 'bar'*5000 rescue 'bar'*1500)
-    end;
-  end
+  if RUBY_PLATFORM =~ /bccwin|mswin|mingw/
+    def test_memory_leak_aset
+      bug9977 = '[ruby-dev:48323] [Bug #9977]'
+      assert_no_memory_leak([], <<-'end;', "5_000.times(&doit)", bug9977, limit: 2.0)
+        ENV.clear
+        k = 'FOO'
+        v = (ENV[k] = 'bar'*5000 rescue 'bar'*1500)
+        doit = proc {ENV[k] = v}
+        500.times(&doit)
+      end;
+    end
 
-  def test_memory_leak_select
-    bug9978 = '[ruby-dev:48325] [Bug #9978]'
-    assert_no_memory_leak([], <<-'end;', "5_000.times {ENV.select {break}}", bug9978)
-      ENV.clear
-      k = 'FOO'
-      (ENV[k] = 'bar'*5000 rescue 'bar'*1500)
-    end;
-  end
+    def test_memory_leak_select
+      bug9978 = '[ruby-dev:48325] [Bug #9978]'
+      assert_no_memory_leak([], <<-'end;', "5_000.times(&doit)", bug9978, limit: 2.0)
+        ENV.clear
+        k = 'FOO'
+        (ENV[k] = 'bar'*5000 rescue 'bar'*1500)
+        doit = proc {ENV.select {break}}
+        500.times(&doit)
+      end;
+    end
 
-  def test_memory_crash_select
-    assert_normal_exit(<<-'end;')
-      1000.times {ENV["FOO#{i}"] = 'bar'}
-      ENV.select {ENV.clear}
-    end;
-  end
+    def test_memory_crash_select
+      assert_normal_exit(<<-'end;')
+        1000.times {ENV["FOO#{i}"] = 'bar'}
+        ENV.select {ENV.clear}
+      end;
+    end
 
-  def test_memory_leak_shift
-    bug9983 = '[ruby-dev:48332] [Bug #9983]'
-    assert_no_memory_leak([], <<-'end;', "5_000.times {ENV.shift; ENV[k] = v}", bug9983)
-      ENV.clear
-      k = 'FOO'
-      v = (ENV[k] = 'bar'*5000 rescue 'bar'*1500)
-    end;
+    def test_memory_leak_shift
+      bug9983 = '[ruby-dev:48332] [Bug #9983]'
+      assert_no_memory_leak([], <<-'end;', "5_000.times(&doit)", bug9983, limit: 2.0)
+        ENV.clear
+        k = 'FOO'
+        v = (ENV[k] = 'bar'*5000 rescue 'bar'*1500)
+        doit = proc {ENV[k] = v; ENV.shift}
+        500.times(&doit)
+      end;
+    end
   end
 end

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r46585,46595,46822


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]