mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-65 - Error Dialog - updated the error dialog to accumulate errors
while it is open instead of repeatedly showing new dialogs
This commit is contained in:
parent
4506acddf9
commit
fc247aa499
44 changed files with 1784 additions and 1662 deletions
|
@ -29,17 +29,14 @@ import ghidra.program.model.symbol.*;
|
|||
import ghidra.program.util.ProgramSelection;
|
||||
|
||||
public class DiffApplyIgnoreTest extends DiffApplyTestAdapter {
|
||||
public DiffApplyIgnoreTest() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testProgramContextIgnore() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
assertNotNull(dialog);
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -54,10 +51,10 @@ public class DiffApplyIgnoreTest extends DiffApplyTestAdapter {
|
|||
public void testByteIgnore() throws Exception {
|
||||
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
assertNotNull(dialog);
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -71,10 +68,10 @@ public class DiffApplyIgnoreTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testCodeUnitIgnore() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
assertNotNull(dialog);
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -88,10 +85,10 @@ public class DiffApplyIgnoreTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testReferenceIgnore() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
assertNotNull(dialog);
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
memRefIgnore();
|
||||
|
@ -208,10 +205,10 @@ public class DiffApplyIgnoreTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testBookmarkIgnore() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
assertNotNull(dialog);
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -225,10 +222,10 @@ public class DiffApplyIgnoreTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testPropertyIgnore() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
assertNotNull(dialog);
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -242,10 +239,10 @@ public class DiffApplyIgnoreTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testFunctionIgnore() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
assertNotNull(dialog);
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.diff;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -36,14 +35,10 @@ import ghidra.util.exception.InvalidInputException;
|
|||
|
||||
public class DiffApplyReplaceTest extends DiffApplyTestAdapter {
|
||||
|
||||
public DiffApplyReplaceTest() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProgramContextReplace() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -57,9 +52,9 @@ public class DiffApplyReplaceTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testByteReplace() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -73,9 +68,9 @@ public class DiffApplyReplaceTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testCodeUnitReplace() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -89,9 +84,9 @@ public class DiffApplyReplaceTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testReferenceReplace() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
memRefReplace();
|
||||
extRefReplace();
|
||||
|
@ -284,9 +279,9 @@ public class DiffApplyReplaceTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testBookmarkReplace() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -300,9 +295,9 @@ public class DiffApplyReplaceTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testPropertyReplace() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
@ -316,9 +311,9 @@ public class DiffApplyReplaceTest extends DiffApplyTestAdapter {
|
|||
@Test
|
||||
public void testFunctionReplace() throws Exception {
|
||||
openDiff(diffTestP1, diffTestP2);
|
||||
JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000);
|
||||
JDialog dialog = waitForJDialog("Memory Differs");
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForPostedSwingRunnables();
|
||||
waitForSwing();
|
||||
showApplySettings();
|
||||
|
||||
ProgramSelection origDiffs = diffPlugin.getDiffHighlightSelection();
|
||||
|
|
|
@ -24,7 +24,6 @@ import javax.swing.*;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import docking.widgets.MultiLineLabel;
|
||||
import ghidra.app.events.ProgramSelectionPluginEvent;
|
||||
import ghidra.program.database.ProgramBuilder;
|
||||
import ghidra.program.model.address.AddressSet;
|
||||
|
@ -353,9 +352,6 @@ public class DiffGetTest extends DiffTestAdapter {
|
|||
|
||||
assertNull(fp2.getTopLevelAncestor());
|
||||
Window win = waitForWindow("Can't Open Selected Program");
|
||||
assertNotNull(win);
|
||||
String msg = findComponent(win, MultiLineLabel.class).getLabel();
|
||||
assertTrue(msg.startsWith("Programs languages don't match."));
|
||||
pressButton(win, "OK");
|
||||
win = waitForWindow("Select Other Program");
|
||||
assertNotNull(win);
|
||||
|
|
|
@ -147,9 +147,6 @@ public class DualProgramTest extends DiffTestAdapter {
|
|||
|
||||
waitForTasks();
|
||||
win = waitForWindow("Can't Open Selected Program");
|
||||
assertNotNull(win);
|
||||
MultiLineLabel mll = findComponent(win, MultiLineLabel.class);
|
||||
assertTrue(mll.getLabel().startsWith("Programs languages don't match."));
|
||||
pressButton(win, "OK");
|
||||
|
||||
win = waitForWindow("Select Other Program");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue