Skip to content
Snippets Groups Projects
Commit 2bdcc4ab authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

fixed some tests

parent e87a5c66
Branches
Tags
3 merge requests!170Release,!128Xx 3678/ft cha cha20,!126Dev
...@@ -394,7 +394,7 @@ func TestManager_CloseSend_NoFingerprints(t *testing.T) { ...@@ -394,7 +394,7 @@ func TestManager_CloseSend_NoFingerprints(t *testing.T) {
transfer, _ := m.sent.GetTransfer(sti[0].tid) transfer, _ := m.sent.GetTransfer(sti[0].tid)
for fpNum := uint16(0); fpNum < sti[0].numFps; fpNum++ { for fpNum := uint16(0); fpNum < sti[0].numFps; fpNum++ {
partNum := fpNum % sti[0].numParts partNum := fpNum % sti[0].numParts
_, _, _, err := transfer.GetEncryptedPart(partNum, partSize) _, _, _, err := transfer.GetEncryptedPart(partNum, partSize+2)
if err != nil { if err != nil {
t.Errorf("Failed to encrypt part %d (%d): %+v", partNum, fpNum, err) t.Errorf("Failed to encrypt part %d (%d): %+v", partNum, fpNum, err)
} }
......
...@@ -385,9 +385,9 @@ func TestReceivedFileTransfersStore_AddPart(t *testing.T) { ...@@ -385,9 +385,9 @@ func TestReceivedFileTransfersStore_AddPart(t *testing.T) {
// Check that the correct part was stored // Check that the correct part was stored
receivedPart := expectedRT.receivedParts.parts[partNum] 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."+ t.Errorf("Part in memory is not expected."+
"\nexpected: %q\nreceived: %q", expectedData, receivedPart) "\nexpected: %q\nreceived: %q", expectedData, receivedPart[:len(expectedData)])
} }
} }
......
...@@ -569,9 +569,9 @@ func TestReceivedTransfer_AddPart(t *testing.T) { ...@@ -569,9 +569,9 @@ func TestReceivedTransfer_AddPart(t *testing.T) {
receivedData, exists := rt.receivedParts.parts[partNum] receivedData, exists := rt.receivedParts.parts[partNum]
if !exists { if !exists {
t.Errorf("Part #%d not found in part map.", partNum) 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."+ 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 // Check that the fingerprint vector has correct values
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment