mirror of
https://github.com/restic/restic.git
synced 2025-12-08 06:09:56 +00:00
parent
03193e6d92
commit
92f516b1d4
3 changed files with 62 additions and 45 deletions
9
vendor/github.com/elithrar/simple-scrypt/scrypt_test.go
generated
vendored
9
vendor/github.com/elithrar/simple-scrypt/scrypt_test.go
generated
vendored
|
|
@ -114,6 +114,9 @@ func TestCalibrate(t *testing.T) {
|
|||
for testNum, tc := range []struct {
|
||||
MemMiB int
|
||||
}{
|
||||
{512},
|
||||
{256},
|
||||
{128},
|
||||
{64},
|
||||
{32},
|
||||
{16},
|
||||
|
|
@ -139,9 +142,9 @@ func TestCalibrate(t *testing.T) {
|
|||
t.Fatalf("%d. GenerateFromPassword with %#v: %v", testNum, p, err)
|
||||
}
|
||||
if dur < timeout/2 {
|
||||
t.Errorf("%d. GenerateFromPassword was too fast (wanted around %s, got %s) with %#v.", testNum, timeout, dur, p)
|
||||
} else if timeout*2 < dur {
|
||||
t.Errorf("%d. GenerateFromPassword took too long (wanted around %s, got %s) with %#v.", testNum, timeout, dur, p)
|
||||
t.Errorf("%d. GenerateFromPassword was too fast (expected between %s and %s, got %s) with %#v.", testNum, timeout/2, timeout+timeout/2, dur, p)
|
||||
} else if timeout+timeout/2 < dur {
|
||||
t.Errorf("%d. GenerateFromPassword took too long (expected between %s and %s, got %s) with %#v.", testNum, timeout/2, timeout+timeout/2, dur, p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue