mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Test timing debugging
This commit is contained in:
@@ -807,20 +807,23 @@ public class FunctionGraphPlugin1Test extends AbstractFunctionGraphTest {
|
||||
assertInHistory(Arrays.asList(addresses));
|
||||
}
|
||||
|
||||
private void assertInHistory(List<Address> addresses) {
|
||||
private void assertInHistory(List<Address> expectedAddresses) {
|
||||
|
||||
List<LocationMemento> locations = getNavigationHistory();
|
||||
assertTrue("Vertex locations not added to history", addresses.size() <= locations.size());
|
||||
List<LocationMemento> actualLocations = getNavigationHistory();
|
||||
assertTrue(
|
||||
"Vertex address should be in the history list: " + expectedAddresses + ".\nHistory: " +
|
||||
actualLocations + "\nNavigated vertices: " + expectedAddresses,
|
||||
expectedAddresses.size() <= actualLocations.size());
|
||||
|
||||
List<Address> actualAddresses =
|
||||
locations.stream()
|
||||
actualLocations.stream()
|
||||
.map(memento -> memento.getProgramLocation().getAddress())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (Address a : addresses) {
|
||||
for (Address a : expectedAddresses) {
|
||||
|
||||
assertTrue("Vertex address should be in the history list: " + a + ".\nHistory: " +
|
||||
actualAddresses + "\nNavigated vertices: " + addresses,
|
||||
actualAddresses + "\nNavigated vertices: " + expectedAddresses,
|
||||
actualAddresses.contains(a));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user