Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-3-3-26' into Ghidra_12.1

This commit is contained in:
Ryan Kurtz
2026-03-03 13:58:05 -05:00
2 changed files with 21 additions and 4 deletions

View File

@@ -41,7 +41,6 @@ public class SymbolReferenceModel extends AddressBasedTableModel<Reference> {
static final int ACCESS_COL = 3;
static final int PREVIEW_COL = 4;
static final String ADDR_COL_NAME = "Address";
static final String LABEL_COL_NAME = "Label";
static final String SUBROUTINE_COL_NAME = "Subroutine";
static final String ACCESS_COL_NAME = "Access";

View File

@@ -38,6 +38,7 @@ import docking.action.DockingActionIf;
import docking.action.ToggleDockingAction;
import docking.widgets.filter.*;
import docking.widgets.table.*;
import docking.widgets.table.threaded.ThreadedTableModel;
import ghidra.app.cmd.label.AddLabelCmd;
import ghidra.app.cmd.label.CreateNamespacesCmd;
import ghidra.app.cmd.refs.RemoveReferenceCmd;
@@ -517,7 +518,12 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
int startRefCount = symbol.getReferenceCount();
assertTrue(startRefCount > 0);
performAction(deleteAllAction, provider, true);
performAction(deleteAllAction, provider, false);
DialogComponentProvider dialog = waitForDialogComponent("Delete References?");
pressButtonByText(dialog, "Delete");
waitForTasks();
assertEquals(0, symbol.getReferenceCount());
}
@@ -1200,6 +1206,8 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
showReferencesTable();
ReferenceProvider referencesProvider = waitForComponentProvider(ReferenceProvider.class);
setReferenceType(referencesProvider, "References To");
// pick symbol with refs
selectRow("ghidra");
@@ -1207,7 +1215,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
assertReference("01004101", "00000052", true);
DockingActionIf deleteRefsAction =
getAction(tool, plugin.getName(), "Delete Reference");
getAction(tool, plugin.getName(), "Delete References");
assertFalse(isEnabled(deleteRefsAction, referencesProvider));
selectRef(referenceTable, "01004101", "00000052");
@@ -1222,6 +1230,17 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
// Helper methods
//==================================================================================================
private void setReferenceType(ComponentProvider referencesProvider, String referenceType) {
ToggleDockingAction action = (ToggleDockingAction) getAction(plugin, referenceType);
performAction(action, referencesProvider, true);
Object refProvider = getInstanceField("refProvider", plugin);
ThreadedTableModel<?, ?> model =
(ThreadedTableModel<?, ?>) getInstanceField("referenceKeyModel", refProvider);
waitForTableModel(model);
}
@SuppressWarnings("unchecked")
private void selectRef(GTable table, String from, String to) throws Exception {
@@ -1816,5 +1835,4 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
return -1;
}
}