Преглед на файлове

Make TestDecodeLengthOffset test values above 16.

An upcoming commit will switch algorithms at values near this magic cutoff.
Nigel Tao преди 10 години
родител
ревизия
12528fe033
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      snappy_test.go

+ 5 - 5
snappy_test.go

@@ -330,8 +330,8 @@ loop:
 // 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 @@ func TestDecodeLengthOffset(t *testing.T) {
 		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)