Closed sammacbeth closed 12 years ago
Specifically, test throws error 'zero norm' for Location.angle(m1, m2)
, the last line of the test. This will be the case when both dx, dy are zero (thus, l1 = l2)
Possibly:
final int dx = Random.randomInt(10) - 5;
int dy = Random.randomInt(10) - 5;
if (dx == dy && dy == 0) dy = 1;
final Location l2 = new Location(x + dx, y + dy);
Edit: Remove final keyword on dy; split dx == dy == 0 into two expressions
Thanks for the fix. I also found there was an occasional assertion error in the same line due to a rounding of the scaled down vector. Commit incoming.
Every so often testDiscreteGetMoveToWithSpeed fails. Either there is an edge case which is failing or a bug in the test.