mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-28 17:27:16 +08:00
Test timing debugging
This commit is contained in:
+2
@@ -513,7 +513,9 @@ public class ListingPanel extends JPanel implements FieldMouseListener, FieldLoc
|
|||||||
listingHoverHandler.initializeListingHoverHandler(handler);
|
listingHoverHandler.initializeListingHoverHandler(handler);
|
||||||
listingHoverHandler.dispose();
|
listingHoverHandler.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
listingHoverHandler = handler;
|
listingHoverHandler = handler;
|
||||||
|
fieldPanel.setHoverProvider(listingHoverHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
|
|||||||
+9
-6
@@ -807,20 +807,23 @@ public class FunctionGraphPlugin1Test extends AbstractFunctionGraphTest {
|
|||||||
assertInHistory(Arrays.asList(addresses));
|
assertInHistory(Arrays.asList(addresses));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertInHistory(List<Address> addresses) {
|
private void assertInHistory(List<Address> expectedAddresses) {
|
||||||
|
|
||||||
List<LocationMemento> locations = getNavigationHistory();
|
List<LocationMemento> actualLocations = getNavigationHistory();
|
||||||
assertTrue("Vertex locations not added to history", addresses.size() <= locations.size());
|
assertTrue(
|
||||||
|
"Vertex address should be in the history list: " + expectedAddresses + ".\nHistory: " +
|
||||||
|
actualLocations + "\nNavigated vertices: " + expectedAddresses,
|
||||||
|
expectedAddresses.size() <= actualLocations.size());
|
||||||
|
|
||||||
List<Address> actualAddresses =
|
List<Address> actualAddresses =
|
||||||
locations.stream()
|
actualLocations.stream()
|
||||||
.map(memento -> memento.getProgramLocation().getAddress())
|
.map(memento -> memento.getProgramLocation().getAddress())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
for (Address a : addresses) {
|
for (Address a : expectedAddresses) {
|
||||||
|
|
||||||
assertTrue("Vertex address should be in the history list: " + a + ".\nHistory: " +
|
assertTrue("Vertex address should be in the history list: " + a + ".\nHistory: " +
|
||||||
actualAddresses + "\nNavigated vertices: " + addresses,
|
actualAddresses + "\nNavigated vertices: " + expectedAddresses,
|
||||||
actualAddresses.contains(a));
|
actualAddresses.contains(a));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ public class SpyEventRecorder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// synchronized because we spy on multiple threads (like Test and Swing)
|
||||||
|
public synchronized void record(String message, Object... args) {
|
||||||
|
record(String.format(message, args));
|
||||||
|
}
|
||||||
|
|
||||||
private synchronized String eventsToString() {
|
private synchronized String eventsToString() {
|
||||||
|
|
||||||
int size = events.size();
|
int size = events.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user