annotate tests/0033/run-test.sh @ 187:530154ca4cf5 no-big-mmap

Wow, two changes for the price of one * remove dataBuf usage from trackPointQuery() * make the restrict-list tests pass: ** lseek() to the right place if we're actually not doing tracks in sequential-order; ** deal with the off-by-one error in reading in lines from trackFile.
author mas01cr
date Fri, 16 Nov 2007 16:31:36 +0000
parents d5ae11d6cd2c
children fe4dc39b2dd7
rev   line source
mas01cr@186 1 #! /bin/sh
mas01cr@186 2
mas01cr@186 3 . ../test-utils.sh
mas01cr@186 4
mas01cr@186 5 if [ -f testdb ]; then rm -f testdb; fi
mas01cr@186 6
mas01cr@186 7 ${AUDIODB} -d testdb -N
mas01cr@186 8
mas01cr@186 9 intstring 2 > testfeature01
mas01cr@186 10 floatstring 0 1 >> testfeature01
mas01cr@186 11 intstring 2 > testfeature10
mas01cr@186 12 floatstring 1 0 >> testfeature10
mas01cr@186 13
mas01cr@186 14 ${AUDIODB} -d testdb -I -f testfeature01
mas01cr@186 15 ${AUDIODB} -d testdb -I -f testfeature10
mas01cr@186 16
mas01cr@186 17 # sequence queries require L2NORM
mas01cr@186 18 ${AUDIODB} -d testdb -L
mas01cr@186 19
mas01cr@186 20 echo "query point (0.0,0.5)"
mas01cr@186 21 intstring 2 > testquery
mas01cr@186 22 floatstring 0 0.5 >> testquery
mas01cr@186 23
mas01cr@186 24 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput
mas01cr@186 25 echo testfeature01 1 > test-expected-output
mas01cr@186 26 echo testfeature10 1 >> test-expected-output
mas01cr@186 27 cmp testoutput test-expected-output
mas01cr@186 28 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K /dev/null -R 5 > testoutput
mas01cr@186 29 cat /dev/null > test-expected-output
mas01cr@186 30 cmp testoutput test-expected-output
mas01cr@186 31
mas01cr@186 32 echo testfeature01 > testkl.txt
mas01cr@186 33 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -R 5 > testoutput
mas01cr@186 34 echo testfeature01 1 > test-expected-output
mas01cr@186 35 cmp testoutput test-expected-output
mas01cr@186 36 echo testfeature10 > testkl.txt
mas01cr@186 37 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -R 5 > testoutput
mas01cr@186 38 echo testfeature10 1 > test-expected-output
mas01cr@186 39 cmp testoutput test-expected-output
mas01cr@186 40
mas01cr@186 41 echo testfeature10 > testkl.txt
mas01cr@186 42 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -r 1 -R 5 > testoutput
mas01cr@186 43 echo testfeature10 1 > test-expected-output
mas01cr@186 44 cmp testoutput test-expected-output
mas01cr@186 45
mas01cr@186 46 # NB: one might be tempted to insert a test here for having both keys
mas01cr@186 47 # in the keylist, but in non-database order, and then checking that
mas01cr@186 48 # the result list is also in that non-database order. I think that
mas01cr@186 49 # would be misguided, as the efficient way of dealing with such a
mas01cr@186 50 # keylist is to advance as-sequentially-as-possible through the
mas01cr@186 51 # database; it just so happens that our current implementation is not
mas01cr@186 52 # so smart.
mas01cr@186 53
mas01cr@186 54 echo "query point (0.5,0.0)"
mas01cr@186 55 intstring 2 > testquery
mas01cr@186 56 floatstring 0.5 0 >> testquery
mas01cr@186 57
mas01cr@186 58 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput
mas01cr@186 59 echo testfeature01 1 > test-expected-output
mas01cr@186 60 echo testfeature10 1 >> test-expected-output
mas01cr@186 61 cmp testoutput test-expected-output
mas01cr@186 62
mas01cr@186 63 echo testfeature10 > testkl.txt
mas01cr@186 64 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -r 1 -R 5 > testoutput
mas01cr@186 65 echo testfeature10 1 > test-expected-output
mas01cr@186 66 cmp testoutput test-expected-output
mas01cr@186 67
mas01cr@186 68 exit 104