diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2015-02-24 22:21:23 +0100 |
---|---|---|
committer | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2015-02-24 22:21:23 +0100 |
commit | be29a42498f4ef1b50bc49d4e453ca543bc91489 (patch) | |
tree | dc5704ecf73816bf6aa9dd0c73721f98312a88d0 /org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java | |
parent | f686e5e9b3cae1221b61aefd80ae605b39e4d764 (diff) | |
download | jacoco-be29a42498f4ef1b50bc49d4e453ca543bc91489.tar.gz |
GitHub #286: Fix missing probes
Fix missing probes at the beginning of try/catch blocks when the block
starts as a jump target. This should restore exec file compatibility
with 0.7.2. Basically a revert of commit e4a474c
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 | 18 |
1 files changed, 14 insertions, 4 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 a3bfa81d..03517826 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 @@ -61,7 +61,17 @@ public class ExceptionsTest extends ValidationTestBase { assertLine("implicitExceptionTryCatch.catchBlock", ICounter.FULLY_COVERED); - // 5. Try/Catch Block With Exception Thrown Explicitly + // 5. Try/Catch Block With Exception Thrown Implicitly After Condition + // As the try/catch block is entered at one branch of the condition + // should be marked as executed + assertLine("implicitExceptionTryCatchAfterCondition.condition", + ICounter.FULLY_COVERED, 1, 1); + assertLine("implicitExceptionTryCatchAfterCondition.exception", + ICounter.NOT_COVERED); + assertLine("implicitExceptionTryCatchAfterCondition.catchBlock", + ICounter.FULLY_COVERED); + + // 6. Try/Catch Block With Exception Thrown Explicitly assertLine("explicitExceptionTryCatch.beforeBlock", ICounter.FULLY_COVERED); assertLine("explicitExceptionTryCatch.before", ICounter.FULLY_COVERED); @@ -69,13 +79,13 @@ public class ExceptionsTest extends ValidationTestBase { assertLine("explicitExceptionTryCatch.catchBlock", ICounter.FULLY_COVERED); - // 6. Finally Block Without Exception Thrown + // 7. Finally Block Without Exception Thrown // Finally block is yellow as the exception path is missing. assertLine("noExceptionFinally.beforeBlock", ICounter.FULLY_COVERED); assertLine("noExceptionFinally.tryBlock", ICounter.FULLY_COVERED); assertLine("noExceptionFinally.finallyBlock", ICounter.PARTLY_COVERED); - // 7. Finally Block With Implicit Exception + // 8. Finally Block With Implicit Exception // Finally block is yellow as the non-exception path is missing. assertLine("implicitExceptionFinally.beforeBlock", ICounter.FULLY_COVERED); @@ -85,7 +95,7 @@ public class ExceptionsTest extends ValidationTestBase { assertLine("implicitExceptionFinally.finallyBlock", ICounter.PARTLY_COVERED); - // 8. Finally Block With Exception Thrown Explicitly + // 9. Finally Block With Exception Thrown Explicitly assertLine("explicitExceptionFinally.beforeBlock", ICounter.FULLY_COVERED); assertLine("explicitExceptionFinally.before", ICounter.FULLY_COVERED); |