зеркало из https://github.com/github/ruby.git
* test/ruby/test_io.rb (test_flush_in_finalizer1): Use
ObjectSpace.each_object to close files. GC.start is not reliable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
58a6412754
Коммит
a7b1cfbb99
|
@ -1,3 +1,9 @@
|
|||
Wed May 28 23:04:35 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/ruby/test_io.rb (test_flush_in_finalizer1): Use
|
||||
ObjectSpace.each_object to close files.
|
||||
GC.start is not reliable.
|
||||
|
||||
Wed May 28 19:00:31 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket when
|
||||
|
|
|
@ -2358,6 +2358,7 @@ End
|
|||
assert_nothing_raised(TypeError, bug3910) do
|
||||
500.times {
|
||||
f = File.open(path, "w")
|
||||
f.instance_variable_set(:@test_flush_in_finalizer1, true)
|
||||
fds << f.fileno
|
||||
f.print "hoge"
|
||||
}
|
||||
|
@ -2365,7 +2366,11 @@ End
|
|||
t
|
||||
}
|
||||
ensure
|
||||
GC.start
|
||||
ObjectSpace.each_object(File) {|f|
|
||||
if f.instance_variables.include?(:@test_flush_in_finalizer1)
|
||||
f.close
|
||||
end
|
||||
}
|
||||
t.close!
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче