From 21ffac5b1f004e5eae57eeb8d657ec931b8bf6a6 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 20 Jun 2005 07:53:22 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/dbm/test_dbm.rb | 4 +++- test/gdbm/test_gdbm.rb | 4 +++- test/sdbm/test_sdbm.rb | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb index 1bf1480a2..53ab4c83a 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 920a78c54..e3f52ef5e 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 25e537104..488b37a9a 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 -- cgit