logo       

assertEquals("NaN", x, y, 0.0) where x=y=Double.NaN: msg#00153

java.junit.user

Subject: assertEquals("NaN", x, y, 0.0) where x=y=Double.NaN

Hi

x and y are both simple double.

Oughtn't assertEquals("x and y", x, y, 0.0) succeed when both x and y are
Double.NaN?

At the moment I'm having to make a situation specific assert statement when
I expect y is Double.NaN.

I'm having to write ...
assertTrue("When y is NaN", Double.isNaN(y));

I know java returns false on (Double.NaN==y) even when y is Double.NaN, but
for our assert statements I'd say it'd be more practical/general if
assertEquals succeeded when both were NaN.

Thanks
Morten

========================================
Morten Grum
PH-Consult
Ordruphøjvej 4
2920 Charlottenlund
Denmark

Tel.: +45 39 96 22 08
Mob.: +45 40 93 43 84
Fax.: +45 39 63 02 72
Mail: mg@xxxxxx
Web : www.phc.dk
========================================




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise