Add scan percentages (fixes #1030)
This commit is contained in:
@@ -149,8 +149,9 @@ func TestVerify(t *testing.T) {
|
||||
// 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")
|
||||
buf := bytes.NewBuffer(data)
|
||||
var progress uint64
|
||||
|
||||
blocks, err := Blocks(buf, blocksize, 0)
|
||||
blocks, err := Blocks(buf, blocksize, 0, &progress)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -158,6 +159,10 @@ func TestVerify(t *testing.T) {
|
||||
t.Fatalf("Incorrect number of blocks %d != %d", len(blocks), exp)
|
||||
}
|
||||
|
||||
if uint64(len(data)) != progress {
|
||||
t.Fatalf("Incorrect counter value %d != %d", len(data), progress)
|
||||
}
|
||||
|
||||
buf = bytes.NewBuffer(data)
|
||||
err = Verify(buf, blocksize, blocks)
|
||||
t.Log(err)
|
||||
|
||||
Reference in New Issue
Block a user