| 1 | BEGIN { |
| 2 | if ($ENVscip-perl cpan Compress-Raw-Lzma 2.221 main/`%ENV`.{PERL_CORE}) { |
| 3 | chdirscip-perl cpan Compress-Raw-Lzma 2.221 main/chdir(). 't' if -d 't'; |
| 4 | @INCscip-perl cpan Compress-Raw-Lzma 2.221 main/`@INC`. = ("../lib", "lib/compress"); |
| 5 | } |
| 6 | } |
| 7 | |
| 8 | |
| 9 | use libscip-perl cpan Compress-Raw-Lzma 2.221 lib/ qw(t t/compress); |
| 10 | use strictscip-perl cpan Compress-Raw-Lzma 2.221 strict/; |
| 11 | use warningsscip-perl cpan Compress-Raw-Lzma 2.221 warnings/; |
| 12 | use bytesscip-perl cpan Compress-Raw-Lzma 2.221 bytes/; |
| 13 | |
| 14 | use Test::Morescip-perl cpan Compress-Raw-Lzma 2.221 Test/More/ ; |
| 15 | use CompTestUtilsscip-perl cpan Compress-Raw-Lzma 2.221 CompTestUtils/; |
| 16 | |
| 17 | my $XZ ; |
| 18 | |
| 19 | sub ExternalXzWorksscip-perl cpan Compress-Raw-Lzma 2.221 main/ExternalXzWorks(). |
| 20 | { |
| 21 | my $lex = new LexFile my $outfile; |
| 22 | my $content = qq { |
| 23 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut tempus odio id |
| 24 | dolor. Camelus perlus. Larrius in lumen numen. Dolor en quiquum filia |
| 25 | est. Quintus cenum parat. |
| 26 | }; |
| 27 | |
| 28 | my $compressed; |
| 29 | writeWithXzscip-perl cpan Compress-Raw-Lzma 2.221 main/writeWithXz().($content, $compressed) |
| 30 | or return 0; |
| 31 | |
| 32 | writeFilescip-perl cpan Compress-Raw-Lzma 2.221 main/writeFile().($outfile, $compressed); |
| 33 | |
| 34 | my $got; |
| 35 | readWithXzscip-perl cpan Compress-Raw-Lzma 2.221 main/readWithXz().($outfile, $got) |
| 36 | or return 0; |
| 37 | |
| 38 | if ($content ne $got) |
| 39 | { |
| 40 | diagscip-perl cpan Compress-Raw-Lzma 2.221 main/diag(). "Uncompressed content is wrong"; |
| 41 | return 0 ; |
| 42 | } |
| 43 | |
| 44 | return 1 ; |
| 45 | } |
| 46 | |
| 47 | sub rdFilescip-perl cpan Compress-Raw-Lzma 2.221 main/rdFile(). |
| 48 | { |
| 49 | my $f = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift(). ; |
| 50 | |
| 51 | my @strings ; |
| 52 | |
| 53 | { |
| 54 | openscip-perl cpan Compress-Raw-Lzma 2.221 main/open(). (F, "<$f") |
| 55 | or croakscip-perl cpan Compress-Raw-Lzma 2.221 main/croak(). "Cannot open $f: $!\n" ; |
| 56 | binmode F; |
| 57 | @strings = <F> ; |
| 58 | close F ; |
| 59 | } |
| 60 | |
| 61 | return @strings if wantarrayscip-perl cpan Compress-Raw-Lzma 2.221 main/wantarray(). ; |
| 62 | return joinscip-perl cpan Compress-Raw-Lzma 2.221 main/join(). "", @strings ; |
| 63 | } |
| 64 | |
| 65 | |
| 66 | sub readWithXzscip-perl cpan Compress-Raw-Lzma 2.221 main/readWithXz(). |
| 67 | { |
| 68 | my $file = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift(). ; |
| 69 | my $opts = $_scip-perl cpan Compress-Raw-Lzma 2.221 main/`@_`.[1] || ""; |
| 70 | |
| 71 | my $lex = new LexFile my $outfile; |
| 72 | |
| 73 | my $comp = "$XZ -dc $opts 2>/dev/null" ; |
| 74 | |
| 75 | if (systemscip-perl cpan Compress-Raw-Lzma 2.221 main/system().("$comp $file >$outfile") == 0 ) |
| 76 | { |
| 77 | $_scip-perl cpan Compress-Raw-Lzma 2.221 main/`@_`.[0] = rdFilescip-perl cpan Compress-Raw-Lzma 2.221 main/rdFile().($outfile); |
| 78 | return 1 ; |
| 79 | } |
| 80 | |
| 81 | diagscip-perl cpan Compress-Raw-Lzma 2.221 main/diag(). "'$comp' failed: \$?=$? \$!=$!"; |
| 82 | return 0 ; |
| 83 | } |
| 84 | |
| 85 | sub writeWithXzscip-perl cpan Compress-Raw-Lzma 2.221 main/writeWithXz(). |
| 86 | { |
| 87 | my $content = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift(). ; |
| 88 | my $output = \$_scip-perl cpan Compress-Raw-Lzma 2.221 main/`@_`.[0] ; |
| 89 | my $options = $_scip-perl cpan Compress-Raw-Lzma 2.221 main/`@_`.[1] || ''; |
| 90 | |
| 91 | my $lex1 = new LexFile my $infile; |
| 92 | my $lex2 = new LexFile my $outfile; |
| 93 | writeFilescip-perl cpan Compress-Raw-Lzma 2.221 main/writeFile().($infile, $content); |
| 94 | |
| 95 | my $comp = "$XZ -c $options $infile >$outfile 2>/dev/null" ; |
| 96 | |
| 97 | if (systemscip-perl cpan Compress-Raw-Lzma 2.221 main/system().($comp) == 0) |
| 98 | { |
| 99 | $$output = rdFilescip-perl cpan Compress-Raw-Lzma 2.221 main/rdFile().($outfile); |
| 100 | return 1 ; |
| 101 | } |
| 102 | |
| 103 | diagscip-perl cpan Compress-Raw-Lzma 2.221 main/diag(). "'$comp' failed: \$?=$? \$!=$!"; |
| 104 | return 0 ; |
| 105 | } |
| 106 | |
| 107 | BEGIN |
| 108 | { |
| 109 | |
| 110 | # Check external xz is available |
| 111 | my $name = $^Oscip-perl cpan Compress-Raw-Lzma 2.221 main/`$^O`. =~ /mswin/i ? 'xz.exe' : 'xz'; |
| 112 | my $split = $^Oscip-perl cpan Compress-Raw-Lzma 2.221 main/`$^O`. =~ /mswin/i ? ";" : ":"; |
| 113 | |
| 114 | for my $dir (reversescip-perl cpan Compress-Raw-Lzma 2.221 main/reverse(). splitscip-perl cpan Compress-Raw-Lzma 2.221 main/split(). $split, $ENVscip-perl cpan Compress-Raw-Lzma 2.221 main/`%ENV`.{PATH}) |
| 115 | { |
| 116 | $XZ = "$dir/$name" |
| 117 | if -x "$dir/$name" ; |
| 118 | } |
| 119 | |
| 120 | # Handle spaces in path to xz |
| 121 | $XZ = "\"$XZ\"" if definedscip-perl cpan Compress-Raw-Lzma 2.221 main/defined(). $XZ && $XZ =~ /\s/; |
| 122 | |
| 123 | planscip-perl cpan Compress-Raw-Lzma 2.221 main/plan().(skip_all => "Cannot find $name") |
| 124 | if ! $XZ ; |
| 125 | |
| 126 | planscip-perl cpan Compress-Raw-Lzma 2.221 main/plan().(skip_all => "$name doesn't work as expected") |
| 127 | if ! ExternalXzWorksscip-perl cpan Compress-Raw-Lzma 2.221 main/ExternalXzWorks().(); |
| 128 | |
| 129 | # use Test::NoWarnings, if available |
| 130 | my $extra = 0 ; |
| 131 | $extra = 1 |
| 132 | if eval { requirescip-perl cpan Compress-Raw-Lzma 2.221 main/require(). Test::NoWarnings ; import Test::NoWarnings; 1 }; |
| 133 | |
| 134 | planscip-perl cpan Compress-Raw-Lzma 2.221 main/plan(). tests => 1006 + $extra ; |
| 135 | |
| 136 | use_okscip-perl cpan Compress-Raw-Lzma 2.221 main/use_ok().('Compress::Raw::Lzma') ; |
| 137 | |
| 138 | } |
| 139 | |
| 140 | sub compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith(). |
| 141 | { |
| 142 | my $class = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 143 | my $xz_opts = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 144 | my %opts = @_scip-perl cpan Compress-Raw-Lzma 2.221 main/`@_`. ; |
| 145 | |
| 146 | my $contents = '' ; |
| 147 | foreach (1 .. 5000) |
| 148 | { $contents .= chrscip-perl cpan Compress-Raw-Lzma 2.221 main/chr(). intscip-perl cpan Compress-Raw-Lzma 2.221 main/int(). randscip-perl cpan Compress-Raw-Lzma 2.221 main/rand(). 255 } |
| 149 | |
| 150 | |
| 151 | my ($x, $err) = $class->newscip-perl cpan Compress-Raw-Lzma 2.221 main/new().(AppendOutput => 1, %opts) ; |
| 152 | |
| 153 | SKIP: |
| 154 | { |
| 155 | skipscip-perl cpan Compress-Raw-Lzma 2.221 main/skip(). "Not Enough Memory", 7 if $err == LZMA_MEM_ERROR; |
| 156 | |
| 157 | isa_okscip-perl cpan Compress-Raw-Lzma 2.221 main/isa_ok(). $x, $class; |
| 158 | isa_okscip-perl cpan Compress-Raw-Lzma 2.221 main/isa_ok(). $x, "Compress::Raw::Lzma::Encoder"; |
| 159 | |
| 160 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.221 main/cmp_ok(). $err, '==', LZMA_OK," status is LZMA_OK" |
| 161 | or diagscip-perl cpan Compress-Raw-Lzma 2.221 main/diag(). "Error is $err"; |
| 162 | |
| 163 | my (%X, $Y, %Z, $X, $Z); |
| 164 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.221 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.221 main/code().($contents, $X), '==', LZMA_OK, " compressed ok" ; |
| 165 | |
| 166 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.221 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.221 main/flush().($X), '==', LZMA_STREAM_END, " flushed ok" ; |
| 167 | |
| 168 | my $lex = new LexFile my $file; |
| 169 | writeFilescip-perl cpan Compress-Raw-Lzma 2.221 main/writeFile().($file, $X); |
| 170 | |
| 171 | undefscip-perl cpan Compress-Raw-Lzma 2.221 main/undef(). $x ; |
| 172 | |
| 173 | # displayMemoryUsage("Before"); |
| 174 | my $got = ''; |
| 175 | okscip-perl cpan Compress-Raw-Lzma 2.221 main/ok(). readWithXzscip-perl cpan Compress-Raw-Lzma 2.221 main/readWithXz().($file, $got, $xz_opts), " readWithXz returns 0"; |
| 176 | # displayMemoryUsage("After"); |
| 177 | |
| 178 | isscip-perl cpan Compress-Raw-Lzma 2.221 main/is(). $got, $contents, " got content"; |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | sub uncompressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/uncompressWith(). |
| 183 | { |
| 184 | my $class = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 185 | my $xz_opts = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 186 | my %opts = @_scip-perl cpan Compress-Raw-Lzma 2.221 main/`@_`. ; |
| 187 | |
| 188 | my $contents = '' ; |
| 189 | foreach (1 .. 5000) |
| 190 | { $contents .= chrscip-perl cpan Compress-Raw-Lzma 2.221 main/chr(). intscip-perl cpan Compress-Raw-Lzma 2.221 main/int(). randscip-perl cpan Compress-Raw-Lzma 2.221 main/rand(). 255 } |
| 191 | |
| 192 | |
| 193 | my $compressed; |
| 194 | writeWithXzscip-perl cpan Compress-Raw-Lzma 2.221 main/writeWithXz().($contents, $compressed, $xz_opts); |
| 195 | |
| 196 | my ($x, $err) = $class->newscip-perl cpan Compress-Raw-Lzma 2.221 main/new().(AppendOutput => 1, %opts) ; |
| 197 | isa_okscip-perl cpan Compress-Raw-Lzma 2.221 main/isa_ok(). $x, $class; |
| 198 | isa_okscip-perl cpan Compress-Raw-Lzma 2.221 main/isa_ok(). $x, "Compress::Raw::Lzma::Decoder"; |
| 199 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.221 main/cmp_ok(). $err, '==', LZMA_OK," status is LZMA_OK" ; |
| 200 | |
| 201 | my $got = ''; |
| 202 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.221 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.221 main/code().($compressed, $got), '==', LZMA_STREAM_END, " compressed ok" ; |
| 203 | |
| 204 | #is $got, $contents, "got content"; |
| 205 | ok $got eqscip-perl cpan Compress-Raw-Lzma 2.221 main/eq(). $contents, " got content"; |
| 206 | } |
| 207 | |
| 208 | { |
| 209 | # Delete environment variables used by xz that could impact the running of the test |
| 210 | for my $var (qw( XZ_DEFAULTS XZ_OPT )) |
| 211 | { |
| 212 | deletescip-perl cpan Compress-Raw-Lzma 2.221 main/delete(). $ENVscip-perl cpan Compress-Raw-Lzma 2.221 main/`%ENV`.{$var}; |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | { |
| 217 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test AloneEncoder interop with xz" ; |
| 218 | |
| 219 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::AloneEncoder', '-F auto'); |
| 220 | |
| 221 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::AloneEncoder', '-F auto', |
| 222 | Filter => Lzma::Filter::Lzma1 ); |
| 223 | |
| 224 | # # Error |
| 225 | # eval { |
| 226 | # compressWith('Compress::Raw::Lzma::AloneEncoder', '-F auto', |
| 227 | # Filter => Lzma::Filter::X86); |
| 228 | # }; |
| 229 | # like $@, mkErr("filter is not an Lzma::Filter::Lzma1 object"), " catch error"; |
| 230 | |
| 231 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::AloneEncoder', '-F auto', |
| 232 | Filter => Lzma::Filter::Lzma1scip-perl cpan Compress-Raw-Lzma 2.221 Lzma/Filter/Lzma1().( |
| 233 | #DictSize => 1024 * 100, |
| 234 | Lc => LZMA_LCLP_MAX, |
| 235 | #Lp => 3, |
| 236 | Pb => LZMA_PB_MAX, |
| 237 | Mode => LZMA_MODE_FAST, |
| 238 | Nice => 128, |
| 239 | Mf => LZMA_MF_HC4, |
| 240 | Depth => 77 |
| 241 | ) |
| 242 | ) ; |
| 243 | |
| 244 | sub compressAloneWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressAloneWithParam(). |
| 245 | { |
| 246 | my $name = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 247 | my $range = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 248 | |
| 249 | for my $value (@$range) |
| 250 | { |
| 251 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "test $name with $value"; |
| 252 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::AloneEncoder', '-F auto', |
| 253 | Filter => Lzma::Filter::Lzma1scip-perl cpan Compress-Raw-Lzma 2.221 Lzma/Filter/Lzma1().($name, $value) |
| 254 | ) ; |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | compressAloneWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressAloneWithParam(). "Lc", [ 0 .. 4 ]; |
| 259 | #compressAloneWithParam "Lp", [ 0 .. 4 ]; |
| 260 | compressAloneWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressAloneWithParam(). "Mode", [ LZMA_MODE_NORMAL, LZMA_MODE_FAST ]; |
| 261 | compressAloneWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressAloneWithParam(). "Mf", [ LZMA_MF_HC3, LZMA_MF_HC4, LZMA_MF_BT2, |
| 262 | LZMA_MF_BT3, LZMA_MF_BT4]; |
| 263 | #compressAloneWithParam "Nice", [ 2 .. 273 ]; |
| 264 | #compressAloneWithParam "Depth", [ 2 .. 273 ]; |
| 265 | } |
| 266 | |
| 267 | |
| 268 | { |
| 269 | # EasyEncoder |
| 270 | |
| 271 | for my $check (LZMA_CHECK_NONE, LZMA_CHECK_CRC32, LZMA_CHECK_CRC64, LZMA_CHECK_SHA256) |
| 272 | { |
| 273 | for my $extreme (0 .. 1) |
| 274 | { |
| 275 | for my $preset (0 .. 9) |
| 276 | { |
| 277 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test EasyEncoder interop with xz, Check $check, Extreme $extreme, Preset $preset" ; |
| 278 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::EasyEncoder', '-F xz', |
| 279 | Check => $check, |
| 280 | Extreme => $extreme, |
| 281 | Preset => $preset); |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | |
| 288 | my @Filters = ( |
| 289 | ["Lzma2", [ Lzma::Filter::Lzma2 |
| 290 | ] |
| 291 | ], |
| 292 | ["x86 + Lzma2", [ Lzma::Filter::X86, |
| 293 | Lzma::Filter::Lzma2 |
| 294 | ] |
| 295 | ], |
| 296 | ["x86 + Delta + Lzma2", [ Lzma::Filter::X86, |
| 297 | Lzma::Filter::Delta, |
| 298 | Lzma::Filter::Lzma2 |
| 299 | ] |
| 300 | ], |
| 301 | ["x86 + Delta + x86 + Lzma2", [ Lzma::Filter::X86, |
| 302 | Lzma::Filter::Delta, |
| 303 | Lzma::Filter::X86, |
| 304 | Lzma::Filter::Lzma2 |
| 305 | ] |
| 306 | ], |
| 307 | ); |
| 308 | |
| 309 | { |
| 310 | # StreamEncoder |
| 311 | |
| 312 | for my $check (LZMA_CHECK_NONE LZMA_CHECK_CRC32 LZMA_CHECK_CRC64 LZMA_CHECK_SHA256) |
| 313 | { |
| 314 | for my $f (@Filters) |
| 315 | { |
| 316 | my ($name, $filter) = @$f; |
| 317 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test StreamEncoder interop with xz, Filter '$name' Check $check" ; |
| 318 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::StreamEncoder', '-F xz', |
| 319 | Check => $check, |
| 320 | Filter => $filter, |
| 321 | ); |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::StreamEncoder', '-F auto', |
| 326 | Filter => Lzma::Filter::Lzma2scip-perl cpan Compress-Raw-Lzma 2.221 Lzma/Filter/Lzma2().( |
| 327 | #DictSize => 44, |
| 328 | Lc => LZMA_LCLP_MAX, |
| 329 | #Lp => 3, |
| 330 | Pb => LZMA_PB_MAX, |
| 331 | Mode => LZMA_MODE_FAST, |
| 332 | Nice => 128, |
| 333 | Mf => LZMA_MF_HC4, |
| 334 | Depth => 77) |
| 335 | ) ; |
| 336 | |
| 337 | sub compressStreamWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressStreamWithParam(). |
| 338 | { |
| 339 | my $name = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 340 | my $range = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 341 | |
| 342 | for my $value (@$range) |
| 343 | { |
| 344 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "test $name with $value"; |
| 345 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::StreamEncoder', '-F auto', |
| 346 | Filter => Lzma::Filter::Lzma2scip-perl cpan Compress-Raw-Lzma 2.221 Lzma/Filter/Lzma2().($name, $value) |
| 347 | ) ; |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | compressStreamWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressStreamWithParam(). "Lc", [ 0 .. 4 ]; |
| 352 | #compressStreamWithParam "Lp", [ 0 .. 4 ]; |
| 353 | compressStreamWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressStreamWithParam(). "Mode", [ LZMA_MODE_NORMAL, LZMA_MODE_FAST ]; |
| 354 | compressStreamWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressStreamWithParam(). "Mf", [ LZMA_MF_HC3, LZMA_MF_HC4, LZMA_MF_BT2, |
| 355 | LZMA_MF_BT3, LZMA_MF_BT4]; |
| 356 | #compressStreamWithParam "Nice", [ 2 .. 273 ]; |
| 357 | #compressStreamWithParam "Depth", [ 2 .. 273 ]; |
| 358 | } |
| 359 | |
| 360 | { |
| 361 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test RawEncoder interop with xz" ; |
| 362 | |
| 363 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::RawEncoder', '-F raw'); |
| 364 | |
| 365 | sub compressRawWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressRawWithParam(). |
| 366 | { |
| 367 | my $name = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 368 | my $range = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift().; |
| 369 | my $xz_opts = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift(). || ""; |
| 370 | my $xz_values = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift(). || $range; |
| 371 | |
| 372 | for my $value (@$range) |
| 373 | { |
| 374 | my $xz_value = shiftscip-perl cpan Compress-Raw-Lzma 2.221 main/shift(). @$xz_values; |
| 375 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "test $name with $value"; |
| 376 | compressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/compressWith().('Compress::Raw::Lzma::RawEncoder', |
| 377 | "-F raw $xz_opts=$xz_value", |
| 378 | Filter => Lzma::Filter::Lzma2scip-perl cpan Compress-Raw-Lzma 2.221 Lzma/Filter/Lzma2().($name, $value) |
| 379 | ) ; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | compressRawWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressRawWithParam(). "Lc", [ 0 .. 4 ], "--lzma2=lc"; |
| 384 | #compressRawWithParam "Lp", [ 0 .. 4 ], "--lzma2=lp"; |
| 385 | compressRawWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressRawWithParam(). "Mode", [ LZMA_MODE_NORMAL, LZMA_MODE_FAST ], |
| 386 | "--lzma2=mode", ["normal", "fast"]; |
| 387 | compressRawWithParamscip-perl cpan Compress-Raw-Lzma 2.221 main/compressRawWithParam(). "Mf", [ LZMA_MF_HC3, LZMA_MF_HC4, LZMA_MF_BT2, |
| 388 | LZMA_MF_BT3, LZMA_MF_BT4], "--lzma2=mf", |
| 389 | [qw(hc3 hc4 bt2 bt3 bt4)]; |
| 390 | #compressRawWithParam "Nice", [ 2 .. 273 ], "--lzma2=nice"; |
| 391 | #compressRawWithParam "Depth", [ 2 .. 273 ], "--lzma2=depth"; |
| 392 | } |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | { |
| 398 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test AutoDecoder interop with xz" ; |
| 399 | |
| 400 | uncompressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/uncompressWith().('Compress::Raw::Lzma::AutoDecoder', '-F xz'); |
| 401 | |
| 402 | } |
| 403 | |
| 404 | { |
| 405 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test AloneDecoder interop with xz" ; |
| 406 | |
| 407 | uncompressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/uncompressWith().('Compress::Raw::Lzma::AloneDecoder', '-F lzma'); |
| 408 | |
| 409 | } |
| 410 | |
| 411 | { |
| 412 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test StreamDecoder interop with xz" ; |
| 413 | |
| 414 | uncompressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/uncompressWith().('Compress::Raw::Lzma::StreamDecoder', '-F xz'); |
| 415 | |
| 416 | } |
| 417 | |
| 418 | { |
| 419 | titlescip-perl cpan Compress-Raw-Lzma 2.221 main/title(). "Test RawDecoder interop with xz" ; |
| 420 | |
| 421 | uncompressWithscip-perl cpan Compress-Raw-Lzma 2.221 main/uncompressWith().('Compress::Raw::Lzma::RawDecoder', '-F raw'); |
| 422 | |
| 423 | } |