degrees + fix for tests
This commit is contained in:
@@ -3,8 +3,8 @@ package org.solovyev.common;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
import org.solovyev.common.utils.Interval;
|
||||
import org.solovyev.common.utils.IntervalImpl;
|
||||
import org.solovyev.common.utils.Mapper;
|
||||
import org.solovyev.common.utils.NumberInterval;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
@@ -17,7 +17,7 @@ public class FloatIntervalMapperTest {
|
||||
public void testParse() throws Exception {
|
||||
final Mapper<Interval<Float>> mapper = new NumberIntervalMapper<Float>(Float.class);
|
||||
|
||||
Assert.assertEquals(new IntervalImpl<Float>(1.2f, 12.2f), mapper.parseValue("1.2;12.2"));
|
||||
Assert.assertEquals(new IntervalImpl<Float>(0f, 0f), mapper.parseValue("0;0"));
|
||||
Assert.assertEquals(new NumberInterval<Float>(1.2f, 12.2f), mapper.parseValue("1.2;12.2"));
|
||||
Assert.assertEquals(new NumberInterval<Float>(0f, 0f), mapper.parseValue("0;0"));
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ public class DiscreteNormalizerTest {
|
||||
|
||||
@Test
|
||||
public void testNormalize() throws Exception {
|
||||
DiscreteNormalizer dn = new DiscreteNormalizer(0, 10, 1);
|
||||
DiscreteNormalizer dn = new DiscreteNormalizer(0, 10, 1d);
|
||||
|
||||
Assert.assertTrue(MathUtils.equals(0, dn.normalize(0.5), 2));
|
||||
Assert.assertTrue(MathUtils.equals(0, dn.normalize(0.99), 2));
|
||||
@@ -25,7 +25,7 @@ public class DiscreteNormalizerTest {
|
||||
|
||||
@Test
|
||||
public void testDenormalize() throws Exception {
|
||||
DiscreteNormalizer dn = new DiscreteNormalizer(0, 10, 1);
|
||||
DiscreteNormalizer dn = new DiscreteNormalizer(0, 10, 1d);
|
||||
|
||||
Assert.assertTrue(MathUtils.equals(0, dn.normalize(dn.denormalize(0)), 2));
|
||||
Assert.assertTrue(MathUtils.equals(0.1, dn.normalize(dn.denormalize(0.1)), 2));
|
||||
|
Reference in New Issue
Block a user