annotate tests/0027/run-test.sh @ 409:99e6cbad7f76 api-inversion

The lesser of two evils, part 2. Implement paths through audiodb_insert_datum_internal() for databases with O2_FLAG_LARGE_ADB, including in some of the helper functions. Most of the nasty stuff is concentrated in writing out the paths in what is now step 6, and everything else looks much as before, apart from a renumbering of the steps taken. Now we can implement audiodb_insert() for O2_FLAG_LARGE_ADB databases; we need to construct an adb_datum_internal_t from our adb_insert_t, but that's straightforward -- even just about straightforward enough to do it inline. Then audioDB::batchinsert() can be rewritten completely in terms of API functions, and doesn't need any kind of special treatment for the large case. Hooray. The real point of that is of course that we can now delete wodges of dead code, and move out audioDB::insert and audioDB::batchinsert into audioDB.cpp, because all they're doing now is dealing with command-line logic. This point marks the limit of what can be achieved in terms of "API inversion" at this time; the only remaining function, audiodb_query() / audioDB::query cannot be inverted because its API implementation is incomplete. Future plans, in some order: - merge this branch to trunk (check with current API/ABI clients); - complete audiodb_query() implementation; - invert audioDB::query / audiodb_query(); - MORE TESTS; - remove audioDB.cpp from list of files compiled into the library; - implement missing API functions (index, liszt, sample) directly; - source code rearrangement into library and command-line directories; - include bindings to library for some plausible candidate environments (Perl, Python, Lisp, Pd, Max/MSP) as examples; - API documentation.
author mas01cr
date Tue, 09 Dec 2008 22:48:30 +0000
parents fe4dc39b2dd7
children
rev   line source
mas01cr@252 1 #! /bin/bash
mas01cr@193 2
mas01cr@193 3 . ../test-utils.sh
mas01cr@193 4
mas01cr@193 5 if [ -f testdb ]; then rm -f testdb; fi
mas01cr@193 6
mas01cr@193 7 ${AUDIODB} -d testdb -N
mas01cr@193 8
mas01cr@193 9 intstring 2 > testfeature
mas01cr@193 10 floatstring 0 1 >> testfeature
mas01cr@193 11 floatstring 1 0 >> testfeature
mas01cr@193 12
mas01cr@193 13 intstring 1 > testpower
mas01cr@193 14 floatstring -0.5 >> testpower
mas01cr@193 15 floatstring -1 >> testpower
mas01cr@193 16
mas01cr@193 17 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01cr@193 18
mas01cr@193 19 ${AUDIODB} -d testdb -P
mas01cr@193 20
mas01cr@193 21 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature
mas01cr@193 22
mas01cr@193 23 ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01cr@193 24
mas01cr@193 25 # sequence queries require L2NORM
mas01cr@193 26 ${AUDIODB} -d testdb -L
mas01cr@193 27
mas01cr@193 28 # queries without power files should run as before
mas01cr@193 29 echo "query point (0.0,0.5)"
mas01cr@193 30 intstring 2 > testquery
mas01cr@193 31 floatstring 0 0.5 >> testquery
mas01cr@193 32
mas01cr@193 33 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery > testoutput
mas01cr@193 34 echo testfeature 1 0 0 > test-expected-output
mas01cr@193 35 cmp testoutput test-expected-output
mas01cr@193 36 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -n 1 > testoutput
mas01cr@193 37 echo testfeature 0 0 0 > test-expected-output
mas01cr@193 38 cmp testoutput test-expected-output
mas01cr@193 39
mas01cr@193 40 echo "query point (0.5,0.0)"
mas01cr@193 41 intstring 2 > testquery
mas01cr@193 42 floatstring 0.5 0 >> testquery
mas01cr@193 43
mas01cr@193 44 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery > testoutput
mas01cr@193 45 echo testfeature 1 0 1 > test-expected-output
mas01cr@193 46 cmp testoutput test-expected-output
mas01cr@193 47 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -n 1 > testoutput
mas01cr@193 48 echo testfeature 0 0 1 > test-expected-output
mas01cr@193 49 cmp testoutput test-expected-output
mas01cr@193 50
mas01cr@193 51 # queries with power files might do something different
mas01cr@193 52 echo "query point (0.0,0.5), p=-0.5"
mas01cr@193 53 intstring 2 > testquery
mas01cr@193 54 floatstring 0 0.5 >> testquery
mas01cr@193 55
mas01cr@193 56 intstring 1 > testquerypower
mas01cr@193 57 floatstring -0.5 >> testquerypower
mas01cr@193 58
mas01cr@193 59 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-1.4 > testoutput
mas01cr@193 60 echo testfeature 1 0 0 > test-expected-output
mas01cr@193 61 cmp testoutput test-expected-output
mas01cr@193 62
mas01cr@193 63 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.6 > testoutput
mas01cr@193 64 echo testfeature 0 0 0 > test-expected-output
mas01cr@193 65 cmp testoutput test-expected-output
mas01cr@193 66
mas01cr@193 67 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.2 > testoutput
mas01cr@193 68 cat /dev/null > test-expected-output
mas01cr@193 69 cmp testoutput test-expected-output
mas01cr@193 70
mas01cr@193 71 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=1 > testoutput
mas01cr@193 72 echo testfeature 1 0 0 > test-expected-output
mas01cr@193 73 cmp testoutput test-expected-output
mas01cr@193 74
mas01cr@193 75 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=0.2 > testoutput
mas01cr@193 76 echo testfeature 0 0 0 > test-expected-output
mas01cr@193 77 cmp testoutput test-expected-output
mas01cr@193 78
mas01cr@193 79 echo "query point (0.5,0.0), p=-0.5"
mas01cr@193 80 intstring 2 > testquery
mas01cr@193 81 floatstring 0.5 0 >> testquery
mas01cr@193 82
mas01cr@193 83 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-1.4 > testoutput
mas01cr@193 84 echo testfeature 1 0 1 > test-expected-output
mas01cr@193 85 cmp testoutput test-expected-output
mas01cr@193 86
mas01cr@193 87 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.6 > testoutput
mas01cr@193 88 echo testfeature 2 0 0 > test-expected-output
mas01cr@193 89 cmp testoutput test-expected-output
mas01cr@193 90
mas01cr@193 91 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.2 > testoutput
mas01cr@193 92 cat /dev/null > test-expected-output
mas01cr@193 93 cmp testoutput test-expected-output
mas01cr@193 94
mas01cr@193 95 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=1 > testoutput
mas01cr@193 96 echo testfeature 1 0 1 > test-expected-output
mas01cr@193 97 cmp testoutput test-expected-output
mas01cr@193 98
mas01cr@193 99 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=0.2 > testoutput
mas01cr@193 100 echo testfeature 2 0 0 > test-expected-output
mas01cr@193 101 cmp testoutput test-expected-output
mas01cr@193 102
mas01cr@193 103 exit 104