mirror of
https://github.com/restic/restic.git
synced 2026-08-03 20:52:16 +00:00
+6
-3
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user