summaryrefslogtreecommitdiff
path: root/test/dbm
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-19 08:33:01 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-19 08:33:01 +0000
commit1efa14169ac0b3f55b9026985095ca256c1315e9 (patch)
tree85e761c7cb469a6fc28ef166604a24bc243e29f2 /test/dbm
parent460bb8a829904476bd8b8006f0274499d23b991a (diff)
add assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dbm')
-rw-r--r--test/dbm/test_dbm.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
index 6bc63bc..b872623 100644
--- a/test/dbm/test_dbm.rb
+++ b/test/dbm/test_dbm.rb
@@ -110,6 +110,8 @@ if defined? DBM
assert(File.zero?(dirname))
when /\bGDBM\b/
assert_equal(%w[.dir .pag], suffixes)
+ assert(!File.zero?(pagname))
+ assert(!File.zero?(dirname))
pag = File.binread(pagname, 16)
pag_magics = [
0x13579ace, # GDBM_OMAGIC
@@ -124,11 +126,14 @@ if defined? DBM
end
when /\bBerkeley DB\b/
assert_equal(%w[.db], suffixes)
+ assert(!File.zero?(dbname))
db = File.binread(dbname, 16)
assert(db[0,4].unpack("N") == [0x00061561] || # Berkeley DB 1
db[12,4].unpack("L") == [0x00061561]) # Berkeley DBM 2 or later.
when /\bQDBM\b/
assert_equal(%w[.dir .pag], suffixes)
+ assert(!File.zero?(pagname))
+ assert(!File.zero?(dirname))
dir = File.binread(dirname, 16)
assert_equal("[depot]\0\v", dir[0, 9])
pag = File.binread(pagname, 16)