MCPcopy Create free account
hub / github.com/LFYSec/MScan / test

Method test

src/test/java/pascal/taie/frontend/soot/ConstVarTest.java:35–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33public class ConstVarTest {
34
35 @Test
36 void test() {
37 String main = "ConstVar";
38 Main.buildWorld("-pp", "-cp", "src/test/resources/world", "--input-classes", main);
39 JClass jclass = World.get().getClassHierarchy().getClass(main);
40 jclass.getDeclaredMethods().forEach(m -> {
41 IR ir = m.getIR();
42 IRPrinter.print(ir, System.out);
43 ir.getVars()
44 .stream()
45 .filter(Var::isConst)
46 .forEach(v -> System.out.println(v + " -> " + v.getConstValue()));
47 });
48 }
49}

Callers

nothing calls this directly

Calls 12

buildWorldMethod · 0.95
getMethod · 0.95
getDeclaredMethodsMethod · 0.95
printMethod · 0.95
getVarsMethod · 0.95
getClassHierarchyMethod · 0.80
filterMethod · 0.80
streamMethod · 0.80
getConstValueMethod · 0.80
getClassMethod · 0.65
forEachMethod · 0.65
getIRMethod · 0.65

Tested by

no test coverage detected