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