diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-12 15:12:52 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-12 15:12:52 +0000 |
commit | 5bade2cb14bc0e19960b648858710b4cffe1d5c5 (patch) | |
tree | 4b0c579ef7955530c3958b31df99d0191f6e8319 /test/dbm | |
parent | 94b2ef352b84064d7745bb786e65a5ef4822b561 (diff) | |
download | ruby-5bade2cb14bc0e19960b648858710b4cffe1d5c5.tar.gz ruby-5bade2cb14bc0e19960b648858710b4cffe1d5c5.tar.xz ruby-5bade2cb14bc0e19960b648858710b4cffe1d5c5.zip |
* test/dbm/test_dbm.rb: remove locking test, which may not be
supported on some platforms. [ruby-dev:27030]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dbm')
-rw-r--r-- | test/dbm/test_dbm.rb | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb index c7ca50cd0..0a604e50e 100644 --- a/test/dbm/test_dbm.rb +++ b/test/dbm/test_dbm.rb @@ -85,83 +85,6 @@ if defined? DBM def test_s_open_with_block assert_equal(DBM.open("tmptest_dbm") { :foo }, :foo) end - def test_s_open_lock - return unless have_fork? # snip this test - pid = fork() { - assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644)) - sleep 2 - } - begin - sleep 1 - assert_raise(Errno::EWOULDBLOCK, "NEVER MIND IF YOU USE Berkeley DB3") { - begin - assert_instance_of(DBM, dbm2 = DBM.open("tmptest_dbm", 0644)) - rescue Errno::EAGAIN, Errno::EACCES, Errno::EINVAL - raise Errno::EWOULDBLOCK - end - } - ensure - Process.wait pid - end - end - -=begin - # Is it guaranteed on many OS? - def test_s_open_lock_one_process - # locking on one process - assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644)) - assert_raise(Errno::EWOULDBLOCK) { - begin - DBM.open("tmptest_dbm", 0644) - rescue Errno::EAGAIN - raise Errno::EWOULDBLOCK - end - } - end -=end - - def test_s_open_nolock - # dbm 1.8.0 specific - if not defined? DBM::NOLOCK - return - end - return unless have_fork? # snip this test - - pid = fork() { - assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644, - DBM::NOLOCK)) - sleep 2 - } - sleep 1 - begin - dbm2 = nil - assert_no_exception(Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EACCES) { - assert_instance_of(DBM, dbm2 = DBM.open("tmptest_dbm", 0644)) - } - ensure - Process.wait pid - dbm2.close if dbm2 - end - - p Dir.glob("tmptest_dbm*") if $DEBUG - - pid = fork() { - assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644)) - sleep 2 - } - begin - sleep 1 - dbm2 = nil - assert_no_exception(Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EACCES) { - # this test is failed on Cygwin98 (???) - assert_instance_of(DBM, dbm2 = DBM.open("tmptest_dbm", 0644, - DBM::NOLOCK)) - } - ensure - Process.wait pid - dbm2.close if dbm2 - end - end def test_s_open_error assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0)) |