svn-gvsig-desktop / trunk / libraries / libFMap / src-test / com / iver / cit / gvsig / fmap / rendering / FIntervalTest.java @ 38080
History | View | Annotate | Download (666 Bytes)
1 |
package com.iver.cit.gvsig.fmap.rendering; |
---|---|
2 |
|
3 |
import junit.framework.TestCase; |
4 |
|
5 |
public class FIntervalTest extends TestCase { |
6 |
|
7 |
private static final double DELTA = 0.000001; |
8 |
|
9 |
public void testNegativeIntervals() throws Exception { |
10 |
testNegativeInterval("-2.1--1.1", -2, -1.1); |
11 |
testNegativeInterval("-2.1-1.1", -2.1, 1.1); |
12 |
testNegativeInterval("2.1--1", 2.1, -1); |
13 |
testNegativeInterval("1.1-2", 1.1, 2); |
14 |
} |
15 |
|
16 |
private void testNegativeInterval(String intervalString, double min, |
17 |
double max) {
|
18 |
FInterval interval = (FInterval) FInterval.create(intervalString); |
19 |
assertTrue(interval.getMin() - min < DELTA); |
20 |
assertTrue(interval.getMax() - max < DELTA); |
21 |
} |
22 |
} |