Skip to content

Commit

Permalink
added a test case to help resolve #781
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenArzt committed Jan 8, 2025
1 parent bdda187 commit ecc5978
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
13 changes: 13 additions & 0 deletions soot-infoflow/test/soot/jimple/infoflow/test/OtherTestCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -706,4 +706,17 @@ public void testNeighbors1() {
// where the neighbors only differ in their corresponding call site
cm.publish(i);
}

public void skipOverConstructorTest1() {
MyClass myVar = new MyClass();
myVar.myString = TelephonyManager.getDeviceId();
MyClass mySecondVar = new MyClass();
ConnectionManager cm = new ConnectionManager();
cm.publish(myVar.myString);
}

class MyClass {
String myString;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ public void skipOverObjectTest2() {
Assert.assertTrue(infoflow.getResults().isPathBetweenMethods(sink, sourceDeviceId));
}


@Test(timeout = 300000)
public void testNeighbors1() {
IInfoflow infoflow = initInfoflow();
Expand All @@ -447,4 +446,15 @@ public void testNeighbors1() {
checkInfoflow(infoflow, 1);
Assert.assertEquals(3, infoflow.getResults().getResultSet().size());
}

@Test(timeout = 300000)
public void skipOverConstructorTest1() {
IInfoflow infoflow = initInfoflow();
List<String> epoints = new ArrayList<String>();
epoints.add("<soot.jimple.infoflow.test.OtherTestCode: void skipOverConstructorTest1()>");
infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
checkInfoflow(infoflow, 1);
Assert.assertTrue(infoflow.getResults().isPathBetweenMethods(sink, sourceDeviceId));
}

}

0 comments on commit ecc5978

Please sign in to comment.