--- /dev/null
+#!/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