summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pool <mbp@sourcefrog.net>2014-11-01 10:33:32 -0700
committerMartin Pool <mbp@sourcefrog.net>2014-11-01 10:33:32 -0700
commit5b21318e9885476a04020a35c041009b78f259b5 (patch)
tree2b3a8f7e408c24407acc9eb42265e9aa856c9ff6
parenteb56b92afb7181568d5780dc78f6e4a48e537a3e (diff)
downloadlibrsync-5b21318e9885476a04020a35c041009b78f259b5.tar.gz
Run tests that don't use canned signatures once for every hash algorithm
-rwxr-xr-xtestsuite/changes.test9
-rwxr-xr-xtestsuite/delta.test2
-rwxr-xr-xtestsuite/mutate.test17
-rwxr-xr-xtestsuite/signature.test2
-rwxr-xr-xtestsuite/sources.test13
-rw-r--r--testsuite/testcommon.sh7
-rwxr-xr-xtestsuite/triple.test12
7 files changed, 41 insertions, 21 deletions
diff --git a/testsuite/changes.test b/testsuite/changes.test
index c2d167c..c3d7cd6 100755
--- a/testsuite/changes.test
+++ b/testsuite/changes.test
@@ -3,6 +3,8 @@
# librsync -- the library for network deltas
#
# Copyright (C) 2001, 2014 by Martin Pool <mbp@sourcefrog.net>
+
+# changes.test: Test converting in both directions between each pair of files.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
@@ -27,7 +29,10 @@ do
old=$inputdir/01.in
for new in $inputdir/*.in
do
- triple_test $buf $old $new
- triple_test $buf $new $old
+ for hashopt in '' -Hmd4 -Hblake2
+ do
+ triple_test $buf $old $new $hashopt
+ triple_test $buf $new $old $hashopt
+ done
done
done
diff --git a/testsuite/delta.test b/testsuite/delta.test
index c2cc123..3202423 100755
--- a/testsuite/delta.test
+++ b/testsuite/delta.test
@@ -2,6 +2,8 @@
# librsync -- the library for network deltas
+# delta.test: Check application of some canned deltas to /dev/null
+
# Copyright (C) 1999, 2000, 2001, 2014 by Martin Pool <mbp@sourcefrog.net>
# Copyright (C) 1999 by Andrew Tridgell <tridge@samba.org>
diff --git a/testsuite/mutate.test b/testsuite/mutate.test
index 5efc96a..b650d0d 100755
--- a/testsuite/mutate.test
+++ b/testsuite/mutate.test
@@ -1,9 +1,11 @@
#! /bin/sh -e
# librsync -- the library for network deltas
-#
# Copyright (C) 2001, 2014 by Martin Pool <mbp@sourcefrog.net>
-#
+
+# mutate.test: Make some deterministic pseudorandom changes to a file and
+# compute deltas across them.
+
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
@@ -42,11 +44,14 @@ while test $i -lt 100
do
perl "$srcdir/mutate.pl" $i 5 <"$old" >"$new" 2>>"$tmpdir/mutate.log"
- run_test ../rdiff $debug signature $old $sig
- run_test ../rdiff $debug delta $sig $new $delta
- run_test ../rdiff $debug patch $old $delta "$out"
+ for hashopt in '' -Hmd4 -Hblake2
+ do
+ run_test ../rdiff $debug signature $old $sig
+ run_test ../rdiff $debug delta $sig $new $delta
+ run_test ../rdiff $debug patch $old $delta "$out"
- check_compare "$new" "$out" "mutate $i $old $new"
+ check_compare "$new" "$out" "mutate $i $old $new"
+ done
i=`expr $i + 1`
done
diff --git a/testsuite/signature.test b/testsuite/signature.test
index 9b1d2e5..57320c7 100755
--- a/testsuite/signature.test
+++ b/testsuite/signature.test
@@ -6,7 +6,7 @@
# output: this is supposed to check that it remains compatible with previous
# versions.
-# Copyright (C) 2001 by Martin Pool <mbp@sourcefrog.net>
+# Copyright (C) 2001, 2014 by Martin Pool <mbp@sourcefrog.net>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
diff --git a/testsuite/sources.test b/testsuite/sources.test
index eeba691..88b3e04 100755
--- a/testsuite/sources.test
+++ b/testsuite/sources.test
@@ -1,9 +1,10 @@
#! /bin/sh -e
# librsync -- the library for network deltas
-#
# Copyright (C) 2001, 2014 by Martin Pool <mbp@sourcefrog.net>
-#
+
+# sources.test: Run three-way tests on all librsync source files.
+
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
@@ -29,8 +30,12 @@ do
test ! -r $new && continue
test ! -r $old && continue
test -n "$stats" && echo $old $new
- triple_test $buf $old $new
- triple_test $buf $new $old
+
+ for hashopt in '' -Hmd4 -Hblake2
+ do
+ triple_test $buf $old $new $hashopt
+ triple_test $buf $new $old $hashopt
+ done
done
done
done
diff --git a/testsuite/testcommon.sh b/testsuite/testcommon.sh
index 8bf9e66..84839c2 100644
--- a/testsuite/testcommon.sh
+++ b/testsuite/testcommon.sh
@@ -76,11 +76,12 @@ triple_test () {
buf="$1"
old="$2"
new="$3"
+ hashopt="$4"
- run_test ../rdiff $debug -I$buf -O$buf $stats signature --block-size=$block_len \
+ run_test ../rdiff $debug $hashopt -I$buf -O$buf $stats signature --block-size=$block_len \
$old $tmpdir/sig
- run_test ../rdiff $debug -I$buf -O$buf $stats delta $tmpdir/sig $new $tmpdir/delta
- run_test ../rdiff $debug -I$buf -O$buf $stats patch $old $tmpdir/delta $tmpdir/new
+ run_test ../rdiff $debug $hashopt -I$buf -O$buf $stats delta $tmpdir/sig $new $tmpdir/delta
+ run_test ../rdiff $debug $hashopt -I$buf -O$buf $stats patch $old $tmpdir/delta $tmpdir/new
check_compare $new $tmpdir/new "triple -I$buf -O$buf $old $new"
}
diff --git a/testsuite/triple.test b/testsuite/triple.test
index 37f758f..3cec31b 100755
--- a/testsuite/triple.test
+++ b/testsuite/triple.test
@@ -27,12 +27,14 @@ do
do
for new in $inputdir/*.in
do
- run_test ../rdiff $debug -I$buf -O$buf signature $old $tmpdir/sig
- run_test ../rdiff $debug -I$buf -O$buf delta $tmpdir/sig $new $tmpdir/delta
- run_test ../rdiff $debug -I$buf -O$buf patch $old $tmpdir/delta $tmpdir/new
-
- check_compare $new $tmpdir/new "triple -I$buf -O$buf $old $new"
+ for hashopt in $all_hashopts
+ do
+ run_test ../rdiff $debug $hashopt -I$buf -O$buf signature $old $tmpdir/sig
+ run_test ../rdiff $debug $hashopt -I$buf -O$buf delta $tmpdir/sig $new $tmpdir/delta
+ run_test ../rdiff $debug $hashopt -I$buf -O$buf patch $old $tmpdir/delta $tmpdir/new
+ check_compare $new $tmpdir/new "triple -I$buf -O$buf $old $new"
+ done
done
done
done