mas01cr@252: #! /bin/bash mas01cr@96: mas01cr@96: . ../test-utils.sh mas01cr@96: mas01cr@96: if [ -f testdb ]; then rm -f testdb; fi mas01cr@96: mas01cr@96: ${AUDIODB} -d testdb -N mas01cr@96: mas01cr@96: # tests that the lack of -l when the query sequence is shorter doesn't mas01cr@96: # segfault. mas01cr@96: mas01cr@96: intstring 2 > testfeature mas01cr@96: floatstring 0 1 >> testfeature mas01cr@96: floatstring 1 0 >> testfeature mas01cr@96: mas01cr@96: ${AUDIODB} -d testdb -I -f testfeature mas01cr@96: mas01cr@96: # sequence queries require L2NORM mas01cr@96: ${AUDIODB} -d testdb -L mas01cr@96: mas01cr@96: start_server ${AUDIODB} 10017 mas01cr@96: mas01cr@96: echo "query point (0.0,0.5)" mas01cr@96: intstring 2 > testquery mas01cr@96: floatstring 0 0.5 >> testquery mas01cr@96: mas01cr@96: # FIXME: this actually revealed a horrible failure mode of the server: mas01cr@96: # since we were throwing exceptions from the constructor, the mas01cr@96: # destructor wasn't getting called and so we were retaining 2Gb of mas01cr@96: # address space, leading to immediate out of memory errors for the mas01cr@96: # /second/ call. We fix that by being a bit more careful about our mas01cr@96: # exception handling and cleanup discipline, but how to test...? mas01cr@96: mas01cr@96: expect_client_failure ${AUDIODB} -c localhost:10017 -d testdb -Q sequence -f testquery mas01cr@96: expect_client_failure ${AUDIODB} -c localhost:10017 -d testdb -Q sequence -f testquery -n 1 mas01cr@96: mas01cr@96: check_server $! mas01cr@96: mas01cr@96: echo "query point (0.5,0.0)" mas01cr@96: intstring 2 > testquery mas01cr@96: floatstring 0.5 0 >> testquery mas01cr@96: mas01cr@96: expect_client_failure ${AUDIODB} -c localhost:10017 -d testdb -Q sequence -f testquery mas01cr@96: expect_client_failure ${AUDIODB} -c localhost:10017 -d testdb -Q sequence -f testquery -n 1 mas01cr@96: mas01cr@96: check_server $! mas01cr@96: mas01cr@96: # see if the server can actually produce any output at this point mas01cr@96: ${AUDIODB} -c localhost:10017 -d testdb -Q sequence -l 1 -f testquery -n 1 > testoutput mas01cr@96: echo testfeature 0 0 1 > test-expected-output mas01cr@96: cmp testoutput test-expected-output mas01cr@96: mas01cr@96: stop_server $! mas01cr@96: mas01cr@96: exit 104