use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CounterImplTest method testGetInstance3.
@Test
public void testGetInstance3() {
ICounter c = CounterImpl.getInstance(15, 12);
ICounter copy = CounterImpl.getInstance(c);
assertEquals(27, copy.getTotalCount());
assertEquals(27.0, c.getValue(CounterValue.TOTALCOUNT), 0.0);
assertEquals(15, copy.getMissedCount());
assertEquals(15.0, c.getValue(CounterValue.MISSEDCOUNT), 0.0);
assertEquals(12, copy.getCoveredCount());
assertEquals(12.0, c.getValue(CounterValue.COVEREDCOUNT), 0.0);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CounterImplTest method testToString.
@Test
public void testToString() {
ICounter c = CounterImpl.getInstance(300, 123);
assertEquals("Counter[300/123]", c.toString());
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CounterImplTest method testGetInstance2.
@Test
public void testGetInstance2() {
ICounter c = CounterImpl.getInstance(33, 15);
assertEquals(48, c.getTotalCount());
assertEquals(48.0, c.getValue(CounterValue.TOTALCOUNT), 0.0);
assertEquals(33, c.getMissedCount());
assertEquals(33.0, c.getValue(CounterValue.MISSEDCOUNT), 0.0);
assertEquals(15, c.getCoveredCount());
assertEquals(15.0, c.getValue(CounterValue.COVEREDCOUNT), 0.0);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CounterImplTest method testGetCoveredRatio2.
@Test
public void testGetCoveredRatio2() {
ICounter c = CounterImpl.getInstance(20, 0);
assertEquals(0.0, c.getCoveredRatio(), 0.0);
assertEquals(0.0, c.getValue(CounterValue.COVEREDRATIO), 0.0);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CounterImplTest method testGetMissedRatio3.
@Test
public void testGetMissedRatio3() {
ICounter c = CounterImpl.getInstance(0, 0);
assertEquals(Double.NaN, c.getMissedRatio(), 0.0);
assertEquals(Double.NaN, c.getValue(CounterValue.MISSEDRATIO), 0.0);
}
Aggregations