(t *testing.T)
| 407 | } |
| 408 | |
| 409 | func TestNewDecoderBad(t *testing.T) { |
| 410 | var errMap = make(map[string]string) |
| 411 | if true { |
| 412 | t.Run("Reader-4", func(t *testing.T) { |
| 413 | newFn := func() (*Decoder, error) { |
| 414 | return NewReader(nil, WithDecoderConcurrency(4), WithDecoderMaxMemory(1<<30)) |
| 415 | } |
| 416 | testDecoderFileBad(t, "testdata/bad.zip", newFn, errMap) |
| 417 | |
| 418 | }) |
| 419 | t.Run("Reader-1", func(t *testing.T) { |
| 420 | newFn := func() (*Decoder, error) { |
| 421 | return NewReader(nil, WithDecoderConcurrency(1), WithDecoderMaxMemory(1<<30)) |
| 422 | } |
| 423 | testDecoderFileBad(t, "testdata/bad.zip", newFn, errMap) |
| 424 | }) |
| 425 | t.Run("Reader-4-bigmem", func(t *testing.T) { |
| 426 | newFn := func() (*Decoder, error) { |
| 427 | return NewReader(nil, WithDecoderConcurrency(4), WithDecoderMaxMemory(1<<30), WithDecoderLowmem(false)) |
| 428 | } |
| 429 | testDecoderFileBad(t, "testdata/bad.zip", newFn, errMap) |
| 430 | |
| 431 | }) |
| 432 | t.Run("Reader-1-bigmem", func(t *testing.T) { |
| 433 | newFn := func() (*Decoder, error) { |
| 434 | return NewReader(nil, WithDecoderConcurrency(1), WithDecoderMaxMemory(1<<30), WithDecoderLowmem(false)) |
| 435 | } |
| 436 | testDecoderFileBad(t, "testdata/bad.zip", newFn, errMap) |
| 437 | }) |
| 438 | } |
| 439 | t.Run("DecodeAll", func(t *testing.T) { |
| 440 | defer timeout(10 * time.Second)() |
| 441 | dec, err := NewReader(nil, WithDecoderMaxMemory(1<<30)) |
| 442 | if err != nil { |
| 443 | t.Fatal(err) |
| 444 | } |
| 445 | testDecoderDecodeAllError(t, "testdata/bad.zip", dec, errMap) |
| 446 | }) |
| 447 | t.Run("DecodeAll-bigmem", func(t *testing.T) { |
| 448 | defer timeout(10 * time.Second)() |
| 449 | dec, err := NewReader(nil, WithDecoderMaxMemory(1<<30), WithDecoderLowmem(false)) |
| 450 | if err != nil { |
| 451 | t.Fatal(err) |
| 452 | } |
| 453 | testDecoderDecodeAllError(t, "testdata/bad.zip", dec, errMap) |
| 454 | }) |
| 455 | } |
| 456 | |
| 457 | func TestNewDecoderLarge(t *testing.T) { |
| 458 | newFn := func() (*Decoder, error) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…