Skip to content

Ghidra is a software reverse engineering (SRE) framework

Test fixes

dragonmacher755bb5009ce2
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/console/ConsolePluginTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/console/ConsolePluginTest.java
index a8470228be..8b469bb83b 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/console/ConsolePluginTest.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/console/ConsolePluginTest.java
@@ -147,9 +147,10 @@ public class ConsolePluginTest extends AbstractGhidraHeadedIntegrationTest {
// highlighted correctly.
String newSearchText = "java";
runSwing(() -> findDialog.setSearchText(newSearchText));
- pressButtonByText(findDialog, "Next");
+ next();
matches = getExpectedMatches();
assertEquals(2, matches.size());
+
verfiyHighlightColor(matches);
close(findDialog);
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/SearchResults.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/SearchResults.java
index c451fc2614..bd87e624e5 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/SearchResults.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/SearchResults.java
@@ -139,10 +139,7 @@ public abstract class SearchResults {
}
/**
- * Runs the given job, cancelling any currently running jobs. We assume that only one job
- * should be run at a time for the given worker for all search results sharing that worker,
- * not just a single search results. This keeps multiple search results from interfering with
- * each other as the user interacts with the results.
+ * Schedules the given job to run. This does not cancel any other pending work.
* @param job the job
*/
protected void runJob(FindJob job) {
@@ -179,7 +176,6 @@ public abstract class SearchResults {
@Override
public final void run(TaskMonitor monitor) throws CancelledException {
-
monitor.checkCancelled();
if (runnable != null) {
@@ -254,7 +250,7 @@ public abstract class SearchResults {
public class SwingJob extends FindJob {
public SwingJob(Runnable r) {
- this.runnable = m -> r.run();
+ this.runnable = m -> Swing.runNow(r);
}
}
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearchResults.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearchResults.java
index 1acd515183..d9d55af1bd 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearchResults.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearchResults.java
@@ -405,6 +405,7 @@ public class TextComponentSearchResults extends SearchResults {
maybeInstallHighlighter();
Collection<TextComponentSearchLocation> locations = matchesByPosition.values();
+
for (TextComponentSearchLocation location : locations) {
doHighlightLocation(location);
}
@@ -462,7 +463,6 @@ public class TextComponentSearchResults extends SearchResults {
@Override
public void dispose() {
- deactivate();
caretUpdater.dispose();
if (editorPane != null) {
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearcher.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearcher.java
index d7c4ea1633..e3204021c8 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearcher.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/search/TextComponentSearcher.java
@@ -212,7 +212,7 @@ public class TextComponentSearcher implements FindDialogSearcher {
private boolean useRegex;
SearchTask(String searchText, boolean useRegex) {
- super("Help Search Task", true, false, true, true);
+ super("Text Find Task", true, false, true, true);
this.searchText = searchText;
this.useRegex = useRegex;
}