Skip to content

Ghidra is a software reverse engineering (SRE) framework

Test fixes

dragonmacherd7ff30ff1741
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java
index 98f7e7838b..b637f1cd99 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java
@@ -37,8 +37,6 @@ import ghidra.util.exception.*;
*/
public class DataTypeEditorManager implements EditorListener {
- public static final String EDIT_ACTION_PREFIX = "Editor: ";
-
private List<EditorProvider> editorList;
private EditorOptionManager editorOptionMgr; // manages editor tool options
private DataTypeManagerPlugin plugin;
@@ -707,7 +705,7 @@ public class DataTypeEditorManager implements EditorListener {
private String name;
DtSharedActionPlaceholder(String name) {
- this.name = EDIT_ACTION_PREFIX + name;
+ this.name = name;
}
@Override
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/EnumEditorProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/EnumEditorProvider.java
index 5cf16deac6..f5a3ae5b6b 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/EnumEditorProvider.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/EnumEditorProvider.java
@@ -325,7 +325,8 @@ public class EnumEditorProvider extends ComponentProviderAdapter
showEnumAction.setToolBarData(
new ToolBarData(new GIcon("icon.plugin.enum.editor.home"), thirdGroup));
- FindReferencesToEnumFieldAction findReferencesAction = new FindReferencesToEnumFieldAction(plugin);
+ FindReferencesToEnumFieldAction findReferencesAction =
+ new FindReferencesToEnumFieldAction(plugin);
tool.addLocalAction(this, applyAction);
tool.addLocalAction(this, addAction);
@@ -726,8 +727,7 @@ public class EnumEditorProvider extends ComponentProviderAdapter
private ActionListener listener;
EnumPluginAction(String name, ActionListener listener) {
- super(DataTypeEditorManager.EDIT_ACTION_PREFIX + name, plugin.getName(),
- KeyBindingType.SHARED);
+ super(name, plugin.getName(), KeyBindingType.SHARED);
this.listener = listener;
setHelpLocation(new HelpLocation(HELP_TOPIC, name));
}
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/StructureEditorProviderTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/StructureEditorProviderTest.java
index 333100db01..7cffdc6475 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/StructureEditorProviderTest.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/StructureEditorProviderTest.java
@@ -704,7 +704,7 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
assertEquals("0x2d", model.getValueAt(15, model.getLengthColumn()));
assertEquals("0x145", model.getLengthAsString());
- DockingActionIf action = getAction(plugin, "Editor: Show Numbers In Hex");
+ DockingActionIf action = getAction(plugin, "Show Numbers In Hex");
setToggleActionSelected((ToggleDockingActionIf) action, new DefaultActionContext(), false);
assertEquals(false, model.isShowingNumbersInHex());
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/UnionEditorProviderTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/UnionEditorProviderTest.java
index cc27fd2b3e..c08c284da7 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/UnionEditorProviderTest.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/compositeeditor/UnionEditorProviderTest.java
@@ -345,7 +345,7 @@ public class UnionEditorProviderTest extends AbstractUnionEditorTest {
assertEquals("0x1d", model.getValueAt(15, model.getLengthColumn()));
assertEquals("0x57", model.getLengthAsString());
- DockingActionIf action = getAction(plugin, "Editor: Show Numbers In Hex");
+ DockingActionIf action = getAction(plugin, "Show Numbers In Hex");
setToggleActionSelected((ToggleDockingActionIf) action, new DefaultActionContext(), false);
assertEquals(false, model.isShowingNumbersInHex());
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java
index 022a895cfb..0a267ef31b 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java
@@ -48,7 +48,6 @@ import ghidra.app.plugin.core.compositeeditor.ApplyAction;
import ghidra.app.plugin.core.datamgr.actions.*;
import ghidra.app.plugin.core.datamgr.archive.Archive;
import ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler;
-import ghidra.app.plugin.core.datamgr.editor.DataTypeEditorManager;
import ghidra.app.plugin.core.datamgr.tree.*;
import ghidra.app.plugin.core.function.AbstractEditFunctionSignatureDialog;
import ghidra.app.plugin.core.programtree.ProgramTreePlugin;
@@ -777,7 +776,7 @@ public class DataTypeManagerPluginTest extends AbstractGhidraHeadedIntegrationTe
// the owner for the action is the tool, since the registered item is just a placeholder
// because the editor actions are shared actions
String owner = " (" + ToolConstants.SHARED_OWNER + ')';
- String actionName = DataTypeEditorManager.EDIT_ACTION_PREFIX + ApplyAction.ACTION_NAME;
+ String actionName = ApplyAction.ACTION_NAME;
String optionName = actionName + owner;
ToolOptions options = tool.getOptions(DockingToolConstants.KEY_BINDINGS);
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor1Test.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor1Test.java
index 5f0bdc977b..aeb9d70331 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor1Test.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor1Test.java
@@ -1326,15 +1326,15 @@ public class EnumEditor1Test extends AbstractGhidraHeadedIntegrationTest {
}
private DockingActionIf getAddAction() {
- return getAction(plugin, DataTypeEditorManager.EDIT_ACTION_PREFIX + "Add Enum Value");
+ return getAction(plugin, "Add Enum Value");
}
private DockingActionIf getApplyAction() {
- return getAction(plugin, DataTypeEditorManager.EDIT_ACTION_PREFIX + "Apply Enum Changes");
+ return getAction(plugin, "Apply Enum Changes");
}
private DockingActionIf getDeleteAction() {
- return getAction(plugin, DataTypeEditorManager.EDIT_ACTION_PREFIX + "Delete Enum Value");
+ return getAction(plugin, "Delete Enum Value");
}
private int getRowFor(String theName) {
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor2Test.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor2Test.java
index 1e4587c0f8..81c41f4187 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor2Test.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor2Test.java
@@ -545,7 +545,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
nameField.setText(newName);
});
- DockingActionIf applyAction = getAction(plugin, "Editor: Apply Enum Changes");
+ DockingActionIf applyAction = getAction(plugin, "Apply Enum Changes");
assertTrue(applyAction.isEnabled());
performAction(applyAction);
@@ -566,7 +566,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
nameField.setText(newDescription);
});
- DockingActionIf applyAction = getAction(plugin, "Editor: Apply Enum Changes");
+ DockingActionIf applyAction = getAction(plugin, "Apply Enum Changes");
assertTrue(applyAction.isEnabled());
performAction(applyAction);
@@ -900,15 +900,15 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
}
private DockingActionIf getAddAction() {
- return getAction(plugin, DataTypeEditorManager.EDIT_ACTION_PREFIX + "Add Enum Value");
+ return getAction(plugin, "Add Enum Value");
}
private DockingActionIf getApplyAction() {
- return getAction(plugin, DataTypeEditorManager.EDIT_ACTION_PREFIX + "Apply Enum Changes");
+ return getAction(plugin, "Apply Enum Changes");
}
private DockingActionIf getDeleteAction() {
- return getAction(plugin, DataTypeEditorManager.EDIT_ACTION_PREFIX + "Delete Enum Value");
+ return getAction(plugin, "Delete Enum Value");
}
private Enum editSampleEnum() {
diff --git a/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/DataTypeEditorsScreenShots.java b/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/DataTypeEditorsScreenShots.java
index 8482f280cc..4e7dc09fd0 100644
--- a/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/DataTypeEditorsScreenShots.java
+++ b/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/DataTypeEditorsScreenShots.java
@@ -184,8 +184,8 @@ public class DataTypeEditorsScreenShots extends GhidraScreenShotGenerator {
int numRows = table.getRowCount();
selectRow(table, numRows - 2);
- performAction("Editor: Duplicate Multiple of Component", "DataTypeManagerPlugin",
- structureEditor, false);
+ performAction("Duplicate Multiple of Component", "DataTypeManagerPlugin", structureEditor,
+ false);
waitForSwing();
captureDialog();
@@ -209,7 +209,7 @@ public class DataTypeEditorsScreenShots extends GhidraScreenShotGenerator {
int numRows = table.getRowCount();
selectRow(table, numRows - 2);
- performAction("Editor: Create Array", "DataTypeManagerPlugin", structureEditor, false);
+ performAction("Create Array", "DataTypeManagerPlugin", structureEditor, false);
waitForSwing();
captureDialog();
@@ -267,7 +267,7 @@ public class DataTypeEditorsScreenShots extends GhidraScreenShotGenerator {
JTable table = editorPanel.getTable();
selectRow(table, 4); // select byte:3 bitfield
- performAction("Editor: Edit Bitfield", "DataTypeManagerPlugin", structureEditor, false);
+ performAction("Edit Bitfield", "DataTypeManagerPlugin", structureEditor, false);
waitForSwing();
captureDialog();
diff --git a/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/StackEditorScreenShots.java b/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/StackEditorScreenShots.java
index 1d82f730c1..541b4d27d3 100644
--- a/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/StackEditorScreenShots.java
+++ b/Ghidra/Test/IntegrationTest/src/screen/java/help/screenshot/StackEditorScreenShots.java
@@ -73,7 +73,7 @@ public class StackEditorScreenShots extends GhidraScreenShotGenerator {
selectTableRow(table, "param_3");
waitForSwing();
- performAction("Editor: Create Array", "StackEditorManagerPlugin", stackEditor, false);
+ performAction("Create Array", "StackEditorManagerPlugin", stackEditor, false);
waitForSwing();
captureDialog();