diff options
author | Evgeny Mandrikov <Godin@users.noreply.github.com> | 2017-03-28 19:20:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 19:20:48 +0200 |
commit | eaef191fe12fc5abc81435016dbbd69cb55d1f68 (patch) | |
tree | f7ea74f56ff9a388e22cb44e5626dd3bcb83f50e /org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java | |
parent | 38a26f418483fd2053b19bf6b3adb7318c11be3f (diff) | |
download | jacoco-eaef191fe12fc5abc81435016dbbd69cb55d1f68.tar.gz |
Add internal API for filters and filter for synchronized statement (#501)
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java')
-rw-r--r-- | org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java index 6ce99ed7..1dc5fc2c 100644 --- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java +++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java @@ -12,9 +12,12 @@ package org.jacoco.core.internal.flow; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; import org.junit.Before; import org.junit.Test; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.InsnNode; /** * Unit tests for {@link Instruction}. @@ -25,11 +28,14 @@ public class InstructionTest { @Before public void setup() { - instruction = new Instruction(123); + instruction = new Instruction(new InsnNode(Opcodes.NOP), 123); } @Test public void testInit() { + final InsnNode node = new InsnNode(Opcodes.NOP); + instruction = new Instruction(node, 123); + assertSame(node, instruction.getNode()); assertEquals(123, instruction.getLine()); assertEquals(0, instruction.getBranches()); assertEquals(0, instruction.getCoveredBranches()); @@ -48,14 +54,16 @@ public class InstructionTest { @Test public void testSetPredecessor() { - final Instruction predecessor = new Instruction(122); + final Instruction predecessor = new Instruction( + new InsnNode(Opcodes.NOP), 122); instruction.setPredecessor(predecessor); assertEquals(1, predecessor.getBranches()); } @Test public void testSetCovered() { - final Instruction predecessor = new Instruction(122); + final Instruction predecessor = new Instruction( + new InsnNode(Opcodes.NOP), 122); instruction.setPredecessor(predecessor); instruction.setCovered(); assertEquals(1, instruction.getCoveredBranches()); @@ -68,10 +76,11 @@ public class InstructionTest { @Test public void testSetCoveredOnLongSequence() { - final Instruction first = new Instruction(0); + final Instruction first = new Instruction(new InsnNode(Opcodes.NOP), 0); Instruction next = first; for (int i = 0; i < 0x10000; i++) { - final Instruction insn = new Instruction(i); + final Instruction insn = new Instruction(new InsnNode(Opcodes.NOP), + i); insn.setPredecessor(next); next = insn; } |