Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.LinesImpl


  @Test
  public void testIncrement4() {
    // 1: N + F = P
    // ============
    // 1 total, 1 covered
    LinesImpl c = new LinesImpl(new int[] { 1 }, false);
    c.increment(new LinesImpl(new int[] { 1 }, true));
    assertEquals(1, c.getTotalCount(), 0.0);
    assertEquals(1, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(1, c.getLastLine(), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
  }
View Full Code Here


    // 3: . + . = .
    // 4: . + P = P
    // 5: P + P = P
    // ============
    // 4 total, 4 covered
    LinesImpl c = createPartyCovered(1, 2, 5);
    c.increment(createPartyCovered(1, 4, 5));
    assertEquals(4, c.getTotalCount(), 0.0);
    assertEquals(4, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(5, c.getLastLine(), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(2), 0.0);
    assertEquals(NO_CODE, c.getStatus(3), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(4), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(5), 0.0);
  }
View Full Code Here

  @Test
  public void testIncrement6() {
    // 1: P + N = P
    // ============
    // 1 total, 1 covered
    LinesImpl c = createPartyCovered(1);
    c.increment(new LinesImpl(new int[] { 1 }, false));
    assertEquals(1, c.getTotalCount(), 0.0);
    assertEquals(1, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(1, c.getLastLine(), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
  }
View Full Code Here

  @Test
  public void testIncrement7() {
    // 1: N + P = P
    // ============
    // 1 total, 1 covered
    LinesImpl c = new LinesImpl(new int[] { 1 }, false);
    c.increment(createPartyCovered(1));
    assertEquals(1, c.getTotalCount(), 0.0);
    assertEquals(1, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(1, c.getLastLine(), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
  }
View Full Code Here

  @Test
  public void testIncrement8() {
    // 1: P + F = P
    // ============
    // 1 total, 1 covered
    LinesImpl c = createPartyCovered(1);
    c.increment(new LinesImpl(new int[] { 1 }, true));
    assertEquals(1, c.getTotalCount(), 0.0);
    assertEquals(1, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(1, c.getLastLine(), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
  }
View Full Code Here

  @Test
  public void testIncrement9() {
    // 1: F + P = P
    // ============
    // 1 total, 1 covered
    LinesImpl c = new LinesImpl(new int[] { 1 }, true);
    c.increment(createPartyCovered(1));
    assertEquals(1, c.getTotalCount(), 0.0);
    assertEquals(1, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(1, c.getLastLine(), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
  }
View Full Code Here

    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
  }

  @Test
  public void testIncrementEmpty() {
    LinesImpl c = new LinesImpl(new int[] { 1 }, true);
    c.increment(new LinesImpl());
    assertEquals(1, c.getTotalCount(), 0.0);
    assertEquals(1, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(1, c.getLastLine(), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(1), 0.0);
  }
View Full Code Here

    // 1: . + F = F
    // 2: F + F = F
    // 3: F + F = F
    // ============
    // 3 total, 3 covered
    LinesImpl c = new LinesImpl(new int[] { 2, 3 }, true);
    c.increment(new LinesImpl(new int[] { 1, 2, 3 }, true));
    assertEquals(3, c.getTotalCount(), 0.0);
    assertEquals(3, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(3, c.getLastLine(), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(1), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(2), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(3), 0.0);
  }
View Full Code Here

    // 1: F + F = F
    // 2: F + F = F
    // 3: . + F = F
    // ============
    // 3 total, 3 covered
    LinesImpl c = new LinesImpl(new int[] { 1, 2 }, true);
    c.increment(new LinesImpl(new int[] { 1, 2, 3 }, true));
    assertEquals(3, c.getTotalCount(), 0.0);
    assertEquals(3, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(3, c.getLastLine(), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(1), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(2), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(3), 0.0);
  }
View Full Code Here

    // 1: . + F = F
    // 2: F + F = F
    // 3: . + F = F
    // ============
    // 3 total, 3 covered
    LinesImpl c = new LinesImpl(new int[] { 2 }, true);
    c.increment(new LinesImpl(new int[] { 1, 2, 3 }, true));
    assertEquals(3, c.getTotalCount(), 0.0);
    assertEquals(3, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(3, c.getLastLine(), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(1), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(2), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(3), 0.0);
  }
View Full Code Here

TOP

Related Classes of org.jacoco.core.analysis.LinesImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.