mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
460bb8a829
commit
1efa14169a
1 changed files with 5 additions and 0 deletions
|
@ -110,6 +110,8 @@ if defined? DBM
|
||||||
assert(File.zero?(dirname))
|
assert(File.zero?(dirname))
|
||||||
when /\bGDBM\b/
|
when /\bGDBM\b/
|
||||||
assert_equal(%w[.dir .pag], suffixes)
|
assert_equal(%w[.dir .pag], suffixes)
|
||||||
|
assert(!File.zero?(pagname))
|
||||||
|
assert(!File.zero?(dirname))
|
||||||
pag = File.binread(pagname, 16)
|
pag = File.binread(pagname, 16)
|
||||||
pag_magics = [
|
pag_magics = [
|
||||||
0x13579ace, # GDBM_OMAGIC
|
0x13579ace, # GDBM_OMAGIC
|
||||||
|
@ -124,11 +126,14 @@ if defined? DBM
|
||||||
end
|
end
|
||||||
when /\bBerkeley DB\b/
|
when /\bBerkeley DB\b/
|
||||||
assert_equal(%w[.db], suffixes)
|
assert_equal(%w[.db], suffixes)
|
||||||
|
assert(!File.zero?(dbname))
|
||||||
db = File.binread(dbname, 16)
|
db = File.binread(dbname, 16)
|
||||||
assert(db[0,4].unpack("N") == [0x00061561] || # Berkeley DB 1
|
assert(db[0,4].unpack("N") == [0x00061561] || # Berkeley DB 1
|
||||||
db[12,4].unpack("L") == [0x00061561]) # Berkeley DBM 2 or later.
|
db[12,4].unpack("L") == [0x00061561]) # Berkeley DBM 2 or later.
|
||||||
when /\bQDBM\b/
|
when /\bQDBM\b/
|
||||||
assert_equal(%w[.dir .pag], suffixes)
|
assert_equal(%w[.dir .pag], suffixes)
|
||||||
|
assert(!File.zero?(pagname))
|
||||||
|
assert(!File.zero?(dirname))
|
||||||
dir = File.binread(dirname, 16)
|
dir = File.binread(dirname, 16)
|
||||||
assert_equal("[depot]\0\v", dir[0, 9])
|
assert_equal("[depot]\0\v", dir[0, 9])
|
||||||
pag = File.binread(pagname, 16)
|
pag = File.binread(pagname, 16)
|
||||||
|
|
Loading…
Add table
Reference in a new issue