diff options
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java')
-rw-r--r-- | org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java | 60 |
1 files changed, 20 insertions, 40 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java index c1e4172a..8fa8ee44 100644 --- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java +++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java @@ -48,15 +48,11 @@ public class ExceptionsTest extends ValidationTestBase { // 3. Try/Catch Block Without Exception Thrown assertLine("noExceptionTryCatch.beforeBlock", ICounter.FULLY_COVERED); assertLine("noExceptionTryCatch.tryBlock", ICounter.FULLY_COVERED); - if (isJDKCompiler()) { - assertLine("noExceptionTryCatch.catch", - /* partly when ECJ: */ICounter.NOT_COVERED); - } + assertLine("noExceptionTryCatch.catch", + isJDKCompiler ? ICounter.NOT_COVERED : ICounter.PARTLY_COVERED); assertLine("noExceptionTryCatch.catchBlock", ICounter.NOT_COVERED); - if (isJDKCompiler()) { - assertLine("noExceptionTryCatch.catchBlockEnd", - /* empty when ECJ: */ICounter.FULLY_COVERED); - } + assertLine("noExceptionTryCatch.catchBlockEnd", + isJDKCompiler ? ICounter.FULLY_COVERED : ICounter.EMPTY); assertLine("noExceptionTryCatch.afterBlock", ICounter.FULLY_COVERED); // 4. Try/Catch Block With Exception Thrown Implicitly @@ -65,16 +61,12 @@ public class ExceptionsTest extends ValidationTestBase { assertLine("implicitExceptionTryCatch.before", ICounter.FULLY_COVERED); assertLine("implicitExceptionTryCatch.exception", ICounter.NOT_COVERED); assertLine("implicitExceptionTryCatch.after", ICounter.NOT_COVERED); - if (isJDKCompiler()) { - assertLine("implicitExceptionTryCatch.catch", - /* partly when ECJ: */ICounter.FULLY_COVERED); - } + assertLine("implicitExceptionTryCatch.catch", isJDKCompiler + ? ICounter.FULLY_COVERED : ICounter.PARTLY_COVERED); assertLine("implicitExceptionTryCatch.catchBlock", ICounter.FULLY_COVERED); - if (isJDKCompiler()) { - assertLine("implicitExceptionTryCatch.catchBlockEnd", - /* empty when ECJ: */ICounter.NOT_COVERED); - } + assertLine("implicitExceptionTryCatch.catchBlockEnd", + isJDKCompiler ? ICounter.NOT_COVERED : ICounter.EMPTY); assertLine("implicitExceptionTryCatch.afterBlock", ICounter.FULLY_COVERED); @@ -104,15 +96,11 @@ public class ExceptionsTest extends ValidationTestBase { // Finally block is yellow as the exception path is missing. assertLine("noExceptionFinally.beforeBlock", ICounter.FULLY_COVERED); assertLine("noExceptionFinally.tryBlock", ICounter.FULLY_COVERED); - if (isJDKCompiler()) { - assertLine("noExceptionFinally.finally", - /* partly when ECJ: */ICounter.EMPTY); - } + assertLine("noExceptionFinally.finally", + isJDKCompiler ? ICounter.EMPTY : ICounter.PARTLY_COVERED); assertLine("noExceptionFinally.finallyBlock", ICounter.PARTLY_COVERED); - if (isJDKCompiler()) { - assertLine("noExceptionFinally.finallyBlockEnd", - /* not covered when ECJ: */ICounter.FULLY_COVERED); - } + assertLine("noExceptionFinally.finallyBlockEnd", + isJDKCompiler ? ICounter.FULLY_COVERED : ICounter.NOT_COVERED); assertLine("noExceptionFinally.afterBlock", ICounter.FULLY_COVERED); // 8. Finally Block With Implicit Exception @@ -122,16 +110,12 @@ public class ExceptionsTest extends ValidationTestBase { assertLine("implicitExceptionFinally.before", ICounter.FULLY_COVERED); assertLine("implicitExceptionFinally.exception", ICounter.NOT_COVERED); assertLine("implicitExceptionFinally.after", ICounter.NOT_COVERED); - if (isJDKCompiler()) { - assertLine("implicitExceptionFinally.finally", - /* partly when ECJ: */ICounter.EMPTY); - } + assertLine("implicitExceptionFinally.finally", + isJDKCompiler ? ICounter.EMPTY : ICounter.PARTLY_COVERED); assertLine("implicitExceptionFinally.finallyBlock", ICounter.PARTLY_COVERED); - if (isJDKCompiler()) { - assertLine("implicitExceptionFinally.finallyBlockEnd", - /* fully when ECJ: */ICounter.NOT_COVERED); - } + assertLine("implicitExceptionFinally.finallyBlockEnd", + isJDKCompiler ? ICounter.NOT_COVERED : ICounter.FULLY_COVERED); assertLine("implicitExceptionFinally.afterBlock", ICounter.NOT_COVERED); // 9. Finally Block With Exception Thrown Explicitly @@ -139,16 +123,12 @@ public class ExceptionsTest extends ValidationTestBase { ICounter.FULLY_COVERED); assertLine("explicitExceptionFinally.before", ICounter.FULLY_COVERED); assertLine("explicitExceptionFinally.throw", ICounter.FULLY_COVERED); - if (isJDKCompiler()) { - assertLine("explicitExceptionFinally.finally", - /* fully when ECJ: */ICounter.EMPTY); - } + assertLine("explicitExceptionFinally.finally", + isJDKCompiler ? ICounter.EMPTY : ICounter.FULLY_COVERED); assertLine("explicitExceptionFinally.finallyBlock", ICounter.FULLY_COVERED); - if (isJDKCompiler()) { - assertLine("explicitExceptionFinally.finallyBlockEnd", - /* fully when ECJ: */ICounter.EMPTY); - } + assertLine("explicitExceptionFinally.finallyBlockEnd", + isJDKCompiler ? ICounter.EMPTY : ICounter.FULLY_COVERED); assertLine("explicitExceptionFinally.afterBlock", ICounter.EMPTY); } |