Commit 0d216b9f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 98e4be92
...@@ -206,12 +206,12 @@ def test_bigfile_empty(): ...@@ -206,12 +206,12 @@ def test_bigfile_empty():
# we wrote "hello world" after hole'th block, but size is always mutiple of blksize. # we wrote "hello world" after hole'th block, but size is always mutiple of blksize.
fsize = (hole + 1)*blksize fsize = (hole + 1)*blksize
st = os.stat(fpath + "/head/data") st = os.stat(fpath)
assert st.st_size == fsize assert st.st_size == fsize
#assert st.st_mtime == tidtime(tidlast) FIXME proper sync #assert st.st_mtime == tidtime(tidlast) FIXME proper sync
assert readfile(fpath + "/head/at") == tidlast.encode("hex") assert readfile(head + "/at") == tidlast.encode("hex")
data = readfile(fpath + "/head/data") data = readfile(fpath)
assert len(data) == fsize assert len(data) == fsize
for i in range(hole): for i in range(hole):
assert data[i*blksize:(i+1)*blksize] == b'\0'*blksize assert data[i*blksize:(i+1)*blksize] == b'\0'*blksize
......
...@@ -103,6 +103,9 @@ func (zb *zBlkBase) bindZFile(zfile *ZBigFile, blk int64) { ...@@ -103,6 +103,9 @@ func (zb *zBlkBase) bindZFile(zfile *ZBigFile, blk int64) {
blkmap, ok := zb.inzfile[zfile] blkmap, ok := zb.inzfile[zfile]
if !ok { if !ok {
blkmap = make(SetI64, 1) blkmap = make(SetI64, 1)
if zb.inzfile == nil {
zb.inzfile = make(map[*ZBigFile]SetI64)
}
zb.inzfile[zfile] = blkmap zb.inzfile[zfile] = blkmap
} }
blkmap.Add(blk) blkmap.Add(blk)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment