mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-24 13:21:22 +08:00
GT-0 fixing junit tests
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ public abstract class AbstractNextPreviousAction extends CodeViewerContextAction
|
||||
|
||||
void setDirection(boolean isForward) {
|
||||
this.isForward = isForward;
|
||||
setDescription(getDescription());
|
||||
setDescription(getDescriptionString());
|
||||
}
|
||||
|
||||
private String getDescriptionString() {
|
||||
|
||||
+8
-1
@@ -227,7 +227,14 @@ public class NextPreviousBookmarkAction extends MultiStateDockingAction<String>
|
||||
|
||||
public void setDirection(boolean isForward) {
|
||||
this.isForward = isForward;
|
||||
setDescription(getDescription());
|
||||
setDescription(getToolTipText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolTipText() {
|
||||
String description = "Go To " + (isForward ? "Next" : "Previous");
|
||||
description += " Bookmark: " + getCurrentState().getName();
|
||||
return description;
|
||||
}
|
||||
|
||||
private String getNavigationTypeName() {
|
||||
|
||||
+23
-24
@@ -118,36 +118,35 @@ public class NextPrevCodeUnitPluginTest extends AbstractGhidraHeadedIntegrationT
|
||||
Icon downIcon = ResourceManager.loadImage("images/down.png");
|
||||
|
||||
assertEquals(downIcon, direction.getToolBarData().getIcon());
|
||||
assertEquals("Next Instruction", nextInst.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Data", nextData.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Undefined", nextUndef.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Label", nextLabel.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Function", nextFunc.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Instruction Not In a Function",
|
||||
nextNonFunc.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Bookmark", nextBookmark.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Go To Next Instruction", nextInst.getDescription());
|
||||
assertEquals("Go To Next Data", nextData.getDescription());
|
||||
assertEquals("Go To Next Undefined", nextUndef.getDescription());
|
||||
assertEquals("Go To Next Label", nextLabel.getDescription());
|
||||
assertEquals("Go To Next Function", nextFunc.getDescription());
|
||||
assertEquals("Go To Next Instruction Not In a Function", nextNonFunc.getDescription());
|
||||
assertEquals("Go To Next Bookmark: All Types", nextBookmark.getDescription());
|
||||
|
||||
performAction(direction, cb.getProvider(), true);
|
||||
|
||||
assertEquals(upIcon, direction.getToolBarData().getIcon());
|
||||
assertEquals("Previous Instruction", nextInst.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Previous Data", nextData.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Previous Undefined", nextUndef.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Previous Label", nextLabel.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Previous Function", nextFunc.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Previous Instruction Not In a Function",
|
||||
nextNonFunc.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Previous Bookmark", nextBookmark.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Go To Previous Instruction", nextInst.getDescription());
|
||||
assertEquals("Go To Previous Data", nextData.getDescription());
|
||||
assertEquals("Go To Previous Undefined", nextUndef.getDescription());
|
||||
assertEquals("Go To Previous Label", nextLabel.getDescription());
|
||||
assertEquals("Go To Previous Function", nextFunc.getDescription());
|
||||
assertEquals("Go To Previous Instruction Not In a Function", nextNonFunc.getDescription());
|
||||
assertEquals("Go To Previous Bookmark: All Types", nextBookmark.getDescription());
|
||||
|
||||
performAction(direction, cb.getProvider(), true);
|
||||
|
||||
assertEquals(downIcon, direction.getToolBarData().getIcon());
|
||||
assertEquals("Next Instruction", nextInst.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Data", nextData.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Undefined", nextUndef.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Label", nextLabel.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Function", nextFunc.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Instruction Not In a Function",
|
||||
nextNonFunc.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Next Bookmark", nextBookmark.getMenuBarData().getMenuPath()[1]);
|
||||
assertEquals("Go To Next Instruction", nextInst.getDescription());
|
||||
assertEquals("Go To Next Data", nextData.getDescription());
|
||||
assertEquals("Go To Next Undefined", nextUndef.getDescription());
|
||||
assertEquals("Go To Next Label", nextLabel.getDescription());
|
||||
assertEquals("Go To Next Function", nextFunc.getDescription());
|
||||
assertEquals("Go To Next Instruction Not In a Function", nextNonFunc.getDescription());
|
||||
assertEquals("Go To Next Bookmark: All Types", nextBookmark.getDescription());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -235,7 +235,7 @@ public abstract class MultiStateDockingAction<T> extends DockingAction {
|
||||
ToolBarData tbd = getToolBarData();
|
||||
tbd.setIcon(getIcon(actionState));
|
||||
|
||||
setDescription(getTooTipText());
|
||||
setDescription(getToolTipText());
|
||||
actionStateChanged(actionState, trigger);
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public abstract class MultiStateDockingAction<T> extends DockingAction {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public String getTooTipText() {
|
||||
public String getToolTipText() {
|
||||
return getName() + ": " + getCurrentState().getName();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import resources.Icons;
|
||||
public class ActionBuilderTest {
|
||||
private int actionCount = 0;
|
||||
|
||||
|
||||
@Test
|
||||
public void testDescription() {
|
||||
DockingAction action = new ActionBuilder("Test", "Test")
|
||||
@@ -163,7 +162,7 @@ public class ActionBuilderTest {
|
||||
.onAction(e -> actionCount++)
|
||||
.build();
|
||||
|
||||
assertEquals(KeyStroke.getKeyStroke("ALT A"), action.getKeyBinding());
|
||||
assertEquals(KeyStroke.getKeyStroke("alt pressed A"), action.getKeyBinding());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user