use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method testGithubIssue28.
@Test
public void testGithubIssue28() {
initMethod(true, "V");
Local b = addLocal("b");
addStmt(nAssign(b, nNewMutiArray("D", 2, new Value[] { nInt(2), nInt(3) })));
addStmt(nAssign(nArray(nArray(b, nInt(5), TypeClass.OBJECT.name), nInt(1), TypeClass.JD.name), nLong(0)));
addStmt(nReturnVoid());
transform();
Assert.assertEquals("", b.valueType, "[[D");
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method test2byte.
@Test
public void test2byte() {
initMethod(true, "V");
Local b = addLocal("b");
addStmt(nAssign(b, nStaticField("La;", "z", "B")));
addStmt(nVoidInvoke(nInvokeStatic(new Value[] { b }, "La;", "y", new String[] { "I" }, "V")));
addStmt(nAssign(nStaticField("La;", "z", "B"), b));
addStmt(nReturnVoid());
transform();
// FIXME fix type detect
// Assert.assertEquals("", "I", b.valueType);
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method test3Z.
@Test
public void test3Z() {
initMethod(true, "V");
Local b = addLocal("b");
addStmt(nAssign(b, nInt(1)));
LabelStmt L0 = newLabel();
addStmt(nIf(nEq(b, nInt(0), TypeClass.ZIFL.name), L0));
addStmt(L0);
addStmt(nReturnVoid());
transform();
// FIXME local should type to Z but I works as well
// Assert.assertEquals("", "Z", b.valueType);
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method testDefaultZI.
@Test
public void testDefaultZI() {
initMethod(true, "V");
Local b = addLocal("b");
Local c = addLocal("c");
addStmt(nAssign(b, nInt(5)));
addStmt(nAssign(c, nOr(b, nInt(6), TypeClass.ZI.name)));
addStmt(nReturnVoid());
transform();
Assert.assertEquals("I", c.valueType);
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method testGithubIssue28x.
@Test
public void testGithubIssue28x() {
initMethod(true, "V");
Local b = addLocal("b");
addStmt(nAssign(b, nInt(0)));
addStmt(nAssign(nArray(nArray(b, nInt(5), TypeClass.OBJECT.name), nInt(1), TypeClass.JD.name), nLong(0)));
addStmt(nReturnVoid());
transform();
// this case is ok to fail as the NPE transformer cover this
// Assert.assertEquals("", "[[D", b.valueType);
}
Aggregations