annotate tests/0021/run-test.sh @ 548:e18843dc0aea

Implement a rudimentary API for audioDB::liszt The API is rudimentary because we've dropped support for the incremental retrieval of tracks and their number of vectors (at the API level; the SOAP and command-line support is still there -- no changes should be visible). This is potentially bad for the large-scale databases, of course; one million tracks will take of the order of 16MB of RAM, more if I'm unlucky about how std::string.c_str() is implemented. Both this liszt operation and querying (and sampling, forthcoming...) would benefit from a `cursor-like' interface to retrieval results: for an API like that, instead of getting a struct with the data there, you get a cookie with which you can ask the database for successive results. This would be neat for all sorts of reasons. In the meantime, at least this change fixes SOAP memory leaks related to liszt. Make liszt.o part of LIBOBJS rather than ordinary OBJS, so that the liszt functionality is actually compiled into the library. Add a test for this library functionality; also modify the command-line test file to run the SOAP server on its own port.
author mas01cr
date Wed, 11 Feb 2009 12:38:03 +0000
parents fe4dc39b2dd7
children
rev   line source
mas01cr@252 1 #! /bin/bash
mas01cr@109 2
mas01cr@109 3 . ../test-utils.sh
mas01cr@109 4
mas01cr@109 5 if [ -f testdb ]; then rm -f testdb; fi
mas01cr@109 6
mas01cr@109 7 ${AUDIODB} -d testdb -N
mas01cr@109 8
mas01cr@109 9 intstring 2 > testfeature
mas01cr@109 10 floatstring 0 0.5 >> testfeature
mas01cr@109 11 floatstring 0.5 0 >> testfeature
mas01cr@109 12
mas01cr@109 13 ${AUDIODB} -d testdb -I -f testfeature
mas01cr@109 14
mas01cr@109 15 # sequence queries require L2NORM
mas01cr@109 16 ${AUDIODB} -d testdb -L
mas01cr@109 17
mas01cr@109 18 start_server ${AUDIODB} 10021
mas01cr@109 19
mas01cr@109 20 echo "query point (0.0,0.5)"
mas01cr@109 21 intstring 2 > testquery
mas01cr@109 22 floatstring 0 0.5 >> testquery
mas01cr@109 23
mas01cr@109 24 ${AUDIODB} -c localhost:10021 -d testdb -Q sequence -l 1 -f testquery > testoutput
mas01cr@109 25 echo testfeature 1 0 0 > test-expected-output
mas01cr@109 26 cmp testoutput test-expected-output
mas01cr@109 27 ${AUDIODB} -c localhost:10021 -d testdb -Q sequence -l 1 -f testquery -n 1 > testoutput
mas01cr@109 28 echo testfeature 0 0 0 > test-expected-output
mas01cr@109 29 cmp testoutput test-expected-output
mas01cr@109 30
mas01cr@109 31 check_server $!
mas01cr@109 32
mas01cr@109 33 echo "query point (0.5,0.0)"
mas01cr@109 34 intstring 2 > testquery
mas01cr@109 35 floatstring 0.5 0 >> testquery
mas01cr@109 36
mas01cr@109 37 ${AUDIODB} -c localhost:10021 -d testdb -Q sequence -l 1 -f testquery > testoutput
mas01cr@109 38 echo testfeature 1 0 1 > test-expected-output
mas01cr@109 39 cmp testoutput test-expected-output
mas01cr@109 40 ${AUDIODB} -c localhost:10021 -d testdb -Q sequence -l 1 -f testquery -n 1 > testoutput
mas01cr@109 41 echo testfeature 0 0 1 > test-expected-output
mas01cr@109 42 cmp testoutput test-expected-output
mas01cr@109 43
mas01cr@109 44 stop_server $!
mas01cr@109 45
mas01cr@109 46 exit 104