GP-0 Corrected test issues

This commit is contained in:
ghidra1 2025-03-26 10:36:32 -04:00
parent f2e8afff9c
commit 1a80aff30a
4 changed files with 9 additions and 6 deletions

View file

@ -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) {

View file

@ -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);
}
if (StringUtils.isBlank(comp.getComment())) {
comp.setComment(comment);
}
});
fixSelection();
componentEdited();
@ -1488,6 +1492,5 @@ class StructureEditorModel extends CompEditorModel {
zeroDtc.getFieldName(), zeroDtc.getComment());
}
}
zeroDtcStack.clear();
}
}

View file

@ -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());

View file

@ -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());