Skip to content

Commit

Permalink
Use isJDKCompiler constant to validate all cases (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchof authored and Godin committed Mar 22, 2017
1 parent 8652078 commit 47094b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Expand Up @@ -41,8 +41,8 @@ public void testCoverageResult() {
assertLine("missedelse", ICounter.NOT_COVERED);

// 4. Missed while block
// ECJ and javac produce different status here
assertLine("whilefalse", 1, 1);
assertLine("whilefalse", isJDKCompiler ? ICounter.FULLY_COVERED
: ICounter.PARTLY_COVERED, 1, 1);
assertLine("missedwhile", ICounter.NOT_COVERED);

// 5. Always true while block
Expand Down
Expand Up @@ -118,8 +118,9 @@ protected void assertLine(final String tag, final int status) {
assertEquals(msg, STATUS_NAME[status], STATUS_NAME[insnStatus]);
}

protected void assertLine(final String tag, final int missedBranches,
final int coveredBranches) {
protected void assertLine(final String tag, final int status,
final int missedBranches, final int coveredBranches) {
assertLine(tag, status);
final int nr = source.getLineNumber(tag);
final ILine line = sourceCoverage.getLine(nr);
final String msg = String.format("Branches in line %s: %s",
Expand All @@ -129,12 +130,6 @@ protected void assertLine(final String tag, final int missedBranches,
line.getBranchCounter());
}

protected void assertLine(final String tag, final int status,
final int missedBranches, final int coveredBranches) {
assertLine(tag, status);
assertLine(tag, missedBranches, coveredBranches);
}

protected void assertLogEvents(String... events) throws Exception {
final Method getter = Class.forName(Stubs.class.getName(), false,
loader).getMethod("getLogEvents");
Expand Down

0 comments on commit 47094b8

Please sign in to comment.