aboutsummaryrefslogtreecommitdiff
path: root/org.jacoco.core.test/src/org/jacoco/core/internal/instr
diff options
context:
space:
mode:
authorMarc R. Hoffmann <hoffmann@mountainminds.com>2018-10-03 21:16:27 +0200
committerEvgeny Mandrikov <Godin@users.noreply.github.com>2018-10-03 21:16:27 +0200
commit01b961b755bd47164739896d2d9c0960e882fd40 (patch)
treed0e9a32f95837032d3c14a326a84a76435be1a6e /org.jacoco.core.test/src/org/jacoco/core/internal/instr
parent9dfd348cc084a469e41623ee335aaaace97692e3 (diff)
downloadjacoco-01b961b755bd47164739896d2d9c0960e882fd40.tar.gz
No need to modify class bytes for Java 10 support (#740)
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/internal/instr')
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
index c1b3044b..dda12bfd 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
@@ -15,7 +15,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import org.jacoco.core.internal.BytecodeVersion;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -43,6 +42,13 @@ public class InstrSupportTest {
}
@Test
+ public void getVersionMajor_should_return_major_version_number() {
+ final byte[] bytes = new byte[] { (byte) 0xCA, (byte) 0xFE, (byte) 0xBA,
+ (byte) 0xBE, /* minor */ 0x00, 0x03, /* major */ 0x00, 0x2D };
+ assertEquals(45, InstrSupport.getVersionMajor(bytes));
+ }
+
+ @Test
public void needFrames_should_return_false_for_versions_less_than_1_6() {
assertFalse(InstrSupport.needsFrames(Opcodes.V1_1));
assertFalse(InstrSupport.needsFrames(Opcodes.V1_2));
@@ -57,7 +63,7 @@ public class InstrSupportTest {
assertTrue(InstrSupport.needsFrames(Opcodes.V1_7));
assertTrue(InstrSupport.needsFrames(Opcodes.V1_8));
assertTrue(InstrSupport.needsFrames(Opcodes.V9));
- assertTrue(InstrSupport.needsFrames(BytecodeVersion.V10));
+ assertTrue(InstrSupport.needsFrames(Opcodes.V10));
assertTrue(InstrSupport.needsFrames(Opcodes.V11));
assertTrue(InstrSupport.needsFrames(Opcodes.V12));
}