annotate tests/0035/run-test.sh @ 279:dee55886eca0 sampling

make the RNG a part of the audioDB object. Easier to deal with memory discipline and initialization (though note the FIXME comment in audioDB::initTables()). Also initialize the RNG from the current time. A mature implementation would use a proper source of entropy...
author mas01cr
date Wed, 02 Jul 2008 13:53:23 +0000
parents fe4dc39b2dd7
children
rev   line source
mas01cr@252 1 #! /bin/bash
mas01cr@239 2
mas01cr@239 3 . ../test-utils.sh
mas01cr@239 4
mas01cr@239 5 if [ -f testdb ]; then rm -f testdb; fi
mas01cr@239 6
mas01cr@239 7 ${AUDIODB} -d testdb -N
mas01cr@239 8
mas01cr@239 9 intstring 2 > testfeature1
mas01cr@239 10 floatstring 0 1 >> testfeature1
mas01cr@239 11 intstring 2 > testfeature3
mas01cr@239 12 floatstring 1 0 >> testfeature3
mas01cr@239 13 floatstring 0 1 >> testfeature3
mas01cr@239 14 floatstring 1 0 >> testfeature3
mas01cr@239 15
mas01cr@239 16 ${AUDIODB} -d testdb -I -f testfeature1
mas01cr@239 17 ${AUDIODB} -d testdb -I -f testfeature3
mas01cr@239 18
mas01cr@239 19 # sequence queries require L2NORM
mas01cr@239 20 ${AUDIODB} -d testdb -L
mas01cr@239 21
mas01cr@239 22 echo "query point (0 1, 1 0)"
mas01cr@239 23 intstring 2 > testquery
mas01cr@239 24 floatstring 0 1 >> testquery
mas01cr@239 25 floatstring 1 0 >> testquery
mas01cr@239 26
mas01cr@239 27 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -n 1 > testoutput
mas01cr@239 28 wc -l testoutput | grep "1 testoutput"
mas01cr@239 29 grep "^testfeature3 .* 0 1$" testoutput
mas01cr@239 30
mas01cr@239 31 exit 104