Mercurial > hg > audiodb
comparison tests/0033/run-test.sh @ 186:d5ae11d6cd2c no-big-mmap
Query -K tests.
All currently failing, as there's an off-by-one error in the
handling of the keylist file.
author | mas01cr |
---|---|
date | Fri, 16 Nov 2007 16:27:28 +0000 |
parents | |
children | fe4dc39b2dd7 |
comparison
equal
deleted
inserted
replaced
185:ae212368a874 | 186:d5ae11d6cd2c |
---|---|
1 #! /bin/sh | |
2 | |
3 . ../test-utils.sh | |
4 | |
5 if [ -f testdb ]; then rm -f testdb; fi | |
6 | |
7 ${AUDIODB} -d testdb -N | |
8 | |
9 intstring 2 > testfeature01 | |
10 floatstring 0 1 >> testfeature01 | |
11 intstring 2 > testfeature10 | |
12 floatstring 1 0 >> testfeature10 | |
13 | |
14 ${AUDIODB} -d testdb -I -f testfeature01 | |
15 ${AUDIODB} -d testdb -I -f testfeature10 | |
16 | |
17 # sequence queries require L2NORM | |
18 ${AUDIODB} -d testdb -L | |
19 | |
20 echo "query point (0.0,0.5)" | |
21 intstring 2 > testquery | |
22 floatstring 0 0.5 >> testquery | |
23 | |
24 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput | |
25 echo testfeature01 1 > test-expected-output | |
26 echo testfeature10 1 >> test-expected-output | |
27 cmp testoutput test-expected-output | |
28 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K /dev/null -R 5 > testoutput | |
29 cat /dev/null > test-expected-output | |
30 cmp testoutput test-expected-output | |
31 | |
32 echo testfeature01 > testkl.txt | |
33 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -R 5 > testoutput | |
34 echo testfeature01 1 > test-expected-output | |
35 cmp testoutput test-expected-output | |
36 echo testfeature10 > testkl.txt | |
37 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -R 5 > testoutput | |
38 echo testfeature10 1 > test-expected-output | |
39 cmp testoutput test-expected-output | |
40 | |
41 echo testfeature10 > testkl.txt | |
42 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -r 1 -R 5 > testoutput | |
43 echo testfeature10 1 > test-expected-output | |
44 cmp testoutput test-expected-output | |
45 | |
46 # NB: one might be tempted to insert a test here for having both keys | |
47 # in the keylist, but in non-database order, and then checking that | |
48 # the result list is also in that non-database order. I think that | |
49 # would be misguided, as the efficient way of dealing with such a | |
50 # keylist is to advance as-sequentially-as-possible through the | |
51 # database; it just so happens that our current implementation is not | |
52 # so smart. | |
53 | |
54 echo "query point (0.5,0.0)" | |
55 intstring 2 > testquery | |
56 floatstring 0.5 0 >> testquery | |
57 | |
58 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput | |
59 echo testfeature01 1 > test-expected-output | |
60 echo testfeature10 1 >> test-expected-output | |
61 cmp testoutput test-expected-output | |
62 | |
63 echo testfeature10 > testkl.txt | |
64 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -K testkl.txt -r 1 -R 5 > testoutput | |
65 echo testfeature10 1 > test-expected-output | |
66 cmp testoutput test-expected-output | |
67 | |
68 exit 104 |