Created
June 3, 2015 05:34
-
-
Save marchof/c6f1b18c371f6e69622c to your computer and use it in GitHub Desktop.
Reproducer for jacoco/jacoco#321
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 4008091..38fbdd9 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 | |
@@ -103,6 +103,14 @@ | |
assertLine("explicitExceptionFinally.finallyBlock", | |
ICounter.FULLY_COVERED); | |
+ // 10. Exception After Branch: | |
+ assertLine("implicitExceptionAfterForLoop.for", ICounter.FULLY_COVERED, | |
+ 0, 2); | |
+ assertLine("implicitExceptionAfterForLoop.loopbody", | |
+ ICounter.FULLY_COVERED); | |
+ assertLine("implicitExceptionAfterForLoop.exception", | |
+ ICounter.NOT_COVERED); | |
+ | |
} | |
} | |
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java | |
index 41dfbe0..a15f73b 100644 | |
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java | |
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java | |
@@ -44,6 +44,10 @@ | |
implicitExceptionFinally(); | |
} catch (StubException e) { | |
} | |
+ try { | |
+ implicitExceptionAfterForLoop(); | |
+ } catch (StubException e) { | |
+ } | |
} | |
private void implicitException() { | |
@@ -128,6 +132,13 @@ | |
} | |
} | |
+ private void implicitExceptionAfterForLoop() { | |
+ for (int i = 0; i < 3; i++) { // $line-implicitExceptionAfterForLoop.for$ | |
+ nop(); // $line-implicitExceptionAfterForLoop.loopbody$ | |
+ } | |
+ ex(); // $line-implicitExceptionAfterForLoop.exception$ | |
+ } | |
+ | |
public static void main(String[] args) { | |
new Target03().run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment