lib/model: setUp -> setup (#5573)

This commit is contained in:
Simon Frei 2019-03-04 13:27:10 +01:00 committed by Audrius Butkevicius
parent 43bcb3d5a5
commit d6622b1f68

View File

@ -62,7 +62,7 @@ var diffTestData = []struct {
{"cont", "contents", 3, []protocol.BlockInfo{{Offset: 3, Size: 3}, {Offset: 6, Size: 2}}},
}
func setUpFile(filename string, blockNumbers []int) protocol.FileInfo {
func setupFile(filename string, blockNumbers []int) protocol.FileInfo {
// Create existing file
existingBlocks := make([]protocol.BlockInfo, len(blockNumbers))
for i := range blockNumbers {
@ -118,7 +118,7 @@ func TestHandleFile(t *testing.T) {
// Pull: 1, 3, 4, 6, 7
existingBlocks := []int{0, 2, 0, 0, 5, 0, 0, 8}
existingFile := setUpFile("filex", existingBlocks)
existingFile := setupFile("filex", existingBlocks)
requiredFile := existingFile
requiredFile.Blocks = blocks[1:]
@ -164,7 +164,7 @@ func TestHandleFileWithTemp(t *testing.T) {
// Pull: 1, 6
existingBlocks := []int{0, 2, 0, 0, 5, 0, 0, 8}
existingFile := setUpFile("file", existingBlocks)
existingFile := setupFile("file", existingBlocks)
requiredFile := existingFile
requiredFile.Blocks = blocks[1:]
@ -216,7 +216,7 @@ func TestCopierFinder(t *testing.T) {
tempFile := fs.TempName("file2")
existingBlocks := []int{0, 2, 3, 4, 0, 0, 7, 0}
existingFile := setUpFile(fs.TempName("file"), existingBlocks)
existingFile := setupFile(fs.TempName("file"), existingBlocks)
requiredFile := existingFile
requiredFile.Blocks = blocks[1:]
requiredFile.Name = "file2"
@ -418,7 +418,7 @@ func TestCopierCleanup(t *testing.T) {
}
// Create a file
file := setUpFile("test", []int{0})
file := setupFile("test", []int{0})
m, _, tmpDir := setupSendReceiveFolder(file)
defer func() {
os.Remove(m.cfg.ConfigPath())
@ -453,7 +453,7 @@ func TestCopierCleanup(t *testing.T) {
}
func TestDeregisterOnFailInCopy(t *testing.T) {
file := setUpFile("filex", []int{0, 2, 0, 0, 5, 0, 0, 8})
file := setupFile("filex", []int{0, 2, 0, 0, 5, 0, 0, 8})
m, f, tmpDir := setupSendReceiveFolder()
defer func() {
@ -543,7 +543,7 @@ func TestDeregisterOnFailInCopy(t *testing.T) {
}
func TestDeregisterOnFailInPull(t *testing.T) {
file := setUpFile("filex", []int{0, 2, 0, 0, 5, 0, 0, 8})
file := setupFile("filex", []int{0, 2, 0, 0, 5, 0, 0, 8})
m, f, tmpDir := setupSendReceiveFolder()
defer func() {