test for already used var
This commit is contained in:
@@ -117,6 +117,7 @@ public class SingleClassesTest {
|
|||||||
//@Test public void testSwitchOnStrings() { doTest("pkg/TestSwitchOnStrings");}
|
//@Test public void testSwitchOnStrings() { doTest("pkg/TestSwitchOnStrings");}
|
||||||
//@Test public void testUnionType() { doTest("pkg/TestUnionType"); }
|
//@Test public void testUnionType() { doTest("pkg/TestUnionType"); }
|
||||||
//@Test public void testInnerClassConstructor2() { doTest("pkg/TestInner2"); }
|
//@Test public void testInnerClassConstructor2() { doTest("pkg/TestInner2"); }
|
||||||
|
//@Test public void testInUse() { doTest("pkg/TestInUse"); }
|
||||||
|
|
||||||
private void doTest(String testFile, String... companionFiles) {
|
private void doTest(String testFile, String... companionFiles) {
|
||||||
ConsoleDecompiler decompiler = fixture.getDecompiler();
|
ConsoleDecompiler decompiler = fixture.getDecompiler();
|
||||||
|
|||||||
BIN
testData/classes/pkg/TestInUse.class
Normal file
BIN
testData/classes/pkg/TestInUse.class
Normal file
Binary file not shown.
53
testData/results/TestInUse.dec
Normal file
53
testData/results/TestInUse.dec
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package pkg;
|
||||||
|
|
||||||
|
public class TestInUse {
|
||||||
|
public int getInt() {
|
||||||
|
return 42;// 5
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int reuse() {
|
||||||
|
int i = 0;// 9
|
||||||
|
int d = 0;
|
||||||
|
int result = 0;// 10
|
||||||
|
|
||||||
|
do {
|
||||||
|
d = this.getInt();// 12
|
||||||
|
result -= d;// 13
|
||||||
|
++i;// 15
|
||||||
|
} while(i < 10);
|
||||||
|
|
||||||
|
return result;// 16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class 'pkg/TestInUse' {
|
||||||
|
method 'getInt ()I' {
|
||||||
|
0 4
|
||||||
|
2 4
|
||||||
|
}
|
||||||
|
|
||||||
|
method 'reuse ()I' {
|
||||||
|
0 8
|
||||||
|
1 8
|
||||||
|
2 9
|
||||||
|
3 9
|
||||||
|
4 10
|
||||||
|
5 10
|
||||||
|
7 13
|
||||||
|
a 13
|
||||||
|
e 14
|
||||||
|
f 15
|
||||||
|
13 16
|
||||||
|
15 16
|
||||||
|
19 18
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Lines mapping:
|
||||||
|
5 <-> 5
|
||||||
|
9 <-> 9
|
||||||
|
10 <-> 11
|
||||||
|
12 <-> 14
|
||||||
|
13 <-> 15
|
||||||
|
15 <-> 16
|
||||||
|
16 <-> 19
|
||||||
18
testData/src/pkg/TestInUse.java
Normal file
18
testData/src/pkg/TestInUse.java
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package pkg;
|
||||||
|
|
||||||
|
public class TestInUse {
|
||||||
|
public int getInt() {
|
||||||
|
return 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int reuse() {
|
||||||
|
int i = 0, d = 0;
|
||||||
|
int result = 0;
|
||||||
|
do {
|
||||||
|
d = getInt();
|
||||||
|
result -= d;
|
||||||
|
}
|
||||||
|
while (++i < 10);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user