Work around the finnicky 1.6 CGo pointer checks #337

Merged
carlosmn merged 4 commits from cmn/go16-blob-pointer into master 2016-08-27 14:02:47 -05:00
1 changed files with 2 additions and 4 deletions
Showing only changes of commit b5d213c2c1 - Show all commits

View File

@ -28,16 +28,14 @@ func TestCreateBlobFromBuffer(t *testing.T) {
}
for _, data := range []([]byte){[]byte("hello there"), doublePointerBytes()} {
expected := make([]byte, len(data))
copy(expected, data)
id, err = repo.CreateBlobFromBuffer(data)
checkFatal(t, err)
blob, err := repo.LookupBlob(id)
checkFatal(t, err)
if !bytes.Equal(blob.Contents(), expected) {
if !bytes.Equal(blob.Contents(), data) {
t.Fatal("Loaded bytes don't match original bytes:",
blob.Contents(), "!=", expected)
blob.Contents(), "!=", data)
}
}
}