aboutsummaryrefslogtreecommitdiff
path: root/tests/test_files.sh
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-07 13:49:19 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-07 13:49:19 +0200
commit908b2ac604b9940369d7fe8a45e9eb6da5d2a24c (patch)
tree0aff78c9e4580f0d8df74895c7f407e3955b6b0e /tests/test_files.sh
parentUpdated README regarding the assembler optimizations. (diff)
downloadxz-908b2ac604b9940369d7fe8a45e9eb6da5d2a24c.tar.xz
Added test_files.sh to test decoding of the files in
the tests/files directory. It doesn't test the malicious files yet.
Diffstat (limited to 'tests/test_files.sh')
-rwxr-xr-xtests/test_files.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/test_files.sh b/tests/test_files.sh
new file mode 100755
index 00000000..ee5f7bd2
--- /dev/null
+++ b/tests/test_files.sh
@@ -0,0 +1,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