aboutsummaryrefslogtreecommitdiff
path: root/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
diff options
context:
space:
mode:
authorMarc R. Hoffmann <hoffmann@mountainminds.com>2015-02-24 22:21:23 +0100
committerMarc R. Hoffmann <hoffmann@mountainminds.com>2015-02-24 22:21:23 +0100
commitbe29a42498f4ef1b50bc49d4e453ca543bc91489 (patch)
treedc5704ecf73816bf6aa9dd0c73721f98312a88d0 /org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
parentf686e5e9b3cae1221b61aefd80ae605b39e4d764 (diff)
downloadjacoco-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.java18
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);