Fix tests
This commit is contained in:
parent
8b759d0e1e
commit
aa853ac833
@ -153,9 +153,10 @@ func TestVerify(t *testing.T) {
|
|||||||
// data should be an even multiple of blocksize long
|
// data should be an even multiple of blocksize long
|
||||||
data := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut e")
|
data := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut e")
|
||||||
buf := bytes.NewBuffer(data)
|
buf := bytes.NewBuffer(data)
|
||||||
var progress int64
|
progress := newByteCounter()
|
||||||
|
defer progress.Close()
|
||||||
|
|
||||||
blocks, err := Blocks(buf, blocksize, 0, &progress)
|
blocks, err := Blocks(buf, blocksize, 0, progress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -163,8 +164,8 @@ func TestVerify(t *testing.T) {
|
|||||||
t.Fatalf("Incorrect number of blocks %d != %d", len(blocks), exp)
|
t.Fatalf("Incorrect number of blocks %d != %d", len(blocks), exp)
|
||||||
}
|
}
|
||||||
|
|
||||||
if int64(len(data)) != progress {
|
if int64(len(data)) != progress.Total() {
|
||||||
t.Fatalf("Incorrect counter value %d != %d", len(data), progress)
|
t.Fatalf("Incorrect counter value %d != %d", len(data), progress.Total())
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = bytes.NewBuffer(data)
|
buf = bytes.NewBuffer(data)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user