aboutsummaryrefslogtreecommitdiff
path: root/tests/test_files.sh
blob: ee5f7bd24ad4d6d3bcd70981d88c5cdefdd73445 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#/bin/sh

###############################################################################
#
#   Copyright (C) 2008 Lasse Collin
#
#   This library 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 the License, or (at your option) any later version.
#
#   This library is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   Lesser General Public License for more details.
#
###############################################################################

for I in "$srcdir/files/"good-*
do
	if ! ../src/lzmadec/lzmadec "$I" > /dev/null 2> /dev/null ; then
		echo "Good file failed: $I"
		(exit 1)
		exit 1
	fi
done

for I in "$srcdir/files/"bad-*
do
	if ../src/lzmadec/lzmadec "$I" > /dev/null 2> /dev/null ; then
		echo "Bad file succeeded: $I"
		(exit 1)
		exit 1
	fi
done

# TODO: Test malicious files too, but with care.

(exit 0)
exit 0