source: liacs/da/opdr2b/test.sh@ 240

Last change on this file since 240 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

  • Property svn:executable set to *
File size: 1.4 KB
Line 
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
8TMPFILE="`dirname $0`/testing"
9
10rm -f $TMPFILE
11numbers="97 98 97 10 99 256 261 257 258 342 10"
12echo -n "Odd: "
13in=`./write12 $TMPFILE $numbers | tr -d '\n'`
14out=`./read12 $TMPFILE | tr -d '\n'`
15if [ "$in" = "$out" ]; then
16 rm -f $TMPFILE
17 echo "PASS"
18else
19 echo "FAILED"
20 exit 1
21fi
22
23rm -f $TMPFILE
24numbers="97 98 97 10 99 256 261 257 258 342 10 230 19"
25echo -n "Even: "
26in=`./write12 $TMPFILE $numbers | tr -d '\n'`
27out=`./read12 $TMPFILE | tr -d '\n'`
28if [ "$in" = "$out" ]; then
29 rm -f $TMPFILE
30 echo "PASS"
31else
32 echo "FAILED"
33 exit 1
34fi
35
36rm -f "$TMPFILE.com" "$TMPFILE.dec" $TMPFILE
37string="abaabcabababaaad"
38echo "$string" > $TMPFILE
39./compressie $TMPFILE "$TMPFILE.com"
40./decompressie "$TMPFILE.com" "$TMPFILE.dec"
41out=`cat $TMPFILE.dec`
42
43echo -n "Com/de '$string': "
44if [ "$string" = "$out" ]; then
45 rm -f $TMPFILE "$TMPFILE.com" "$TMPFILE.dec"
46 echo "PASS"
47else
48 echo "FAILED"
49 exit 1
50fi
51
52FILE='./trie07.ps'
53rm -f "$TMPFILE.com" "$TMPFILE.dec" $TMPFILE
54./compressie $FILE "$TMPFILE.com"
55./decompressie "$TMPFILE.com" "$TMPFILE.dec"
56diff -q $FILE "$TMPFILE.dec"
57if [ $? -eq 0 ]; then
58 rm -f $TMPFILE "$TMPFILE.com" "$TMPFILE.dec"
59 echo "echo Com/de '$FILE' PASS"
60else
61 echo "echo Com/de '$FILE' PASS"
62 exit 1
63fi
64
65
Note: See TracBrowser for help on using the repository browser.