|
|
@ -58,23 +58,20 @@ func TestUnmarshalingCorruptedDeltaReturnsAnError(t *testing.T) { |
|
|
|
chunkLenPos int |
|
|
|
chunkLenPos int |
|
|
|
}{ |
|
|
|
}{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
"deltaEncodedChunk", |
|
|
|
chunkTypeName: "deltaEncodedChunk", |
|
|
|
// Hrm. Compiler didn't like a function which returned
|
|
|
|
chunkConstructor: func(a, b deltaBytes, c bool, d int) chunk { |
|
|
|
// *deltaEncodedChunk for the chunkConstructor field. This is ugly,
|
|
|
|
|
|
|
|
// but I dunno how to make the compiler happy here.
|
|
|
|
|
|
|
|
func(a, b deltaBytes, c bool, d int) chunk { |
|
|
|
|
|
|
|
return newDeltaEncodedChunk(a, b, c, d) |
|
|
|
return newDeltaEncodedChunk(a, b, c, d) |
|
|
|
}, |
|
|
|
}, |
|
|
|
deltaHeaderBytes, |
|
|
|
minHeaderLen: deltaHeaderBytes, |
|
|
|
deltaHeaderBufLenOffset, |
|
|
|
chunkLenPos: deltaHeaderBufLenOffset, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
"doubleDeltaEncodedChunk", |
|
|
|
chunkTypeName: "doubleDeltaEncodedChunk", |
|
|
|
func(a, b deltaBytes, c bool, d int) chunk { |
|
|
|
chunkConstructor: func(a, b deltaBytes, c bool, d int) chunk { |
|
|
|
return newDoubleDeltaEncodedChunk(a, b, c, d) |
|
|
|
return newDoubleDeltaEncodedChunk(a, b, c, d) |
|
|
|
}, |
|
|
|
}, |
|
|
|
doubleDeltaHeaderMinBytes, |
|
|
|
minHeaderLen: doubleDeltaHeaderMinBytes, |
|
|
|
doubleDeltaHeaderBufLenOffset, |
|
|
|
chunkLenPos: doubleDeltaHeaderBufLenOffset, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
for _, c := range cases { |
|
|
|
for _, c := range cases { |
|
|
|