]> git.llucax.com Git - z.facultad/75.52/treemulator.git/commitdiff
Bugfix del test.sh para que no 'oculte' errores por SIGSEGV.
authorLeandro Lucarella <luca@llucax.hn.org>
Sun, 30 Oct 2005 01:54:46 +0000 (01:54 +0000)
committerLeandro Lucarella <luca@llucax.hn.org>
Sun, 30 Oct 2005 01:54:46 +0000 (01:54 +0000)
test/test.sh [new file with mode: 0644]

diff --git a/test/test.sh b/test/test.sh
new file mode 100644 (file)
index 0000000..6d9ac58
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+bloques_hasta=2
+altas_hasta=2
+
+[ -n $1 ] || bloques_hasta=$1
+[ -n $2 ] || altas_hasta=$2
+
+numero()
+{
+       cifras=$1
+       echo -n 1
+       for i in `seq 1 $cifras`
+       do
+               echo -n 0
+       done
+}
+
+result=0
+for i in `seq -2 $bloques_hasta`
+do
+       echo "Bloque: $i"
+       for j in `seq 0 $altas_hasta`
+       do
+               a=`numero $j`
+               echo -e "\tAltas: $a"
+               for k in `seq 0 $j`
+               do
+                       b=`numero $k`
+                       echo -e "\t\tBajas: $b"
+                       echo -ne "\t\t\tClave fija....... "
+                       ../src/btree $i $a $b > /tmp/btree_test
+                       if [ $? == 0 ]
+                       then
+                               grep Miss /tmp/btree_test | grep -q '[1-9]'
+                               if [ $? != 0 ]
+                               then
+                                       echo 'OK!'
+                               else
+                                       echo 'ERROR!'
+                                       result=$(($result+1))
+                               fi
+                       else
+                               echo 'ERROR!'
+                               result=$(($result+1))
+                       fi
+                       echo -ne "\t\t\tClave variable... "
+                       ../src/btree_var $i $a $b > /tmp/btree_test
+                       if [ $? == 0 ]
+                       then
+                               grep Miss /tmp/btree_test | grep -q '[1-9]'
+                               if [ $? != 0 ]
+                               then
+                                       echo 'OK!'
+                               else
+                                       echo 'ERROR!'
+                                       result=$(($result+1))
+                               fi
+                       else
+                               echo 'ERROR!'
+                               result=$(($result+1))
+                       fi
+               done
+       done
+done
+
+exit $result