checker: Use TestRepository

This commit is contained in:
Alexander Neumann 2017-01-24 09:23:13 +01:00
parent 31055d88a5
commit 0e445ec0f5
1 changed files with 3 additions and 8 deletions

View File

@ -9,7 +9,6 @@ import (
"restic" "restic"
"restic/archiver" "restic/archiver"
"restic/backend/mem"
"restic/checker" "restic/checker"
"restic/repository" "restic/repository"
"restic/test" "restic/test"
@ -249,19 +248,15 @@ func induceError(data []byte) {
} }
func TestCheckerModifiedData(t *testing.T) { func TestCheckerModifiedData(t *testing.T) {
be := mem.New() repo, cleanup := repository.TestRepository(t)
defer cleanup()
repository.TestUseLowSecurityKDFParameters(t)
repo := repository.New(be)
test.OK(t, repo.Init(test.TestPassword))
arch := archiver.New(repo) arch := archiver.New(repo)
_, id, err := arch.Snapshot(nil, []string{"."}, nil, nil) _, id, err := arch.Snapshot(nil, []string{"."}, nil, nil)
test.OK(t, err) test.OK(t, err)
t.Logf("archived as %v", id.Str()) t.Logf("archived as %v", id.Str())
beError := &errorBackend{Backend: be} beError := &errorBackend{Backend: repo.Backend()}
checkRepo := repository.New(beError) checkRepo := repository.New(beError)
test.OK(t, checkRepo.SearchKey(test.TestPassword, 5)) test.OK(t, checkRepo.SearchKey(test.TestPassword, 5))