diff --git a/fileTransfer/manager_test.go b/fileTransfer/manager_test.go index c5ebcac3887b068ad05fd8fc4a1f4059892b4255..63952f154487962fc6e504c56d58f6d0d00cda02 100644 --- a/fileTransfer/manager_test.go +++ b/fileTransfer/manager_test.go @@ -394,7 +394,7 @@ func TestManager_CloseSend_NoFingerprints(t *testing.T) { transfer, _ := m.sent.GetTransfer(sti[0].tid) for fpNum := uint16(0); fpNum < sti[0].numFps; fpNum++ { partNum := fpNum % sti[0].numParts - _, _, _, err := transfer.GetEncryptedPart(partNum, partSize) + _, _, _, err := transfer.GetEncryptedPart(partNum, partSize+2) if err != nil { t.Errorf("Failed to encrypt part %d (%d): %+v", partNum, fpNum, err) } diff --git a/storage/fileTransfer/receiveFileTransfers_test.go b/storage/fileTransfer/receiveFileTransfers_test.go index 1bbbbd826c3f65142143ab4186400d559fe45bd7..4fd245ec4d902d99f8389a8a4a1a6393c95d1432 100644 --- a/storage/fileTransfer/receiveFileTransfers_test.go +++ b/storage/fileTransfer/receiveFileTransfers_test.go @@ -385,9 +385,9 @@ func TestReceivedFileTransfersStore_AddPart(t *testing.T) { // Check that the correct part was stored receivedPart := expectedRT.receivedParts.parts[partNum] - if !bytes.Equal(receivedPart, expectedData) { + if !bytes.Equal(receivedPart[:len(expectedData)], expectedData) { t.Errorf("Part in memory is not expected."+ - "\nexpected: %q\nreceived: %q", expectedData, receivedPart) + "\nexpected: %q\nreceived: %q", expectedData, receivedPart[:len(expectedData)]) } } diff --git a/storage/fileTransfer/receiveTransfer_test.go b/storage/fileTransfer/receiveTransfer_test.go index ff5c47ce5effe05a4069e3196b7be8c26880c7d5..281bb373822ee0642a6c02c07c814d402cd3d174 100644 --- a/storage/fileTransfer/receiveTransfer_test.go +++ b/storage/fileTransfer/receiveTransfer_test.go @@ -569,9 +569,9 @@ func TestReceivedTransfer_AddPart(t *testing.T) { receivedData, exists := rt.receivedParts.parts[partNum] if !exists { t.Errorf("Part #%d not found in part map.", partNum) - } else if !bytes.Equal(expectedData, receivedData) { + } else if !bytes.Equal(expectedData, receivedData[:len(expectedData)]) { t.Fatalf("Part data in list does not match expected."+ - "\nexpected: %+v\nreceived: %+v", expectedData, receivedData) + "\nexpected: %+v\nreceived: %+v", expectedData, receivedData[:len(expectedData)]) } // Check that the fingerprint vector has correct values