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

ruby-changes:19810

From: usa <ko1@a...>
Date: Tue, 31 May 2011 12:43:46 +0900 (JST)
Subject: [ruby-changes:19810] usa:r31855 (trunk): * test/ruby/test_io.rb (TestIO#test_open_mode): MUST release resources

usa	2011-05-31 12:43:39 +0900 (Tue, 31 May 2011)

  New Revision: 31855

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

  Log:
    * test/ruby/test_io.rb (TestIO#test_open_mode): MUST release resources
      explicitly. fix problem of r31671

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_io.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31854)
+++ ChangeLog	(revision 31855)
@@ -1,3 +1,8 @@
+Tue May 31 12:40:49 2011  NAKAMURA Usaku  <usa@r...>
+
+	* test/ruby/test_io.rb (TestIO#test_open_mode): MUST release resources
+	  explicitly. fix problem of r31671
+
 Tue May 31 10:49:55 2011  NARUSE, Yui  <naruse@r...>
 
 	* vm_exec.c: remove conditions for clang
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 31854)
+++ test/ruby/test_io.rb	(revision 31855)
@@ -1854,10 +1854,14 @@
     feature4742 = "[ruby-core:36338]"
 
     mkcdtmpdir do
-      refute_nil(File.open('symbolic', 'w'))
-      refute_nil(File.open('numeric',  File::WRONLY|File::TRUNC|File::CREAT))
-      refute_nil(File.open('hash-symbolic', :mode => 'w'))
-      refute_nil(File.open('hash-numeric', :mode => File::WRONLY|File::TRUNC|File::CREAT), feature4742)
+      refute_nil(f = File.open('symbolic', 'w'))
+      f.close
+      refute_nil(f = File.open('numeric',  File::WRONLY|File::TRUNC|File::CREAT))
+      f.close
+      refute_nil(f = File.open('hash-symbolic', :mode => 'w'))
+      f.close
+      refute_nil(f = File.open('hash-numeric', :mode => File::WRONLY|File::TRUNC|File::CREAT), feature4742)
+      f.close
     end
   end
 

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

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