changeset 325:57fde215d913

Fixed indexing error in non-large ADB introduced with large ADB.
author mas01mc
date Fri, 29 Aug 2008 16:39:53 +0000
parents c93be2f3a674
children d70d5804a283
files index.cpp tests/0020/run-test.sh
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/index.cpp	Thu Aug 21 21:28:33 2008 +0000
+++ b/index.cpp	Fri Aug 29 16:39:53 2008 +0000
@@ -91,12 +91,14 @@
     error("INDEXed database must be power-enabled", dbName);
   }
 
-  double *snpp = *snp, *sppp = 0;
+  double *snpp = 0, *sppp = 0;
 
   *dvp = dbH->length / (dbH->dim * sizeof(double)); // number of database vectors
   *snp = new double[*dvp];  // songs norm pointer: L2 norm table for each vector
+  snpp = *snp;
   *spp = new double[*dvp]; // song powertable pointer
   sppp = *spp;
+
   memcpy(*snp, l2normTable, *dvp * sizeof(double));
   memcpy(*spp, powerTable, *dvp * sizeof(double));
   
--- a/tests/0020/run-test.sh	Thu Aug 21 21:28:33 2008 +0000
+++ b/tests/0020/run-test.sh	Fri Aug 29 16:39:53 2008 +0000
@@ -24,11 +24,12 @@
 floatstring 0 0.5 >> testquery
 
 ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput
-echo testfeature01 1 > test-expected-output
-echo testfeature10 1 >> test-expected-output
+echo testfeature01 0 0 0 > test-expected-output
+echo testfeature10 2 0 0 >> test-expected-output
 cmp testoutput test-expected-output
+
 ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -r 1 -R 5 > testoutput
-echo testfeature01 1 > test-expected-output
+echo testfeature01 0 0 0 > test-expected-output
 cmp testoutput test-expected-output
 
 check_server $!
@@ -43,9 +44,10 @@
 # results...
 
 ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput
-echo testfeature01 1 > test-expected-output
-echo testfeature10 1 >> test-expected-output
+echo testfeature01 0 0 0> test-expected-output
+echo testfeature10 2 0 0>> test-expected-output
 cmp testoutput test-expected-output
+
 ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -r 1 -R 5 > testoutput
 echo testfeature01 1 > test-expected-output
 cmp testoutput test-expected-output