The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
"Mat Gessel" <mat.ges... @gmail.com>
Date: Mon, 14 Aug 2006 12:54:28 -0700
Local: Mon, Aug 14 2006 3:54 pm
Subject: JUnit and float values
This bug still exists in 1.1: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa... Consider passing the following values to assertEquals: 0.0, 0.0, 0.0 (false failure) 1.0, 2.0, 0.1 (false pass) -1.0, -2.0, 0.1 (false pass)
Assert super-source:
static public void assertEquals(String str, float obj1, float obj2, float delta) { if (obj1 - obj2 < delta || obj2 - obj1 < delta) { return; } else { fail(str + " expected=" + obj1 + " actual=" + obj2 + " delta=" + delta); } }
I suggested a better implementation in the linked post.
-- Mat Gessel http://www.asquare.net
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Scott Blum" <sco... @google.com>
Date: Mon, 14 Aug 2006 16:07:36 -0700
Local: Mon, Aug 14 2006 7:07 pm
Subject: Re: JUnit and float values
Wish I hadn't missed the thread you linked! Good catch. --Scott
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Mat Gessel" <mat.ges... @gmail.com>
Date: Tue, 15 Aug 2006 12:15:58 -0700
Local: Tues, Aug 15 2006 3:15 pm
Subject: Re: JUnit and float values
The fix I previously suggested was flawed as well. A corrected version is attached, along with a test case. -= Mat
-- Mat Gessel http://www.asquare.net
On 8/14/06, Scott Blum <sco... @google.com> wrote:
> Wish I hadn't missed the thread you linked! Good catch.
> --Scott
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Konstantin Scheglov" <Konstantin.Scheg... @gmail.com>
Date: Tue, 15 Aug 2006 19:20:38 -0000
Local: Tues, Aug 15 2006 3:20 pm
Subject: Re: JUnit and float values
Scott Blum wrote: > Wish I hadn't missed the thread you linked! Good catch.
Setup public Bugzilla and you will not lost bug reports from users. In Eclipse newsgroups developers always tell us, users - don't post bug reports in newsgroup, we can just forget about them, post them in bugzilla and we will find them.
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Scott Blum" <sco... @google.com>
Date: Tue, 15 Aug 2006 12:32:49 -0700
Local: Tues, Aug 15 2006 3:32 pm
Subject: Re: JUnit and float values
Nice work, Mat. I'm incorporating your test case into an existing on. Your fix looks good except I think that should be a "<= delta" instead of a "< delta".
This is the code I think I'm going to commit:
static public void assertEquals(String str, double obj1, double obj2, double delta) { if (obj1 == obj2) { return; } else if (Math.abs(obj1 - obj2) <= delta) { return; } else { fail(str + " expected=" + obj1 + " actual=" + obj2 + " delta=" + delta); } }
static public void assertEquals(String str, float obj1, float obj2, float delta) { if (obj1 == obj2) { return; } else if (Math.abs(obj1 - obj2) <= delta) { return; } else { fail(str + " expected=" + obj1 + " actual=" + obj2 + " delta=" + delta); } }
--Scott
You must
Sign in before you can post messages.
You do not have the permission required to post.