mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-21 19:42:14 +00:00
Merge remote-tracking branch 'origin/dev747368_fix_dataaction_tests'
This commit is contained in:
commit
da40d9f2f0
@ -1270,7 +1270,8 @@ public abstract class AbstractDataActionTest extends AbstractGhidraHeadedIntegra
|
||||
checkAction(actions, EDIT_DATA_TYPE,
|
||||
pdata != null && (pdata.isStructure() || pdata.isUnion()), caseName);
|
||||
checkAction(actions, CREATE_ARRAY, true, caseName);
|
||||
checkAction(actions, DEFAULT_DATA_SETTINGS, !hasSelection && hasSettings, caseName);
|
||||
checkAction(actions, DEFAULT_DATA_SETTINGS,
|
||||
(!hasSelection || isSelectionJustSingleDataInstance(sel, d)) && hasSettings, caseName);
|
||||
checkAction(actions, DATA_SETTINGS, hasNormalUnitSelection || hasSettings, caseName);
|
||||
checkAction(actions, CYCLE_FLOAT_DOUBLE, onFloatDoubleData, caseName);
|
||||
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, onByteWordData, caseName);
|
||||
@ -1332,7 +1333,8 @@ public abstract class AbstractDataActionTest extends AbstractGhidraHeadedIntegra
|
||||
checkAction(actions, EDIT_DATA_TYPE,
|
||||
pdata != null && (pdata.isStructure() || pdata.isUnion()), caseName);
|
||||
checkAction(actions, CREATE_ARRAY, true, caseName);
|
||||
checkAction(actions, DEFAULT_DATA_SETTINGS, hasSettings && !hasSelection, caseName);
|
||||
checkAction(actions, DEFAULT_DATA_SETTINGS,
|
||||
hasSettings && (!hasSelection || isSelectionJustSingleDataInstance(sel, d)), caseName);
|
||||
checkAction(actions, DATA_SETTINGS, hasSettings, caseName);
|
||||
checkAction(actions, CYCLE_FLOAT_DOUBLE, true, caseName);
|
||||
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, true, caseName);
|
||||
@ -1474,6 +1476,14 @@ public abstract class AbstractDataActionTest extends AbstractGhidraHeadedIntegra
|
||||
return;
|
||||
}
|
||||
|
||||
private boolean isSelectionJustSingleDataInstance(ProgramSelection selection, Data data) {
|
||||
if (selection != null && data != null) {
|
||||
AddressSet dataAS = new AddressSet(data.getAddress(), data.getMaxAddress());
|
||||
return dataAS.hasSameAddresses(selection);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected ActionContext getProgramContext() {
|
||||
cb.updateNow();
|
||||
ActionContext context = cb.getProvider().getActionContext(null);
|
||||
|
Loading…
Reference in New Issue
Block a user