You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Dawid Weiss <da...@gmail.com> on 2013/11/22 13:24:29 UTC

Re: svn commit: r1544504 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java

This is a reversible conversion, Erick. So you can just take the raw
long value and convert it back to a double on any machine using
Double.longBitsToDouble (or something, didn't check for actual method
name).

In my opinion the test is depending on some ordering that fails under jdk8/ ibm.

Dawid

On Fri, Nov 22, 2013 at 1:08 PM,  <er...@apache.org> wrote:
> Author: erick
> Date: Fri Nov 22 12:08:01 2013
> New Revision: 1544504
>
> URL: http://svn.apache.org/r1544504
> Log:
> Added "human readable" output to the failing test.
>
> Modified:
>     lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java
>
> Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java?rev=1544504&r1=1544503&r2=1544504&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java (original)
> +++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java Fri Nov 22 12:08:01 2013
> @@ -226,7 +226,9 @@ public class NoFacetTest extends Abstrac
>      Double floatTest = (Double)calculateNumberStat(floatTestStart, "stddev");
>      assertTrue("Oops: (double raws) " + Double.doubleToRawLongBits(floatResult) + " - "
>          + Double.doubleToRawLongBits(floatTest) + " < " + Double.doubleToRawLongBits(.00000000001) +
> -        " Calculated diff " + Double.doubleToRawLongBits(floatResult - floatTest),
> +        " Calculated diff " + Double.doubleToRawLongBits(floatResult - floatTest)
> +        + " Let's see what the JVM thinks these bits are. FloatResult:  " + floatResult.toString() +
> +        " floatTest: " + floatTest.toString() + " Diff " + Double.toString(floatResult - floatTest),
>          Math.abs(floatResult - floatTest) < .00000000001);
>
>
>
>

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


Re: svn commit: r1544504 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java

Posted by Erick Erickson <er...@gmail.com>.
Yep, I'm just lazy. And this code is all coming out whenever we get a
resolution anyway.



On Fri, Nov 22, 2013 at 7:24 AM, Dawid Weiss <da...@gmail.com> wrote:

> This is a reversible conversion, Erick. So you can just take the raw
> long value and convert it back to a double on any machine using
> Double.longBitsToDouble (or something, didn't check for actual method
> name).
>
> In my opinion the test is depending on some ordering that fails under
> jdk8/ ibm.
>
> Dawid
>
> On Fri, Nov 22, 2013 at 1:08 PM,  <er...@apache.org> wrote:
> > Author: erick
> > Date: Fri Nov 22 12:08:01 2013
> > New Revision: 1544504
> >
> > URL: http://svn.apache.org/r1544504
> > Log:
> > Added "human readable" output to the failing test.
> >
> > Modified:
> >
> lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java
> >
> > Modified:
> lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java
> > URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java?rev=1544504&r1=1544503&r2=1544504&view=diff
> >
> ==============================================================================
> > ---
> lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java
> (original)
> > +++
> lucene/dev/trunk/solr/core/src/test/org/apache/solr/analytics/NoFacetTest.java
> Fri Nov 22 12:08:01 2013
> > @@ -226,7 +226,9 @@ public class NoFacetTest extends Abstrac
> >      Double floatTest = (Double)calculateNumberStat(floatTestStart,
> "stddev");
> >      assertTrue("Oops: (double raws) " +
> Double.doubleToRawLongBits(floatResult) + " - "
> >          + Double.doubleToRawLongBits(floatTest) + " < " +
> Double.doubleToRawLongBits(.00000000001) +
> > -        " Calculated diff " + Double.doubleToRawLongBits(floatResult -
> floatTest),
> > +        " Calculated diff " + Double.doubleToRawLongBits(floatResult -
> floatTest)
> > +        + " Let's see what the JVM thinks these bits are. FloatResult:
>  " + floatResult.toString() +
> > +        " floatTest: " + floatTest.toString() + " Diff " +
> Double.toString(floatResult - floatTest),
> >          Math.abs(floatResult - floatTest) < .00000000001);
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>