test fixes

This commit is contained in:
dragonmacher 2024-11-15 13:09:38 -05:00
parent 3fb7d914f5
commit 2ac3fe7b1b

View File

@ -35,8 +35,6 @@ import docking.widgets.fieldpanel.FieldPanel;
import docking.widgets.fieldpanel.support.FieldLocation; import docking.widgets.fieldpanel.support.FieldLocation;
import docking.widgets.tab.GTabPanel; import docking.widgets.tab.GTabPanel;
import ghidra.app.cmd.data.CreateDataCmd; import ghidra.app.cmd.data.CreateDataCmd;
import ghidra.app.events.ProgramLocationPluginEvent;
import ghidra.app.events.ProgramSelectionPluginEvent;
import ghidra.app.plugin.core.progmgr.MultiTabPlugin; import ghidra.app.plugin.core.progmgr.MultiTabPlugin;
import ghidra.app.util.viewer.field.OpenCloseField; import ghidra.app.util.viewer.field.OpenCloseField;
import ghidra.app.util.viewer.listingpanel.ListingModel; import ghidra.app.util.viewer.listingpanel.ListingModel;
@ -208,8 +206,7 @@ public class DiffTest extends DiffTestAdapter {
assertNotNull(nextDiff); assertNotNull(nextDiff);
assertTrue(nextDiff.isEnabled()); assertTrue(nextDiff.isEnabled());
tool.firePluginEvent(new ProgramLocationPluginEvent("test", goTo(tool, program, "1004c61");
new ProgramLocation(program, addr("1004c61")), program));
assertEquals(addr("1004c61"), getDiffAddress()); assertEquals(addr("1004c61"), getDiffAddress());
assertEquals(cb.getCurrentSelection(), new ProgramSelection()); assertEquals(cb.getCurrentSelection(), new ProgramSelection());
@ -230,8 +227,7 @@ public class DiffTest extends DiffTestAdapter {
assertNotNull(nextDiff); assertNotNull(nextDiff);
assertTrue(nextDiff.isEnabled()); assertTrue(nextDiff.isEnabled());
tool.firePluginEvent(new ProgramLocationPluginEvent("test", goTo(tool, program, "100f3ff");
new ProgramLocation(program, addr("100f3ff")), program));
assertEquals(addr("100f3ff"), getDiffAddress()); assertEquals(addr("100f3ff"), getDiffAddress());
assertEquals(cb.getCurrentSelection(), new ProgramSelection()); assertEquals(cb.getCurrentSelection(), new ProgramSelection());
@ -252,8 +248,7 @@ public class DiffTest extends DiffTestAdapter {
assertNotNull(nextDiff); assertNotNull(nextDiff);
assertTrue(nextDiff.isEnabled()); assertTrue(nextDiff.isEnabled());
tool.firePluginEvent(new ProgramLocationPluginEvent("test", goTo(tool, program, "1004c61");
new ProgramLocation(program, addr("1004c61")), program));
assertEquals(addr("1004c61"), getDiffAddress()); assertEquals(addr("1004c61"), getDiffAddress());
assertEquals(cb.getCurrentSelection(), new ProgramSelection()); assertEquals(cb.getCurrentSelection(), new ProgramSelection());
@ -263,8 +258,7 @@ public class DiffTest extends DiffTestAdapter {
assertEquals(cb.getCurrentSelection(), assertEquals(cb.getCurrentSelection(),
new ProgramSelection(addr("100415a"), addr("100415a"))); new ProgramSelection(addr("100415a"), addr("100415a")));
tool.firePluginEvent(new ProgramLocationPluginEvent("test", goTo(tool, program, "1002055");
new ProgramLocation(program, addr("1002055")), program));
assertEquals(addr("1002055"), getDiffAddress()); assertEquals(addr("1002055"), getDiffAddress());
invokeLater(prevDiff); invokeLater(prevDiff);
@ -284,8 +278,7 @@ public class DiffTest extends DiffTestAdapter {
assertNotNull(diffDetails); assertNotNull(diffDetails);
assertTrue(diffDetails.isEnabled()); assertTrue(diffDetails.isEnabled());
tool.firePluginEvent(new ProgramLocationPluginEvent("test", goTo(tool, program, "1004c61");
new ProgramLocation(program, addr("1004c61")), program));
assertEquals(addr("1004c61"), getDiffAddress()); assertEquals(addr("1004c61"), getDiffAddress());
assertEquals(cb.getCurrentSelection(), new ProgramSelection()); assertEquals(cb.getCurrentSelection(), new ProgramSelection());
@ -335,8 +328,7 @@ public class DiffTest extends DiffTestAdapter {
assertNotNull(diffDetails); assertNotNull(diffDetails);
assertTrue(diffDetails.isEnabled()); assertTrue(diffDetails.isEnabled());
tool.firePluginEvent(new ProgramLocationPluginEvent("test", goTo(tool, program, "100");
new ProgramLocation(program, addr("100")), program));
assertEquals(addr("100"), getDiffAddress()); assertEquals(addr("100"), getDiffAddress());
invokeLater(diffDetails); invokeLater(diffDetails);
@ -353,11 +345,8 @@ public class DiffTest extends DiffTestAdapter {
assertTrue(info.indexOf("Bookmark Diffs") == -1); assertTrue(info.indexOf("Bookmark Diffs") == -1);
assertEquals(addr("100"), getDiffAddress()); assertEquals(addr("100"), getDiffAddress());
tool.firePluginEvent(new ProgramLocationPluginEvent("test", goTo(tool, program, "1001014");
new ProgramLocation(program, addr("1001014")), program));
assertEquals(addr("1001014"), getDiffAddress()); assertEquals(addr("1001014"), getDiffAddress());
invokeLater(diffDetails);
waitForSwing();
assertEquals(true, isDiffDetailsDisplayed()); assertEquals(true, isDiffDetailsDisplayed());
// Check where there are no differences // Check where there are no differences
@ -406,10 +395,8 @@ public class DiffTest extends DiffTestAdapter {
diffAs.addRange(addr("1002304"), addr("1002304")); diffAs.addRange(addr("1002304"), addr("1002304"));
diffAs.addRange(addr("1002306"), addr("1002306")); diffAs.addRange(addr("1002306"), addr("1002306"));
tool.firePluginEvent( makeSelection(tool, program, as);
new ProgramSelectionPluginEvent("test", new ProgramSelection(as), program)); goTo(tool, program, "1001000");
tool.firePluginEvent(new ProgramLocationPluginEvent("test",
new ProgramLocation(program, addr("1001000")), program));
assertTrue(setPgm2Selection.isEnabled()); assertTrue(setPgm2Selection.isEnabled());
invokeLater(setPgm2Selection); invokeLater(setPgm2Selection);