annotate tests/0040/run-test.sh @ 453:16a903968d18 api-inversion

Almost finish with audioDB::query_loop. This patch is a little bit noisy, because we rename adb->keys to adb->keymap, introduce a new vector adb->keys (essentially to replace fileTable), and introduce new functionality (both include and exclude keylists in adb_query_refine_t) as well as modifying the query_loop function itself to take advantage of all of these goodies. Oh, and we also fix an embarrassing state bug in adb->track_offsets for insert -- what was I thinking? (Thank you, regression test suites). Since we are on a private branch at the moment, we can take the luxury of renumbering the ADB_REFINE_ flags to include the exclude list at the logical place; once we have an ABI to support, that won't be possible. Now audioDB::query builds up include and exclude lists as appropriate; query_loop does an [O(NlogN) probably] buildup of the keys to consider, and then iterates over tracks sequentially, seeking only if one or more tracks have been excluded. No more trackFile, yay! The only remaining thing to deal with is the accumulator. It's easy enough to pass it around, but I want to read the indexed version before doing so to see how that all fits together.
author mas01cr
date Wed, 24 Dec 2008 10:57:14 +0000
parents a0493f861531
children
rev   line source
mas01mc@327 1 #! /bin/bash
mas01mc@327 2
mas01mc@327 3 . ../test-utils.sh
mas01mc@327 4
mas01mc@327 5 if [ -f testdb ]; then rm -f testdb; fi
mas01mc@327 6
mas01mc@327 7 ${AUDIODB} -d testdb -N
mas01mc@327 8
mas01mc@327 9 intstring 2 > testfeature
mas01mc@327 10 floatstring 0 1 >> testfeature
mas01mc@327 11 floatstring 1 0 >> testfeature
mas01mc@327 12 floatstring 1 0 >> testfeature
mas01mc@327 13 floatstring 0 1 >> testfeature
mas01mc@327 14
mas01mc@327 15 intstring 1 > testpower
mas01mc@327 16 floatstring -0.5 >> testpower
mas01mc@327 17 floatstring -1 >> testpower
mas01mc@327 18 floatstring -1 >> testpower
mas01mc@327 19 floatstring -0.5 >> testpower
mas01mc@327 20
mas01mc@327 21 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01mc@327 22 ${AUDIODB} -d testdb -P
mas01mc@327 23 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature
mas01mc@327 24 ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01mc@327 25
mas01mc@327 26 # sequence queries require L2NORM
mas01mc@327 27 ${AUDIODB} -d testdb -L
mas01mc@327 28
mas01mc@327 29 echo "query points (0.0,0.5),(0.0,0.5),(0.5,0.0)"
mas01mc@327 30 intstring 2 > testquery
mas01mc@327 31 floatstring 0 0.5 >> testquery
mas01mc@327 32 floatstring 0 0.5 >> testquery
mas01mc@327 33 floatstring 0.5 0 >> testquery
mas01mc@327 34
mas01mc@327 35 # LSH Indexing tests
mas01mc@327 36
mas01mc@327 37 # Indexing requires a radius (-R)
mas01mc@327 38 expect_clean_error_exit ${AUDIODB} -d testdb -X -l 1
mas01mc@327 39
mas01mc@327 40 # Index with default LSH params
mas01mc@327 41 ${AUDIODB} -d testdb -X -l 1 -R 1
mas01mc@327 42
mas01mc@327 43 # Query using the index
mas01mc@332 44
mas01mc@327 45 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -R 1 > testoutput
mas01mc@327 46 echo testfeature 1 > test-expected-output
mas01mc@327 47 cmp testoutput test-expected-output
mas01mc@327 48
mas01mc@327 49 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -p 0 -R 1 > testoutput
mas01mc@327 50 echo testfeature 1 > test-expected-output
mas01mc@327 51 cmp testoutput test-expected-output
mas01mc@327 52
mas01mc@327 53 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -p 1 -R 1 > testoutput
mas01mc@327 54 echo testfeature 1 > test-expected-output
mas01mc@327 55 cmp testoutput test-expected-output
mas01mc@327 56
mas01mc@332 57 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -e -R 1 > testoutput
mas01mc@332 58 echo testfeature 3 > test-expected-output
mas01mc@332 59 cmp testoutput test-expected-output
mas01mc@332 60
mas01mc@332 61 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -e -R 1 --lsh_exact > testoutput
mas01mc@332 62 echo testfeature 3 > test-expected-output
mas01mc@332 63 cmp testoutput test-expected-output
mas01mc@332 64
mas01mc@327 65 # make index, sequenceLength=2
mas01mc@327 66 ${AUDIODB} -d testdb -X -l 2 -R 1
mas01mc@327 67
mas01mc@327 68 # query, sequenceLength=2
mas01mc@327 69 ${AUDIODB} -d testdb -Q sequence -l 2 -f testquery -w testpower -p 0 -R 1 > testoutput
mas01mc@327 70 echo testfeature 1 > test-expected-output
mas01mc@327 71 cmp testoutput test-expected-output
mas01mc@327 72
mas01mc@327 73 exit 104