annotate tests/0014/run-test.sh @ 458:913a95f06998 api-inversion

Start using the query state structure. Actually using it means moving it around in the source code a little bit, thanks to entanglements. It'll all be alright on the night. Now the accumulator, allowed_keys and exact_evaluation_queue are all part of the query state, and can therefore be passed around with minimal effort (and deleted in the appropriate place). Now a whole bunch of static methods (the callbacks, basically) in index.cpp can be rewritten as plain old C functions. The callbacks need both an adb_t and a query state structure to function (the adb_t to get at things like lsh_n_point_bits and the track->key table; the qstate to get at the accumulator and allowed_keys list). Rearrange audioDB::query a little bit, and mark the beginning and the end of the putative audiodb_query_spec() API function implementation.
author mas01cr
date Sun, 28 Dec 2008 18:44:08 +0000
parents fe4dc39b2dd7
children
rev   line source
mas01cr@252 1 #! /bin/bash
mas01cr@88 2
mas01cr@88 3 . ../test-utils.sh
mas01cr@88 4
mas01cr@88 5 if [ -f testdb ]; then rm -f testdb; fi
mas01cr@88 6
mas01cr@88 7 ${AUDIODB} -d testdb -N
mas01cr@88 8
mas01cr@239 9 ${AUDIODB} -d testdb -L
mas01cr@239 10
mas01cr@88 11 intstring 2 > testfeature
mas01cr@88 12 floatstring 0 1 >> testfeature
mas01cr@88 13 floatstring 1 0 >> testfeature
mas01cr@88 14
mas01cr@88 15 ${AUDIODB} -d testdb -I -f testfeature
mas01cr@88 16
mas01cr@88 17 echo "query point (0.0,0.5)"
mas01cr@88 18 intstring 2 > testquery
mas01cr@88 19 floatstring 0 0.5 >> testquery
mas01cr@88 20
mas01cr@88 21 start_server ${AUDIODB} 10014
mas01cr@88 22
mas01cr@88 23 ${AUDIODB} -c localhost:10014 -d testdb -Q point -f testquery > testoutput
mas01cr@88 24 echo testfeature 0.5 0 0 > test-expected-output
mas01cr@88 25 echo testfeature 0 0 1 >> test-expected-output
mas01cr@88 26 cmp testoutput test-expected-output
mas01cr@88 27 ${AUDIODB} -c localhost:10014 -d testdb -Q point -f testquery -n 1 > testoutput
mas01cr@88 28 echo testfeature 0.5 0 0 > test-expected-output
mas01cr@88 29 cmp testoutput test-expected-output
mas01cr@88 30
mas01cr@88 31 check_server $!
mas01cr@88 32
mas01cr@88 33 echo "query point (0.5,0.0)"
mas01cr@88 34 intstring 2 > testquery
mas01cr@88 35 floatstring 0.5 0 >> testquery
mas01cr@88 36
mas01cr@88 37 ${AUDIODB} -c localhost:10014 -d testdb -Q point -f testquery > testoutput
mas01cr@88 38 echo testfeature 0.5 0 1 > test-expected-output
mas01cr@88 39 echo testfeature 0 0 0 >> test-expected-output
mas01cr@88 40 cmp testoutput test-expected-output
mas01cr@88 41 ${AUDIODB} -c localhost:10014 -d testdb -Q point -f testquery -n 1 > testoutput
mas01cr@88 42 echo testfeature 0.5 0 1 > test-expected-output
mas01cr@88 43 cmp testoutput test-expected-output
mas01cr@88 44
mas01cr@88 45 stop_server $!
mas01cr@88 46
mas01cr@88 47 exit 104