diff options
Diffstat (limited to 'org.jacoco.core.test.validation.java7/src/org/jacoco/core/test/validation/java7/StringSwitchTest.java')
-rw-r--r-- | org.jacoco.core.test.validation.java7/src/org/jacoco/core/test/validation/java7/StringSwitchTest.java | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/org.jacoco.core.test.validation.java7/src/org/jacoco/core/test/validation/java7/StringSwitchTest.java b/org.jacoco.core.test.validation.java7/src/org/jacoco/core/test/validation/java7/StringSwitchTest.java index 04fe6f5d..f291c174 100644 --- a/org.jacoco.core.test.validation.java7/src/org/jacoco/core/test/validation/java7/StringSwitchTest.java +++ b/org.jacoco.core.test.validation.java7/src/org/jacoco/core/test/validation/java7/StringSwitchTest.java @@ -11,10 +11,9 @@ *******************************************************************************/ package org.jacoco.core.test.validation.java7; -import org.jacoco.core.analysis.ICounter; +import org.jacoco.core.test.validation.Source.Line; import org.jacoco.core.test.validation.ValidationTestBase; import org.jacoco.core.test.validation.java7.targets.StringSwitchTarget; -import org.junit.Test; /** * Test of filtering of a bytecode that is generated for a String in switch @@ -26,41 +25,22 @@ public class StringSwitchTest extends ValidationTestBase { super(StringSwitchTarget.class); } - /** - * {@link StringSwitchTarget#covered(Object)} - */ - @Test - public void covered() { + public void assertSwitchCovered(final Line line) { if (isJDKCompiler) { - assertLine("covered.switch", ICounter.FULLY_COVERED, 0, 4); + assertFullyCovered(line, 0, 4); } else { - assertLine("covered.switch", ICounter.PARTLY_COVERED, 2, 7); + // Filtering for ECJ not yet implemented: + assertPartlyCovered(line, 2, 7); } - assertLine("covered.case1", ICounter.FULLY_COVERED); - assertLine("covered.case2", ICounter.FULLY_COVERED); - assertLine("covered.case3", ICounter.FULLY_COVERED); - assertLine("covered.default", ICounter.FULLY_COVERED); } - /** - * {@link StringSwitchTarget#notCovered(Object)} - */ - @Test - public void notCovered() { - assertLine("notCovered", ICounter.NOT_COVERED, isJDKCompiler ? 4 : 9, - 0); - } - - /** - * {@link StringSwitchTarget#handwritten(String)} - */ - @Test - public void handwritten() { - assertLine("handwritten.firstSwitch", ICounter.FULLY_COVERED, 2, 1); - assertLine("handwritten.ignored", ICounter.FULLY_COVERED, 1, 1); - assertLine("handwritten.secondSwitch", ICounter.FULLY_COVERED, 3, 1); - assertLine("handwritten.case1", ICounter.FULLY_COVERED); - assertLine("handwritten.case2", ICounter.NOT_COVERED); + public void assertSwitchNotCovered(final Line line) { + if (isJDKCompiler) { + assertNotCovered(line, 4, 0); + } else { + // Filtering for ECJ not yet implemented: + assertNotCovered(line, 9, 0); + } } } |