1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

dbm/test_dbm.rb: specify pid for Process.wait.

gdbm/test_gdbm.rb: ditto.
sdbm/test_sdbm.rb: ditto.

dbm/test_dbm.rb: add tests for open when db is not exist.
gdbm/test_gdbm.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2005-08-12 15:53:06 +00:00
parent 66323da355
commit 2b5bb9ad00
3 changed files with 66 additions and 18 deletions

View file

@ -81,7 +81,7 @@ class TestSDBM < Test::Unit::TestCase
end
return unless have_fork? # snip this test
fork() {
pid = fork() {
assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644,
SDBM::NOLOCK))
sleep 2
@ -93,13 +93,13 @@ class TestSDBM < Test::Unit::TestCase
assert_instance_of(SDBM, sdbm2 = SDBM.open("tmptest_sdbm", 0644))
}
ensure
Process.wait
Process.wait pid
sdbm2.close if sdbm2
end
p Dir.glob("tmptest_sdbm*") if $DEBUG
fork() {
pid = fork() {
assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644))
sleep 2
}
@ -112,7 +112,7 @@ class TestSDBM < Test::Unit::TestCase
SDBM::NOLOCK))
}
ensure
Process.wait
Process.wait pid
sdbm2.close if sdbm2
end
end