瀏覽代碼

Fix tests

Jakob Borg 10 年之前
父節點
當前提交
84365882de
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      protocol_test.go

+ 6 - 5
protocol_test.go

@@ -278,11 +278,12 @@ func TestMarshalIndexMessage(t *testing.T) {
 	}
 
 	f := func(m1 IndexMessage) bool {
-		for _, f := range m1.Files {
-			for i := range f.Blocks {
-				f.Blocks[i].Offset = 0
-				if len(f.Blocks[i].Hash) == 0 {
-					f.Blocks[i].Hash = nil
+		for i, f := range m1.Files {
+			m1.Files[i].CachedSize = 0
+			for j := range f.Blocks {
+				f.Blocks[j].Offset = 0
+				if len(f.Blocks[j].Hash) == 0 {
+					f.Blocks[j].Hash = nil
 				}
 			}
 		}