diff options
author | dotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2007-01-16 01:37:03 +0000 |
---|---|---|
committer | dotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2007-01-16 01:37:03 +0000 |
commit | 755f521ad96da6493ea1b163c81d1c1a5afd065a (patch) | |
tree | 22f1080d34d42f0d745f1888a00e2055d3f1a3d6 | |
parent | 73994b30a85fc3ff4c25967ae18c87275f19ad65 (diff) |
Fixes the soft config used in parts of xdelta3-test.h, so it will be immune to changes in
xdelta3-cfgs.h.
-rwxr-xr-x | xdelta3/Makefile | 2 | ||||
-rw-r--r-- | xdelta3/releases/xdelta30e.tar.gz | bin | 0 -> 145229 bytes | |||
-rwxr-xr-x | xdelta3/xdelta3-regtest.py | 2 | ||||
-rwxr-xr-x | xdelta3/xdelta3-test.h | 56 |
4 files changed, 41 insertions, 19 deletions
diff --git a/xdelta3/Makefile b/xdelta3/Makefile index e2c635c..4cf3c4d 100755 --- a/xdelta3/Makefile +++ b/xdelta3/Makefile | |||
@@ -64,7 +64,7 @@ xdelta3: $(SOURCES) | |||
64 | 64 | ||
65 | xdelta3-debug: $(SOURCES) | 65 | xdelta3-debug: $(SOURCES) |
66 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-debug -DXD3_MAIN=1 -DGENERIC_ENCODE_TABLES=1 \ | 66 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-debug -DXD3_MAIN=1 -DGENERIC_ENCODE_TABLES=1 \ |
67 | -DXD3_USE_LARGEFILE64=1 -DXD3_STDIO=1 -DREGRESSION_TEST=1 -DXD3_DEBUG=2 -DSECONDARY_DJW=1 -DSECONDARY_FGK=1 -lm | 67 | -DXD3_USE_LARGEFILE64=1 -DXD3_STDIO=1 -DREGRESSION_TEST=1 -DXD3_DEBUG=1 -DSECONDARY_DJW=1 -DSECONDARY_FGK=1 -lm |
68 | 68 | ||
69 | $(PYTGT): $(SOURCES) | 69 | $(PYTGT): $(SOURCES) |
70 | $(PYTHON) setup.py install --verbose --compile --force | 70 | $(PYTHON) setup.py install --verbose --compile --force |
diff --git a/xdelta3/releases/xdelta30e.tar.gz b/xdelta3/releases/xdelta30e.tar.gz new file mode 100644 index 0000000..9c5c43b --- /dev/null +++ b/xdelta3/releases/xdelta30e.tar.gz | |||
Binary files differ | |||
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py index 520ec81..7bb7a1c 100755 --- a/xdelta3/xdelta3-regtest.py +++ b/xdelta3/xdelta3-regtest.py | |||
@@ -21,6 +21,8 @@ | |||
21 | # TODO: This is really part test, part performance evaluation suite, and | 21 | # TODO: This is really part test, part performance evaluation suite, and |
22 | # really incomplete. | 22 | # really incomplete. |
23 | 23 | ||
24 | # TODO: Test IOPT (1.5 vs. greedy) | ||
25 | |||
24 | import os, sys, math, re, time, types, array, random | 26 | import os, sys, math, re, time, types, array, random |
25 | import xdelta3 | 27 | import xdelta3 |
26 | 28 | ||
diff --git a/xdelta3/xdelta3-test.h b/xdelta3/xdelta3-test.h index dc67848..2c7af22 100755 --- a/xdelta3/xdelta3-test.h +++ b/xdelta3/xdelta3-test.h | |||
@@ -48,7 +48,8 @@ static int test_exponential_dist (usize_t mean, usize_t max); | |||
48 | 48 | ||
49 | #define CHECK(cond) if (!(cond)) { P(RINT "check failure: " #cond); abort(); } | 49 | #define CHECK(cond) if (!(cond)) { P(RINT "check failure: " #cond); abort(); } |
50 | 50 | ||
51 | /* TODO: Test 1.5 pass alg vs. greedy */ | 51 | /* Use a fixed soft config so that test values are fixed. See also test_compress_text(). */ |
52 | static const char* test_softcfg_str = "-C64,64,4,128,16,0,1,8,128,0"; | ||
52 | 53 | ||
53 | /****************************************************************************************** | 54 | /****************************************************************************************** |
54 | TEST HELPERS | 55 | TEST HELPERS |
@@ -673,9 +674,28 @@ test_compress_text (xd3_stream *stream, | |||
673 | { | 674 | { |
674 | int ret; | 675 | int ret; |
675 | xd3_config cfg; | 676 | xd3_config cfg; |
676 | int flags = stream->flags; | 677 | int oflags = stream->flags; |
678 | int flags = stream->flags | XD3_FLUSH; | ||
679 | |||
680 | xd3_free_stream (stream); | ||
681 | xd3_init_config (& cfg, flags); | ||
677 | 682 | ||
678 | stream->flags |= XD3_FLUSH; | 683 | /* This configuration is fixed so that the "expected non-error" the counts in |
684 | * decompress_single_bit_errors are too. See test_coftcfg_str. */ | ||
685 | cfg.smatch_cfg = XD3_SMATCH_SOFT; | ||
686 | cfg.smatcher_soft.name = "test"; | ||
687 | cfg.smatcher_soft.large_look = 64; /* no source, not used */ | ||
688 | cfg.smatcher_soft.large_step = 64; /* no source, not used */ | ||
689 | cfg.smatcher_soft.small_look = 4; | ||
690 | cfg.smatcher_soft.small_chain = 128; | ||
691 | cfg.smatcher_soft.small_lchain = 16; | ||
692 | cfg.smatcher_soft.ssmatch = 0; | ||
693 | cfg.smatcher_soft.try_lazy = 1; | ||
694 | cfg.smatcher_soft.max_lazy = 8; | ||
695 | cfg.smatcher_soft.long_enough = 128; | ||
696 | cfg.smatcher_soft.promote = 0; | ||
697 | |||
698 | xd3_config_stream (stream, & cfg); | ||
679 | 699 | ||
680 | (*encoded_size) = 0; | 700 | (*encoded_size) = 0; |
681 | 701 | ||
@@ -688,7 +708,7 @@ test_compress_text (xd3_stream *stream, | |||
688 | 708 | ||
689 | fail: | 709 | fail: |
690 | xd3_free_stream (stream); | 710 | xd3_free_stream (stream); |
691 | xd3_init_config (& cfg, flags); | 711 | xd3_init_config (& cfg, oflags); |
692 | xd3_config_stream (stream, & cfg); | 712 | xd3_config_stream (stream, & cfg); |
693 | return ret; | 713 | return ret; |
694 | } | 714 | } |
@@ -1453,25 +1473,25 @@ test_command_line_arguments (xd3_stream *stream, int ignore) | |||
1453 | static const char* cmdpairs[] = | 1473 | static const char* cmdpairs[] = |
1454 | { | 1474 | { |
1455 | /* standard input, output */ | 1475 | /* standard input, output */ |
1456 | "%s -A < %s > %s", "%s -d < %s > %s", | 1476 | "%s %s -A < %s > %s", "%s -d < %s > %s", |
1457 | "%s -A -e < %s > %s", "%s -d < %s > %s", | 1477 | "%s %s -A -e < %s > %s", "%s -d < %s > %s", |
1458 | "%s -A= encode < %s > %s", "%s decode < %s > %s", | 1478 | "%s %s -A= encode < %s > %s", "%s decode < %s > %s", |
1459 | "%s -A -q encode < %s > %s", "%s -qdq < %s > %s", | 1479 | "%s %s -A -q encode < %s > %s", "%s -qdq < %s > %s", |
1460 | 1480 | ||
1461 | /* file input, standard output */ | 1481 | /* file input, standard output */ |
1462 | "%s -A= %s > %s", "%s -d %s > %s", | 1482 | "%s %s -A= %s > %s", "%s -d %s > %s", |
1463 | "%s -A -e %s > %s", "%s -d %s > %s", | 1483 | "%s %s -A -e %s > %s", "%s -d %s > %s", |
1464 | "%s encode -A= %s > %s", "%s decode %s > %s", | 1484 | "%s %s encode -A= %s > %s", "%s decode %s > %s", |
1465 | 1485 | ||
1466 | /* file input, output */ | 1486 | /* file input, output */ |
1467 | "%s -A= %s %s", "%s -d %s %s", | 1487 | "%s %s -A= %s %s", "%s -d %s %s", |
1468 | "%s -A -e %s %s", "%s -d %s %s", | 1488 | "%s %s -A -e %s %s", "%s -d %s %s", |
1469 | "%s -A= encode %s %s", "%s decode %s %s", | 1489 | "%s %s -A= encode %s %s", "%s decode %s %s", |
1470 | 1490 | ||
1471 | /* option placement */ | 1491 | /* option placement */ |
1472 | "%s -A -f %s %s", "%s -f -d %s %s", | 1492 | "%s %s -A -f %s %s", "%s -f -d %s %s", |
1473 | "%s -e -A= %s %s", "%s -d -f %s %s", | 1493 | "%s %s -e -A= %s %s", "%s -d -f %s %s", |
1474 | "%s -f encode -A= %s %s", "%s -f decode -f %s %s", | 1494 | "%s %s -f encode -A= %s %s", "%s -f decode -f %s %s", |
1475 | }; | 1495 | }; |
1476 | 1496 | ||
1477 | char ecmd[TESTBUFSIZE], dcmd[TESTBUFSIZE]; | 1497 | char ecmd[TESTBUFSIZE], dcmd[TESTBUFSIZE]; |
@@ -1487,7 +1507,7 @@ test_command_line_arguments (xd3_stream *stream, int ignore) | |||
1487 | test_setup (); | 1507 | test_setup (); |
1488 | if ((ret = test_make_inputs (stream, NULL, & tsize))) { return ret; } | 1508 | if ((ret = test_make_inputs (stream, NULL, & tsize))) { return ret; } |
1489 | 1509 | ||
1490 | sprintf (ecmd, cmdpairs[2*i], program_name, TEST_TARGET_FILE, TEST_DELTA_FILE); | 1510 | sprintf (ecmd, cmdpairs[2*i], program_name, test_softcfg_str, TEST_TARGET_FILE, TEST_DELTA_FILE); |
1491 | sprintf (dcmd, cmdpairs[2*i+1], program_name, TEST_DELTA_FILE, TEST_RECON_FILE); | 1511 | sprintf (dcmd, cmdpairs[2*i+1], program_name, TEST_DELTA_FILE, TEST_RECON_FILE); |
1492 | 1512 | ||
1493 | /* Encode and decode. */ | 1513 | /* Encode and decode. */ |