summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-20 07:53:22 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-20 07:53:22 +0000
commit8f8d7c1113364b3e87600ea82760a50121a93c6f (patch)
tree4bfaa471140f6d92d43f62a3b9b3252b87abd4cd /test
parent150b98fd760faac3606cbc491372c4ce0b69ba7f (diff)
* ext/dbm/dbm.c (fdbm_closed): new method DBM#closed?
* ext/gdbm/gdbm.c (fgdbm_closed): new method GDBM#closed? * ext/sdbm/init.c (fsdbm_closed): new method SDBM#closed? * test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb (teardown): close all db objects before deleting data files. * win32/win32.{ch} (unlink): hook runtime function to change file attribute before unlinking. fixed: [ruby-dev:26360] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/dbm/test_dbm.rb4
-rw-r--r--test/gdbm/test_gdbm.rb4
-rw-r--r--test/sdbm/test_sdbm.rb4
3 files changed, 9 insertions, 3 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
index 1bf1480..53ab4c8 100644
--- a/test/dbm/test_dbm.rb
+++ b/test/dbm/test_dbm.rb
@@ -42,7 +42,9 @@ if defined? DBM
def teardown
assert_nil(@dbm.close)
assert_nil(@dbm_rdonly.close)
- GC.start
+ ObjectSpace.each_object(DBM) do |obj|
+ obj.close unless obj.closed?
+ end
File.delete *Dir.glob("tmptest_dbm*").to_a
p Dir.glob("tmptest_dbm*") if $DEBUG
end
diff --git a/test/gdbm/test_gdbm.rb b/test/gdbm/test_gdbm.rb
index 920a78c..e3f52ef 100644
--- a/test/gdbm/test_gdbm.rb
+++ b/test/gdbm/test_gdbm.rb
@@ -39,7 +39,9 @@ if defined? GDBM
def teardown
assert_nil(@gdbm.close)
assert_nil(@gdbm_rdonly.close)
- GC.start
+ ObjectSpace.each_object(GDBM) do |obj|
+ obj.close unless obj.closed?
+ end
File.delete *Dir.glob("tmptest_gdbm*").to_a
p Dir.glob("tmptest_gdbm*") if $DEBUG
end
diff --git a/test/sdbm/test_sdbm.rb b/test/sdbm/test_sdbm.rb
index 25e5371..488b37a 100644
--- a/test/sdbm/test_sdbm.rb
+++ b/test/sdbm/test_sdbm.rb
@@ -12,7 +12,9 @@ class TestSDBM < Test::Unit::TestCase
end
def teardown
assert_nil(@sdbm.close)
- GC.start
+ ObjectSpace.each_object(SDBM) do |obj|
+ obj.close unless obj.closed?
+ end
File.delete *Dir.glob("tmptest_sdbm*").to_a
p Dir.glob("tmptest_sdbm*") if $DEBUG
end