|
Re: assertEquals("NaN", x, y, 0.0) where x=y=Double.NaN: msg#00172java.junit.user
The test I have that's doing what I want looks like this: public void assertEqualsNaN(String str, double exp, double val, double tol){ if(Double.isNaN(exp)) assertTrue(str, Double.isNaN(val)); else assertEquals(str, exp, val, tol); } It's only problem is that I'm adding it to every TestCase thats using it and when it fails it gives me the code line of the assert statments here and not the line in the test itself. (I could encapsulated JUnits TestCase into my own MortensTestCase and add the assertEqualsNaN there but I haven't. All my test inherit from TestCase directly.) Morten > -----Original Message----- > From: kentlbeck [mailto:kentbeck@xxxxxxx] > Sent: 24 June 2002 20:33 > To: junit@xxxxxxxxxxxxxxx > Subject: [junit] Re: assertEquals("NaN", x, y, 0.0) where x=y=Double.NaN > > > --- In junit@xxxx, tumb@xxxx wrote: > > > > The way things currently work is the way the double class works. > > This 'patch' would seem to violate the basic contract of double. > > > > Does assertEquals return true when both objects are null? > > From junit.tests.framework.AssertTest > public void testAssertEqualsNull() { > assertEquals(null, null); > } > > > > > I don't know your procedure for deciding on changes or fixes. Is > there > > some way to discuss and determine whether or not this fix is proper > or > > that the current behavior is better? > > Submit a test (like the one above) and we can discuss it. Without the > test it's hard to know precisely what you mean. > > Kent > > > > To unsubscribe from this group, send an email to: > junit-unsubscribe@xxxxxxxxxxxxxxx > > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ > >
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: 3.8 candidate, kentlbeck |
|---|---|
| Next by Date: | Re: distinguishing between failures and errors, pholser |
| Previous by Thread: | Re: assertEquals("NaN", x, y, 0.0) where x=y=Double.NaN, kentlbeck |
| Next by Thread: | Error on Junit install, Sarah Barwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |