4 # Copyright (C) 2016 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 .
"${srcdir=.}/tests/init.sh"; path_prepend_ .
/src
22 # Ensure we can --check the --tag format we produce
24 for i
in 'a' ' b' '*c' '44' ' '; do
27 b2sum
-l $l --tag "$i" >> check.b2sum
30 # Note -l is infered from the tags in the mixed format file
31 b2sum
--strict -c check.b2sum || fail
=1
32 # Also ensure the openssl tagged variant works
33 sed 's/ //; s/ =/=/' < check.b2sum
> openssl.b2sum || framework_failure_
34 b2sum
--strict -c openssl.b2sum || fail
=1
36 # Ensure we can check non tagged format
38 b2sum
-l $l /dev
/null |
tee -a check.vals
> check.b2sum
39 b2sum
-l $l --strict -c check.b2sum || fail
=1
40 b2sum
--strict -c check.b2sum || fail
=1
43 # Ensure the checksum values are correct. The reference
44 # check.vals was created with the upstream SSE reference implementation.
45 b2sum
-l 128 check.vals
> out || fail
=1
46 printf '%s\n' '796485dd32fe9b754ea5fd6c721271d9 check.vals' > exp
47 compare exp out || fail
=1