Search in sources :

Example 6 with ICounter

use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.

the class CounterImplTest method testGetCoveredRatio3.

@Test
public void testGetCoveredRatio3() {
    ICounter c = CounterImpl.getInstance(0, 0);
    assertEquals(Double.NaN, c.getCoveredRatio(), 0.0);
    assertEquals(Double.NaN, c.getValue(CounterValue.COVEREDRATIO), 0.0);
}
Also used : ICounter(org.jacoco.core.analysis.ICounter) Test(org.junit.Test)

Example 7 with ICounter

use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.

the class CounterImplTest method testGetInstance1.

@Test
public void testGetInstance1() {
    ICounter c = CounterImpl.getInstance(0, 0);
    assertEquals(0, c.getTotalCount());
    assertEquals(0.0, c.getValue(CounterValue.TOTALCOUNT), 0.0);
    assertEquals(0, c.getMissedCount());
    assertEquals(0.0, c.getValue(CounterValue.MISSEDCOUNT), 0.0);
    assertEquals(0, c.getCoveredCount());
    assertEquals(0.0, c.getValue(CounterValue.COVEREDCOUNT), 0.0);
}
Also used : ICounter(org.jacoco.core.analysis.ICounter) Test(org.junit.Test)

Example 8 with ICounter

use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.

the class CounterImplTest method testGetMissedRatio1.

@Test
public void testGetMissedRatio1() {
    ICounter c = CounterImpl.getInstance(10, 30);
    assertEquals(0.25, c.getMissedRatio(), 0.0);
    assertEquals(0.25, c.getValue(CounterValue.MISSEDRATIO), 0.0);
}
Also used : ICounter(org.jacoco.core.analysis.ICounter) Test(org.junit.Test)

Example 9 with ICounter

use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.

the class CounterImplTest method testGetCoveredRatio1.

@Test
public void testGetCoveredRatio1() {
    ICounter c = CounterImpl.getInstance(30, 10);
    assertEquals(0.25, c.getCoveredRatio(), 0.0);
    assertEquals(0.25, c.getValue(CounterValue.COVEREDRATIO), 0.0);
}
Also used : ICounter(org.jacoco.core.analysis.ICounter) Test(org.junit.Test)

Example 10 with ICounter

use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.

the class CounterImplTest method testEquals3.

@Test
public void testEquals3() {
    ICounter c1 = CounterImpl.getInstance(300, 123);
    ICounter c2 = CounterImpl.getInstance(300, 124);
    assertFalse(c1.equals(c2));
}
Also used : ICounter(org.jacoco.core.analysis.ICounter) Test(org.junit.Test)

Aggregations

ICounter (org.jacoco.core.analysis.ICounter)50 Test (org.junit.Test)40 CounterEntity (org.jacoco.core.analysis.ICoverageNode.CounterEntity)2 FileWriter (java.io.FileWriter)1 PrintWriter (java.io.PrintWriter)1 Collection (java.util.Collection)1 List (java.util.List)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 IBundleCoverage (org.jacoco.core.analysis.IBundleCoverage)1 IClassCoverage (org.jacoco.core.analysis.IClassCoverage)1 ILine (org.jacoco.core.analysis.ILine)1 IMethodCoverage (org.jacoco.core.analysis.IMethodCoverage)1 IPackageCoverage (org.jacoco.core.analysis.IPackageCoverage)1 ISourceFileCoverage (org.jacoco.core.analysis.ISourceFileCoverage)1 Instruction (org.jacoco.core.internal.flow.Instruction)1 IReportVisitor (org.jacoco.report.IReportVisitor)1 ISourceFileLocator (org.jacoco.report.ISourceFileLocator)1 AbstractInsnNode (org.objectweb.asm.tree.AbstractInsnNode)1