diff libtests/test_utils_lib.h @ 379:7e6c99481b8b

Fix two more tests * testoneradiusresult() was comparing the wrong fields; * there was a stray power flag in libtests/0030 (I am a little bit suspicious of the reuse of the "myadbquery" variable within a single test; I don't see anything that clears out old values from the struct, so subsequent calls will retain them. It might be that those old values are harmless, but I think this calls for a bit of test file reworking...)
author mas01cr
date Sun, 16 Nov 2008 21:18:40 +0000
parents 94c18f128ce8
children e072aa1611f5 342822c2d49a
line wrap: on
line diff
--- a/libtests/test_utils_lib.h	Sun Nov 16 21:18:34 2008 +0000
+++ b/libtests/test_utils_lib.h	Sun Nov 16 21:18:40 2008 +0000
@@ -6,7 +6,7 @@
 int testoneresult(adb_queryresult_ptr myadbqueryresult, int i, char * Rlist, double Dist,double Qpos,double Spos);
 double doubleabs(double foo);
 void maketestfile(char * filename, int * ivals, double * dvals, int dvalsize);
-int testoneradiusresult(adb_queryresult_ptr myadbqueryresult, int i, char * Rlist, double Dist);
+int testoneradiusresult(adb_queryresult_ptr myadbqueryresult, int i, char * Rlist, int count);
 void makekeylistfile(char * filename, char * item);
 
 
@@ -149,29 +149,21 @@
 }
 
 
-int testoneradiusresult(adb_queryresult_ptr myadbqueryresult, int i, char * Rlist, double Dist){
+int testoneradiusresult(adb_queryresult_ptr myadbqueryresult, int i, char * Rlist, int count){
 
     int ret=0;
-    double tolerance=.0001;
 
-
-    
     if (strcmp(Rlist,myadbqueryresult->Rlist[i])){
         ret=-1;
     } 
 
-
-    if (doubleabs((double)Dist - (double)myadbqueryresult->Dist[i]) > tolerance){
+    /* KLUDGE: at the moment, the structure returned from "sequence"
+       queries with a radius has two unused fields, Dist and Qpos, and
+       the Spos field is punned to indicate the count of hits from
+       that track.  This is really ugly and needs to die. */
+    if (count != myadbqueryresult->Spos[i]) {
         ret=-1;
     } 
-    
-    //if (doubleabs((double)Qpos - (double)myadbqueryresult->Qpos[i]) > tolerance){
-    //    ret=-1;
-    //} 
-
-    //if (doubleabs((double)Spos - (double)myadbqueryresult->Spos[i]) > tolerance){
-    //    ret=-1;
-    //} 
 
     return ret;
 }