mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-22 06:52:41 +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.dispose();
|
||||
}
|
||||
|
||||
listingHoverHandler = handler;
|
||||
fieldPanel.setHoverProvider(listingHoverHandler);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
|
||||
+9
-6
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
int size = events.size();
|
||||
|
||||
Reference in New Issue
Block a user