mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
GP-0 Corrected test issues
This commit is contained in:
parent
f2e8afff9c
commit
1a80aff30a
4 changed files with 9 additions and 6 deletions
|
@ -692,7 +692,7 @@ abstract public class CompositeEditorModel extends CompositeViewerModel {
|
|||
if (!isArrayAllowed()) {
|
||||
throw new UsrException("Array not permitted in current context");
|
||||
}
|
||||
int min = 0;
|
||||
int min = allowsZeroLengthComponents() ? 0 : 1;
|
||||
int max = getMaxElements();
|
||||
if (isSingleRowSelection()) {
|
||||
if (max != 0) {
|
||||
|
|
|
@ -20,6 +20,8 @@ import java.util.*;
|
|||
|
||||
import javax.swing.table.TableColumn;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.dialogs.InputDialog;
|
||||
import docking.widgets.dialogs.InputDialogListener;
|
||||
|
@ -1458,7 +1460,7 @@ class StructureEditorModel extends CompEditorModel {
|
|||
selection.addRange(rowIndex, rowIndex + numComps);
|
||||
|
||||
DataTypeComponent comp = getComponent(rowIndex);
|
||||
// Set the field name and comment the same as before
|
||||
// Set the field name and comment the same as before if unspecified
|
||||
try {
|
||||
if (comp.getFieldName() == null) {
|
||||
comp.setFieldName(fieldName);
|
||||
|
@ -1467,7 +1469,9 @@ class StructureEditorModel extends CompEditorModel {
|
|||
catch (DuplicateNameException exc) {
|
||||
Msg.showError(this, null, null, null);
|
||||
}
|
||||
comp.setComment(comment);
|
||||
if (StringUtils.isBlank(comp.getComment())) {
|
||||
comp.setComment(comment);
|
||||
}
|
||||
});
|
||||
fixSelection();
|
||||
componentEdited();
|
||||
|
@ -1488,6 +1492,5 @@ class StructureEditorModel extends CompEditorModel {
|
|||
zeroDtc.getFieldName(), zeroDtc.getComment());
|
||||
}
|
||||
}
|
||||
zeroDtcStack.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -361,7 +361,7 @@ public class StructureEditorLockedEnablementTest extends AbstractStructureEditor
|
|||
|
||||
setSelection(new int[] { 19 });
|
||||
assertEquals("simpleStructureTypedef", getDataType(19).getDisplayName());
|
||||
assertTrue(!unpackageAction.isEnabled());
|
||||
assertTrue(unpackageAction.isEnabled());
|
||||
|
||||
setSelection(new int[] { 21 });
|
||||
assertEquals("simpleStructure", getDataType(21).getDisplayName());
|
||||
|
|
|
@ -341,7 +341,7 @@ public class StructureEditorUnlockedEnablementTest extends AbstractStructureEdit
|
|||
|
||||
setSelection(new int[] { 19 });
|
||||
assertEquals("simpleStructureTypedef", getDataType(19).getDisplayName());
|
||||
assertTrue(!unpackageAction.isEnabled());
|
||||
assertTrue(unpackageAction.isEnabled());
|
||||
|
||||
setSelection(new int[] { 21 });
|
||||
assertEquals("simpleStructure", getDataType(21).getDisplayName());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue