Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
guonaihong committed May 15, 2024
1 parent 93e841a commit 5c3b061
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions deflate/compression_decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestDecompressNoContextTakeover(t *testing.T) {
tt.args.payload = all
}
// 压缩下一段数据
gotPayload, err := CompressNoContextTakeover(tt.args.payload, 1)
gotPayload, err := CompressNoContextTakeover(&tt.args.payload, 1)
if (err != nil) != tt.wantErr {
t.Errorf("CompressNoContextTakeover() error = %v, wantErr %v", err, tt.wantErr)
return
Expand All @@ -69,7 +69,7 @@ func TestDecompressNoContextTakeover(t *testing.T) {
}

// 解压
gotPayload2, err := de.Decompress(*gotPayload, 0)
gotPayload2, err := de.Decompress(gotPayload, 0)
if (err != nil) != tt.wantErr {
t.Errorf("Decompress() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down Expand Up @@ -131,7 +131,7 @@ func TestDecompressNoContextTakeover2(t *testing.T) {

for i := 0; i < tt.loop; i++ {
// 压缩下一段数据
gotPayload, err := CompressNoContextTakeover(needData, 2)
gotPayload, err := CompressNoContextTakeover(&needData, 2)
if (err != nil) != tt.wantErr {
t.Errorf("CompressNoContextTakeover() error = %v, wantErr %v", err, tt.wantErr)
return
Expand All @@ -143,7 +143,7 @@ func TestDecompressNoContextTakeover2(t *testing.T) {
for i := 0; i < tt.loop; i++ {

// 解压
gotPayload2, err := de.Decompress(decode[i], 0)
gotPayload2, err := de.Decompress(&decode[i], 0)
if (err != nil) != tt.wantErr {
t.Errorf("Decompress() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down
4 changes: 2 additions & 2 deletions deflate/compression_encode_no_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ func Test_compressNoContextTakeover(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotEncodeBuf, err := CompressNoContextTakeover(tt.args.payload, tt.args.level)
gotEncodeBuf, err := CompressNoContextTakeover(&tt.args.payload, tt.args.level)
if (err != nil) != tt.wantErr {
t.Errorf("compressNoContextTakeover() error = %v, wantErr %v", err, tt.wantErr)
return
}

gotDecode, err := DecompressNoContextTakeover(*gotEncodeBuf)
gotDecode, err := DecompressNoContextTakeover(gotEncodeBuf)
if (err != nil) != tt.wantErr {
t.Errorf("decompressNoContextTakeover() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down
4 changes: 2 additions & 2 deletions deflate/compression_encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ func TestEnCompressContextTakeover_Compress(t *testing.T) {
t.Errorf("NewCompressContextTakeover() error = %v, wantErr %v", err, tt.wantErr)
return
}
gotEncodePayload, err := e.Compress(tt.args.payload)
gotEncodePayload, err := e.Compress(&tt.args.payload)
if (err != nil) != tt.wantErr {
t.Errorf("CompressContextTakeover.Compress() error = %v, wantErr %v", err, tt.wantErr)
return
}

decodePayload, err := DecompressNoContextTakeover(*gotEncodePayload)
decodePayload, err := DecompressNoContextTakeover(gotEncodePayload)
if (err != nil) != tt.wantErr {
t.Errorf("CompressContextTakeover.Compress() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down

0 comments on commit 5c3b061

Please sign in to comment.