-
Bug
-
Resolution: Fixed
-
P4
-
fx2.0
The following test case will generate a failure despite all values being in range. The problem is that sometimes float->double->int conversions implicit in the math of the interpolate function can generate values every so slightly out of range...
@Test
public void testOfTheWayAll() {
List<Color> colors = new ArrayList<Color>();
for (Field f : Color.class.getDeclaredFields()) {
if (Modifier.isStatic(f.getModifiers()) &&
f.getType() == Color.class)
{
try {
colors.add((Color) f.get(null));
} catch (IllegalArgumentException ex) {
} catch (IllegalAccessException ex) {
}
}
}
System.out.println("colors: "+colors.size());
for (Color c1 : colors) {
for (Color c2 : colors) {
c1.interpolate(c2, 0.0);
c1.interpolate(c2, 0.5);
c1.interpolate(c2, 1.0);
}
}
}
@Test
public void testOfTheWayAll() {
List<Color> colors = new ArrayList<Color>();
for (Field f : Color.class.getDeclaredFields()) {
if (Modifier.isStatic(f.getModifiers()) &&
f.getType() == Color.class)
{
try {
colors.add((Color) f.get(null));
} catch (IllegalArgumentException ex) {
} catch (IllegalAccessException ex) {
}
}
}
System.out.println("colors: "+colors.size());
for (Color c1 : colors) {
for (Color c2 : colors) {
c1.interpolate(c2, 0.0);
c1.interpolate(c2, 0.5);
c1.interpolate(c2, 1.0);
}
}
}