* test/ruby/test_process.rb (test_setsid): call Process.getsid for

child process in child process. because parent process call
  Process.getsid with io.pid, Errno::ESRCH could be raised.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2012-11-25 16:59:07 +00:00
parent 56132b1346
commit 997518c677
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Mon Nov 26 01:54:26 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
* test/ruby/test_process.rb (test_setsid): call Process.getsid for
child process in child process. because parent process call
Process.getsid with io.pid, Errno::ESRCH could be raised.
Sun Nov 25 22:34:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com> Sun Nov 25 22:34:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
* array.c (ary_resize_smaller): new function to resize array. * array.c (ary_resize_smaller): new function to resize array.

View File

@ -1566,11 +1566,13 @@ class TestProcess < Test::Unit::TestCase
Marshal.dump(Process.getsid, STDOUT) Marshal.dump(Process.getsid, STDOUT)
newsid = Process.setsid newsid = Process.setsid
Marshal.dump(newsid, STDOUT) Marshal.dump(newsid, STDOUT)
Marshal.dump(Process.getsid($$), STDOUT)
STDOUT.flush STDOUT.flush
EOS EOS
assert_equal(Marshal.load(io), Process.getsid) assert_equal(Marshal.load(io), Process.getsid)
assert_equal(Marshal.load(io), Process.getsid(io.pid)) newsid = Marshal.load(io)
getsid = Marshal.load(io)
assert_equal(newsid, getsid)
end end
end end
end end