Some new inline tests

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@188 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 4d4845387c
commit 5e5b56354e
  1. 29
      jode/test/OptimizeTest.java

@ -1,3 +1,5 @@
package jode.test;
public class OptimizeTest {
public final int getInlined(String str, int i) {
@ -9,7 +11,7 @@ public class OptimizeTest {
}
public int complexInline(String str, int i) {
public final int complexInline(String str, int i) {
System.err.println("");
return str.charAt(i)+str.charAt(-i);
}
@ -17,12 +19,37 @@ public class OptimizeTest {
public int notInlined(String str, int i, OptimizeTest t) {
return str.charAt(i) + t.getInlined(str, i);
}
public final void longInline(String str, int i) {
str.replace('a','b');
System.err.println(str.concat(String.valueOf(str.charAt(i))));
}
public int g;
public final int sideInline(int a) {
return g++ + a;
}
public void main(String[] param) {
OptimizeTest ot = new OptimizeTest();
System.err.println(ot.getInlined("Hallo", ot.notInlined(param[1], 10 - ot.getInlined(param[0], 0, new OptimizeTest()), ot)));
System.err.println(ot.complexInline("ollah", param.length));
System.err.println("result: "+(g++ + sideInline(g) + g++) + "g: "+g);
longInline("Hallo", 3);
System.err.println("result:"+
(g++ + jode.test.inline.InlineTest
.difficultSideInline(this, g)
+ g++) + "g: "+g);
System.err.println("result:"+
(g++ + jode.inline.InlineTest
.difficultSideInline(this, g)
+ g++) + "g: "+g);
System.err.println("result:"+
(g++ + jode.InlineTest
.difficultSideInline(this, g)
+ g++) + "g: "+g);
}
}

Loading…
Cancel
Save