1 | #!/bin/sh
|
---|
2 | #/* Author : Rick van der Zwet
|
---|
3 | # * S-number : 0433373
|
---|
4 | # * Version : $Id: HOWTO.txt 325 2007-11-23 21:17:22Z rick $
|
---|
5 | # * Copyright : FreeBSD Licence
|
---|
6 | # */
|
---|
7 |
|
---|
8 | TMPFILE="`dirname $0`/testing"
|
---|
9 |
|
---|
10 | rm -f $TMPFILE
|
---|
11 | numbers="97 98 97 10 99 256 261 257 258 342 10"
|
---|
12 | echo -n "Odd: "
|
---|
13 | in=`./write12 $TMPFILE $numbers | tr -d '\n'`
|
---|
14 | out=`./read12 $TMPFILE | tr -d '\n'`
|
---|
15 | if [ "$in" = "$out" ]; then
|
---|
16 | rm -f $TMPFILE
|
---|
17 | echo "PASS"
|
---|
18 | else
|
---|
19 | echo "FAILED"
|
---|
20 | exit 1
|
---|
21 | fi
|
---|
22 |
|
---|
23 | rm -f $TMPFILE
|
---|
24 | numbers="97 98 97 10 99 256 261 257 258 342 10 230 19"
|
---|
25 | echo -n "Even: "
|
---|
26 | in=`./write12 $TMPFILE $numbers | tr -d '\n'`
|
---|
27 | out=`./read12 $TMPFILE | tr -d '\n'`
|
---|
28 | if [ "$in" = "$out" ]; then
|
---|
29 | rm -f $TMPFILE
|
---|
30 | echo "PASS"
|
---|
31 | else
|
---|
32 | echo "FAILED"
|
---|
33 | exit 1
|
---|
34 | fi
|
---|
35 |
|
---|
36 | rm -f "$TMPFILE.com" "$TMPFILE.dec" $TMPFILE
|
---|
37 | string="abaabcabababaaad"
|
---|
38 | echo "$string" > $TMPFILE
|
---|
39 | ./compressie $TMPFILE "$TMPFILE.com"
|
---|
40 | ./decompressie "$TMPFILE.com" "$TMPFILE.dec"
|
---|
41 | out=`cat $TMPFILE.dec`
|
---|
42 |
|
---|
43 | echo -n "Com/de '$string': "
|
---|
44 | if [ "$string" = "$out" ]; then
|
---|
45 | rm -f $TMPFILE "$TMPFILE.com" "$TMPFILE.dec"
|
---|
46 | echo "PASS"
|
---|
47 | else
|
---|
48 | echo "FAILED"
|
---|
49 | exit 1
|
---|
50 | fi
|
---|
51 |
|
---|
52 | FILE='./trie07.ps'
|
---|
53 | rm -f "$TMPFILE.com" "$TMPFILE.dec" $TMPFILE
|
---|
54 | ./compressie $FILE "$TMPFILE.com"
|
---|
55 | ./decompressie "$TMPFILE.com" "$TMPFILE.dec"
|
---|
56 | diff -q $FILE "$TMPFILE.dec"
|
---|
57 | if [ $? -eq 0 ]; then
|
---|
58 | rm -f $TMPFILE "$TMPFILE.com" "$TMPFILE.dec"
|
---|
59 | echo "echo Com/de '$FILE' PASS"
|
---|
60 | else
|
---|
61 | echo "echo Com/de '$FILE' PASS"
|
---|
62 | exit 1
|
---|
63 | fi
|
---|
64 |
|
---|
65 |
|
---|