Make TestDecodeLengthOffset test values above 16.
An upcoming commit will switch algorithms at values near this magic cutoff.
diff --git a/snappy_test.go b/snappy_test.go
index 4376600..47dfcf9 100644
--- a/snappy_test.go
+++ b/snappy_test.go
@@ -330,8 +330,8 @@
// copy-length-offset + literal. For example: "abcdefghijkl" + "efghij" + "AB".
func TestDecodeLengthOffset(t *testing.T) {
const (
- prefix = "abcdefghijkl"
- suffix = "ABCDEFGHIJKL"
+ prefix = "abcdefghijklmnopqr"
+ suffix = "ABCDEFGHIJKLMNOPQR"
// notPresent is a byte value that is not present in either the input
// or the output. It is written to gotBuf to check that Decode does not
@@ -339,10 +339,10 @@
notPresent = 0xfe
)
var gotBuf, wantBuf, inputBuf [256]byte
- for length := 1; length < 12; length++ {
- for offset := 1; offset < 12; offset++ {
+ for length := 1; length <= 18; length++ {
+ for offset := 1; offset <= 18; offset++ {
loop:
- for suffixLen := 0; suffixLen < 12; suffixLen++ {
+ for suffixLen := 0; suffixLen <= 18; suffixLen++ {
totalLen := uint64(len(prefix) + length + suffixLen)
inputLen := binary.PutUvarint(inputBuf[:], totalLen)