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

ruby-changes:45805

From: naruse <ko1@a...>
Date: Sun, 12 Mar 2017 03:16:18 +0900 (JST)
Subject: [ruby-changes:45805] naruse:r57878 (ruby_2_4): merge revision(s) 57437:

naruse	2017-03-12 03:16:14 +0900 (Sun, 12 Mar 2017)

  New Revision: 57878

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

  Log:
    merge revision(s) 57437:
    
    leakchecker.rb: get rid of uninitialized Tempfile
    
    * test/lib/leakchecker.rb (LeakChecker#find_tempfiles): get rid of
      errors on uninitialized Tempfile, which can be left when
      Dir.tmpdir failed or by Tempfile.allocate.

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/test/lib/leakchecker.rb
    branches/ruby_2_4/test/test_tempfile.rb
    branches/ruby_2_4/version.h
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 57877)
+++ ruby_2_4/version.h	(revision 57878)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.0"
 #define RUBY_RELEASE_DATE "2017-03-12"
-#define RUBY_PATCHLEVEL 43
+#define RUBY_PATCHLEVEL 44
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_4/test/test_tempfile.rb
===================================================================
--- ruby_2_4/test/test_tempfile.rb	(revision 57877)
+++ ruby_2_4/test/test_tempfile.rb	(revision 57878)
@@ -20,6 +20,10 @@ class TestTempfile < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/test_tempfile.rb#L20
     end
   end
 
+  def test_leackchecker
+    assert_instance_of(Tempfile, Tempfile.allocate)
+  end
+
   def test_basic
     t = tempfile("foo")
     path = t.path
Index: ruby_2_4/test/lib/leakchecker.rb
===================================================================
--- ruby_2_4/test/lib/leakchecker.rb	(revision 57877)
+++ ruby_2_4/test/lib/leakchecker.rb	(revision 57878)
@@ -114,7 +114,9 @@ class LeakChecker https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/lib/leakchecker.rb#L114
     if prev_count == count
       [prev_count, []]
     else
-      tempfiles = ObjectSpace.each_object(Tempfile).find_all {|t| t.path }
+      tempfiles = ObjectSpace.each_object(Tempfile).find_all {|t|
+        t.instance_variable_defined?(:@tmpfile) and t.path
+      }
       [count, tempfiles]
     end
   end

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r57437


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

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