annotate tests/0040/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 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