mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-3-3-26' into Ghidra_12.1
This commit is contained in:
@@ -41,7 +41,6 @@ public class SymbolReferenceModel extends AddressBasedTableModel<Reference> {
|
|||||||
static final int ACCESS_COL = 3;
|
static final int ACCESS_COL = 3;
|
||||||
static final int PREVIEW_COL = 4;
|
static final int PREVIEW_COL = 4;
|
||||||
|
|
||||||
static final String ADDR_COL_NAME = "Address";
|
|
||||||
static final String LABEL_COL_NAME = "Label";
|
static final String LABEL_COL_NAME = "Label";
|
||||||
static final String SUBROUTINE_COL_NAME = "Subroutine";
|
static final String SUBROUTINE_COL_NAME = "Subroutine";
|
||||||
static final String ACCESS_COL_NAME = "Access";
|
static final String ACCESS_COL_NAME = "Access";
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import docking.action.DockingActionIf;
|
|||||||
import docking.action.ToggleDockingAction;
|
import docking.action.ToggleDockingAction;
|
||||||
import docking.widgets.filter.*;
|
import docking.widgets.filter.*;
|
||||||
import docking.widgets.table.*;
|
import docking.widgets.table.*;
|
||||||
|
import docking.widgets.table.threaded.ThreadedTableModel;
|
||||||
import ghidra.app.cmd.label.AddLabelCmd;
|
import ghidra.app.cmd.label.AddLabelCmd;
|
||||||
import ghidra.app.cmd.label.CreateNamespacesCmd;
|
import ghidra.app.cmd.label.CreateNamespacesCmd;
|
||||||
import ghidra.app.cmd.refs.RemoveReferenceCmd;
|
import ghidra.app.cmd.refs.RemoveReferenceCmd;
|
||||||
@@ -517,7 +518,12 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
int startRefCount = symbol.getReferenceCount();
|
int startRefCount = symbol.getReferenceCount();
|
||||||
assertTrue(startRefCount > 0);
|
assertTrue(startRefCount > 0);
|
||||||
|
|
||||||
performAction(deleteAllAction, provider, true);
|
performAction(deleteAllAction, provider, false);
|
||||||
|
|
||||||
|
DialogComponentProvider dialog = waitForDialogComponent("Delete References?");
|
||||||
|
pressButtonByText(dialog, "Delete");
|
||||||
|
waitForTasks();
|
||||||
|
|
||||||
assertEquals(0, symbol.getReferenceCount());
|
assertEquals(0, symbol.getReferenceCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1200,6 +1206,8 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
showReferencesTable();
|
showReferencesTable();
|
||||||
ReferenceProvider referencesProvider = waitForComponentProvider(ReferenceProvider.class);
|
ReferenceProvider referencesProvider = waitForComponentProvider(ReferenceProvider.class);
|
||||||
|
|
||||||
|
setReferenceType(referencesProvider, "References To");
|
||||||
|
|
||||||
// pick symbol with refs
|
// pick symbol with refs
|
||||||
selectRow("ghidra");
|
selectRow("ghidra");
|
||||||
|
|
||||||
@@ -1207,7 +1215,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
assertReference("01004101", "00000052", true);
|
assertReference("01004101", "00000052", true);
|
||||||
|
|
||||||
DockingActionIf deleteRefsAction =
|
DockingActionIf deleteRefsAction =
|
||||||
getAction(tool, plugin.getName(), "Delete Reference");
|
getAction(tool, plugin.getName(), "Delete References");
|
||||||
assertFalse(isEnabled(deleteRefsAction, referencesProvider));
|
assertFalse(isEnabled(deleteRefsAction, referencesProvider));
|
||||||
|
|
||||||
selectRef(referenceTable, "01004101", "00000052");
|
selectRef(referenceTable, "01004101", "00000052");
|
||||||
@@ -1222,6 +1230,17 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
// Helper methods
|
// 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")
|
@SuppressWarnings("unchecked")
|
||||||
private void selectRef(GTable table, String from, String to) throws Exception {
|
private void selectRef(GTable table, String from, String to) throws Exception {
|
||||||
|
|
||||||
@@ -1816,5 +1835,4 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user