]> icculus.org git repositories - icculus/xz.git/blob - tests/test_files.sh
Added test_files.sh to test decoding of the files in
[icculus/xz.git] / tests / test_files.sh
1 #/bin/sh
2
3 ###############################################################################
4 #
5 #   Copyright (C) 2008 Lasse Collin
6 #
7 #   This library is free software; you can redistribute it and/or
8 #   modify it under the terms of the GNU Lesser General Public
9 #   License as published by the Free Software Foundation; either
10 #   version 2.1 of the License, or (at your option) any later version.
11 #
12 #   This library is distributed in the hope that it will be useful,
13 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 #   Lesser General Public License for more details.
16 #
17 ###############################################################################
18
19 for I in "$srcdir/files/"good-*
20 do
21         if ! ../src/lzmadec/lzmadec "$I" > /dev/null 2> /dev/null ; then
22                 echo "Good file failed: $I"
23                 (exit 1)
24                 exit 1
25         fi
26 done
27
28 for I in "$srcdir/files/"bad-*
29 do
30         if ../src/lzmadec/lzmadec "$I" > /dev/null 2> /dev/null ; then
31                 echo "Bad file succeeded: $I"
32                 (exit 1)
33                 exit 1
34         fi
35 done
36
37 # TODO: Test malicious files too, but with care.
38
39 (exit 0)
40 exit 0