MCPcopy Create free account
hub / github.com/klauspost/compress / TestNewDecoder

Function TestNewDecoder

zstd/decoder_test.go:201–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

199}
200
201func TestNewDecoder(t *testing.T) {
202 for _, n := range []int{1, 4} {
203 for _, ignoreCRC := range []bool{false, true} {
204 t.Run(fmt.Sprintf("cpu-%d", n), func(t *testing.T) {
205 newFn := func() (*Decoder, error) {
206 return NewReader(nil, WithDecoderConcurrency(n), IgnoreChecksum(ignoreCRC))
207 }
208 testDecoderFile(t, "testdata/decoder.zip", newFn)
209 dec, err := newFn()
210 if err != nil {
211 t.Fatal(err)
212 }
213 testDecoderDecodeAll(t, "testdata/decoder.zip", dec)
214 })
215 }
216 }
217}
218
219func TestNewDecoderMemory(t *testing.T) {
220 defer timeout(60 * time.Second)()

Callers

nothing calls this directly

Calls 6

WithDecoderConcurrencyFunction · 0.85
IgnoreChecksumFunction · 0.85
testDecoderFileFunction · 0.85
testDecoderDecodeAllFunction · 0.85
FatalMethod · 0.80
NewReaderFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…