Skip to content

Commit

Permalink
Merge pull request IBM#1066 from ctrochalakis/drop-old-gzip
Browse files Browse the repository at this point in the history
Drop testing empty gzip encoding with the pre-1.8 encoder
  • Loading branch information
eapache committed Mar 15, 2018
2 parents 5983794 + a7c9c9d commit 73755b6
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions message_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package sarama

import (
"runtime"
"strings"
"testing"
"time"
)
Expand Down Expand Up @@ -31,17 +29,6 @@ var (
0xFF, 0xFF, 0xFF, 0xFF} // value

emptyGzipMessage = []byte{
97, 79, 149, 90, //CRC
0x00, // magic version byte
0x01, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
// value
0x00, 0x00, 0x00, 0x17,
0x1f, 0x8b,
0x08,
0, 0, 9, 110, 136, 0, 255, 1, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0}

emptyGzipMessage18 = []byte{
132, 99, 80, 148, //CRC
0x00, // magic version byte
0x01, // attribute flags
Expand Down Expand Up @@ -107,11 +94,7 @@ func TestMessageEncoding(t *testing.T) {

message.Value = []byte{}
message.Codec = CompressionGZIP
if strings.HasPrefix(runtime.Version(), "go1.8") || strings.HasPrefix(runtime.Version(), "go1.9") {
testEncodable(t, "empty gzip", &message, emptyGzipMessage18)
} else {
testEncodable(t, "empty gzip", &message, emptyGzipMessage)
}
testEncodable(t, "empty gzip", &message, emptyGzipMessage)

message.Value = []byte{}
message.Codec = CompressionLZ4
Expand Down

0 comments on commit 73755b6

Please sign in to comment.