You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (Reopened) (JIRA)" <ji...@apache.org> on 2011/12/22 22:33:33 UTC

[jira] [Reopened] (SOLR-2451) Enhance SolrTestCaseJ4 to allow tests to account for small deltas when comparing floats/doubles

     [ https://issues.apache.org/jira/browse/SOLR-2451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley reopened SOLR-2451:
--------------------------------


Delta support was added bit it wasn't completed.  In particular, a custom delta provided is ignored, and instead you get the one provided as the default.  Furthermore, the condition in which delta is actually looked at wasn't quite right with respect to the Number subclass of "val" and "expected" subclasses.  In a minute I will attach a patch fixing it.
                
> Enhance SolrTestCaseJ4 to allow tests to account for small deltas when comparing floats/doubles
> -----------------------------------------------------------------------------------------------
>
>                 Key: SOLR-2451
>                 URL: https://issues.apache.org/jira/browse/SOLR-2451
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Assignee: Hoss Man
>            Priority: Minor
>             Fix For: 3.2, 4.0
>
>         Attachments: SOLR-2451.patch, SOLR-2451.patch, SOLR-2451_assertQScore.patch
>
>
> Attached is a patch that adds the following method to SolrTestCaseJ4:  (just javadoc & signature shown)
> {code:java}
>   /**
>    * Validates that the document at the specified index in the results has the specified score, within 0.0001.
>    */
>   public static void assertQScore(SolrQueryRequest req, int docIdx, float targetScore) {
> {code}
> This is especially useful for geospatial in which slightly different precision deltas might occur when trying different geospatial indexing strategies are used, assuming the score is some geospatial distance.  This patch makes a simple modification to DistanceFunctionTest to use it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org