annotate tests/0030/run-test.sh @ 171:bb934f91d85c powertable

Web services interface to the powertable functionality. * Implemented as a completely new SOAP method, called sequenceQuery * lightly tested with http://doc.gold.ac.uk/~mas01cr/poweradb.php (lacuna: need to pass relative-threshold and absolute-threshold always, even when they don't make sense.) Several uglinesses in the code, some of which will be resolved once all the various branches are merged into the trunk.
author mas01cr
date Wed, 14 Nov 2007 14:00:53 +0000
parents 9dbff8fea81d
children fe4dc39b2dd7
rev   line source
mas01cr@163 1 #! /bin/sh
mas01cr@163 2
mas01cr@163 3 . ../test-utils.sh
mas01cr@163 4
mas01cr@163 5 if [ -f testdb ]; then rm -f testdb; fi
mas01cr@163 6
mas01cr@163 7 ${AUDIODB} -d testdb -N
mas01cr@163 8
mas01cr@163 9 intstring 2 > testfeature
mas01cr@163 10 floatstring 0 1 >> testfeature
mas01cr@163 11 floatstring 1 0 >> testfeature
mas01cr@163 12 floatstring 1 0 >> testfeature
mas01cr@163 13 floatstring 0 1 >> testfeature
mas01cr@163 14
mas01cr@163 15 intstring 1 > testpower
mas01cr@163 16 floatstring -0.5 >> testpower
mas01cr@163 17 floatstring -1 >> testpower
mas01cr@163 18 floatstring -1 >> testpower
mas01cr@163 19 floatstring -0.5 >> testpower
mas01cr@163 20
mas01cr@163 21 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01cr@163 22 ${AUDIODB} -d testdb -P
mas01cr@163 23 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature
mas01cr@163 24 ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01cr@163 25
mas01cr@163 26 # sequence queries require L2NORM
mas01cr@163 27 ${AUDIODB} -d testdb -L
mas01cr@163 28
mas01cr@163 29 echo "query points (0.0,0.5),(0.0,0.5),(0.5,0.0)"
mas01cr@163 30 intstring 2 > testquery
mas01cr@163 31 floatstring 0 0.5 >> testquery
mas01cr@163 32 floatstring 0 0.5 >> testquery
mas01cr@163 33 floatstring 0.5 0 >> testquery
mas01cr@163 34
mas01cr@163 35 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -R 0.1 > testoutput
mas01cr@163 36 echo testfeature 1 > test-expected-output
mas01cr@163 37 cmp testoutput test-expected-output
mas01cr@163 38 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -p 0 -R 0.1 > testoutput
mas01cr@163 39 echo testfeature 1 > test-expected-output
mas01cr@163 40 cmp testoutput test-expected-output
mas01cr@163 41 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -p 1 -R 0.1 > testoutput
mas01cr@163 42 echo testfeature 1 > test-expected-output
mas01cr@163 43 cmp testoutput test-expected-output
mas01cr@163 44
mas01cr@163 45 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -p 0 -R 1.1 > testoutput
mas01cr@163 46 echo testfeature 1 > test-expected-output
mas01cr@163 47 cmp testoutput test-expected-output
mas01cr@163 48 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -p 0 -R 0.9 > testoutput
mas01cr@163 49 cat /dev/null > test-expected-output
mas01cr@163 50 cmp testoutput test-expected-output
mas01cr@163 51 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -p 1 -R 0.9 > testoutput
mas01cr@163 52 echo testfeature 1 > test-expected-output
mas01cr@163 53 cmp testoutput test-expected-output
mas01cr@163 54
mas01cr@163 55 echo "query points (0.0,0.5)p=-0.5,(0.0,0.5)p=-1,(0.5,0.0)p=-1"
mas01cr@163 56
mas01cr@163 57 intstring 1 > testquerypower
mas01cr@163 58 floatstring -0.5 -1 -1 >> testquerypower
mas01cr@163 59
mas01cr@163 60 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testquerypower --absolute-threshold=-1.4 -p 0 -R 1.1 > testoutput
mas01cr@163 61 echo testfeature 1 > test-expected-output
mas01cr@163 62 cmp testoutput test-expected-output
mas01cr@163 63 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testquerypower --absolute-threshold=-0.8 -p 0 -R 1.1 > testoutput
mas01cr@163 64 echo testfeature 1 > test-expected-output
mas01cr@163 65 cmp testoutput test-expected-output
mas01cr@163 66 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testquerypower --absolute-threshold=-0.7 -p 0 -R 1.1 > testoutput
mas01cr@163 67 cat /dev/null > test-expected-output
mas01cr@163 68 cmp testoutput test-expected-output
mas01cr@163 69
mas01cr@163 70 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testquerypower --absolute-threshold=-1.4 -p 1 -R 0.9 > testoutput
mas01cr@163 71 echo testfeature 1 > test-expected-output
mas01cr@163 72 cmp testoutput test-expected-output
mas01cr@163 73 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testquerypower --absolute-threshold=-0.9 -p 1 -R 0.9 > testoutput
mas01cr@163 74 cat /dev/null > test-expected-output
mas01cr@163 75 cmp testoutput test-expected-output
mas01cr@163 76
mas01cr@163 77 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testquerypower --relative-threshold=0.1 -p 0 -R 1.1 > testoutput
mas01cr@163 78 echo testfeature 1 > test-expected-output
mas01cr@163 79 cmp testoutput test-expected-output
mas01cr@163 80
mas01cr@163 81 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testquerypower --relative-threshold=0.1 -p 0 -R 0.9 > testoutput
mas01cr@163 82 cat /dev/null > test-expected-output
mas01cr@163 83 cmp testoutput test-expected-output
mas01cr@163 84
mas01cr@163 85 exit 104