(cMax int)
| 29 | } |
| 30 | |
| 31 | func getEncOpts(cMax int) []testEncOpt { |
| 32 | var o []testEncOpt |
| 33 | for level := speedNotSet + 1; level < speedLast; level++ { |
| 34 | if isRaceTest && level >= SpeedBestCompression { |
| 35 | break |
| 36 | } |
| 37 | for conc := 1; conc <= 4; conc *= 2 { |
| 38 | for _, wind := range testWindowSizes { |
| 39 | addOpt := func(name string, options ...EOption) { |
| 40 | opts := append([]EOption(nil), WithEncoderLevel(level), WithEncoderConcurrency(conc), WithWindowSize(wind)) |
| 41 | name = fmt.Sprintf("%s-c%d-w%dk-%s", level.String(), conc, wind/1024, name) |
| 42 | o = append(o, testEncOpt{name: name, o: append(opts, options...)}) |
| 43 | } |
| 44 | addOpt("default") |
| 45 | if testing.Short() { |
| 46 | break |
| 47 | } |
| 48 | addOpt("nocrc", WithEncoderCRC(false)) |
| 49 | addOpt("lowmem", WithLowerEncoderMem(true)) |
| 50 | addOpt("alllit", WithAllLitEntropyCompression(true)) |
| 51 | addOpt("nolit", WithNoEntropyCompression(true)) |
| 52 | addOpt("pad1k", WithEncoderPadding(1024)) |
| 53 | addOpt("zerof", WithZeroFrames(true)) |
| 54 | addOpt("1seg", WithSingleSegment(true)) |
| 55 | addOpt("conc", WithConcurrentBlocks(true)) |
| 56 | } |
| 57 | if testing.Short() && conc == 2 { |
| 58 | break |
| 59 | } |
| 60 | if conc >= cMax { |
| 61 | break |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | return o |
| 66 | } |
| 67 | |
| 68 | func TestEncoder_EncodeAllSimple(t *testing.T) { |
| 69 | in, err := os.ReadFile("testdata/z000028") |
no test coverage detected
searching dependent graphs…