Skip to content

Commit 5fde305

Browse files
committed
add wrapper for verifying CG edges
1 parent a0c5c54 commit 5fde305

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

core/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestPythonCallGraphShape.java

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
import static java.util.Collections.emptyList;
44

5+
import java.io.File;
6+
import java.io.IOException;
7+
import java.net.MalformedURLException;
8+
import java.net.URI;
9+
import java.net.URISyntaxException;
10+
import java.net.URL;
11+
import java.util.ArrayList;
12+
import java.util.Collection;
13+
import java.util.List;
14+
import java.util.Set;
15+
516
import com.ibm.wala.cast.python.client.PythonAnalysisEngine;
617
import com.ibm.wala.cast.python.types.PythonTypes;
718
import com.ibm.wala.cast.types.AstMethodReference;
@@ -18,15 +29,6 @@
1829
import com.ibm.wala.types.TypeReference;
1930
import com.ibm.wala.util.CancelException;
2031
import com.ibm.wala.util.collections.HashSetFactory;
21-
import java.io.File;
22-
import java.io.IOException;
23-
import java.net.MalformedURLException;
24-
import java.net.URI;
25-
import java.net.URISyntaxException;
26-
import java.net.URL;
27-
import java.util.Collection;
28-
import java.util.List;
29-
import java.util.Set;
3032

3133
public abstract class TestPythonCallGraphShape extends TestCallGraphShape {
3234

@@ -130,4 +132,12 @@ StringBuffer dump(CallGraph CG) {
130132
}
131133
return sb;
132134
}
135+
136+
protected void verifyGraphAssertions(CallGraph CG, Object[][] data) {
137+
List<GraphAssertion> asserts = new ArrayList<>();
138+
for(int i = 0; i < data.length; i++) {
139+
asserts.add(new GraphAssertion(data[i][0], (String[]) data[i][1]));
140+
}
141+
verifyGraphAssertions(CG, asserts);
142+
}
133143
}

0 commit comments

Comments
 (0)