From 84365882de255d2204d0eeda8dee288082a27f98 Mon Sep 17 00:00:00 2001
From: Jakob Borg <jakob@nym.se>
Date: Fri, 28 Aug 2015 09:01:21 +0200
Subject: [PATCH] Fix tests

---
 protocol_test.go | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/protocol_test.go b/protocol_test.go
index 051672411..2c64a9b32 100644
--- a/protocol_test.go
+++ b/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
 				}
 			}
 		}