diff options
Diffstat (limited to 'lib/model/requests_test.go')
-rw-r--r-- | lib/model/requests_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/model/requests_test.go b/lib/model/requests_test.go index eaeb73af0..fba7fde43 100644 --- a/lib/model/requests_test.go +++ b/lib/model/requests_test.go @@ -107,7 +107,7 @@ func TestSymlinkTraversalRead(t *testing.T) { <-done // Request a file by traversing the symlink - res, err := m.Request(device1Conn, "default", "symlink/requests_test.go", 0, 10, 0, nil, 0, false) + res, err := m.Request(device1Conn, &protocol.Request{Folder: "default", Name: "symlink/requests_test.go", Size: 10}) if err == nil || res != nil { t.Error("Managed to traverse symlink") } @@ -440,7 +440,7 @@ func TestRescanIfHaveInvalidContent(t *testing.T) { t.Fatalf("unexpected weak hash: %d != 103547413", f.Blocks[0].WeakHash) } - res, err := m.Request(device1Conn, "default", "foo", 0, int32(len(payload)), 0, f.Blocks[0].Hash, f.Blocks[0].WeakHash, false) + res, err := m.Request(device1Conn, &protocol.Request{Folder: "default", Name: "foo", Size: len(payload), Hash: f.Blocks[0].Hash, WeakHash: f.Blocks[0].WeakHash}) if err != nil { t.Fatal(err) } @@ -454,7 +454,7 @@ func TestRescanIfHaveInvalidContent(t *testing.T) { writeFile(t, tfs, "foo", payload) - _, err = m.Request(device1Conn, "default", "foo", 0, int32(len(payload)), 0, f.Blocks[0].Hash, f.Blocks[0].WeakHash, false) + _, err = m.Request(device1Conn, &protocol.Request{Folder: "default", Name: "foo", Size: len(payload), Hash: f.Blocks[0].Hash, WeakHash: f.Blocks[0].WeakHash}) if err == nil { t.Fatalf("expected failure") } @@ -1190,7 +1190,7 @@ func TestRequestIndexSenderPause(t *testing.T) { // Folder removed on remote - cc = protocol.ClusterConfig{} + cc = &protocol.ClusterConfig{} m.ClusterConfig(fc, cc) seq++ @@ -1305,7 +1305,7 @@ func TestRequestReceiveEncrypted(t *testing.T) { return nil }) m.AddConnection(fc, protocol.Hello{}) - m.ClusterConfig(fc, protocol.ClusterConfig{ + m.ClusterConfig(fc, &protocol.ClusterConfig{ Folders: []protocol.Folder{ { ID: "default", @@ -1355,7 +1355,7 @@ func TestRequestReceiveEncrypted(t *testing.T) { } // Simulate request from device that is untrusted too, i.e. with non-empty, but garbage hash - _, err := m.Request(fc, fcfg.ID, name, 0, 1064, 0, []byte("garbage"), 0, false) + _, err := m.Request(fc, &protocol.Request{Folder: fcfg.ID, Name: name, Size: 1064, Hash: []byte("garbage")}) must(t, err) changed, err := m.LocalChangedFolderFiles(fcfg.ID, 1, 10) @@ -1406,7 +1406,7 @@ func TestRequestGlobalInvalidToValid(t *testing.T) { file := fc.files[0] fc.mut.Unlock() file.SetIgnored() - m.IndexUpdate(conn, fcfg.ID, []protocol.FileInfo{prepareFileInfoForIndex(file)}) + m.IndexUpdate(conn, &protocol.IndexUpdate{Folder: fcfg.ID, Files: []protocol.FileInfo{prepareFileInfoForIndex(file)}}) // Wait for the ignored file to be received and possible pulled timeout := time.After(10 * time.Second) |