mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-23 04:39:55 +00:00
GP-0 Corrected test failures
This commit is contained in:
parent
f6dfa0964a
commit
1dad9f85c0
@ -186,13 +186,14 @@ public class StructureEditorLockedCellEditTest extends AbstractStructureEditorTe
|
||||
typeInCellEditor("Ab\bm");
|
||||
|
||||
// Bad value prevents action performed.
|
||||
triggerActionKey(getTable(), 0, KeyEvent.VK_ENTER);
|
||||
enter();
|
||||
assertIsEditingField(2, model.getDataTypeColumn());
|
||||
|
||||
// Bad value allows escape.
|
||||
triggerActionKey(getTable(), 0, KeyEvent.VK_ESCAPE);
|
||||
triggerActionKey(getTable(), 0, KeyEvent.VK_ESCAPE);
|
||||
assertTrue(model.getStatus().startsWith("Unrecognized data type"));
|
||||
|
||||
escape();
|
||||
assertNotEditingField();
|
||||
|
||||
assertEquals(1, model.getNumSelectedRows());
|
||||
assertEquals(2, model.getMinIndexSelected());
|
||||
assertEquals(getDataType(2), dt);
|
||||
@ -214,18 +215,18 @@ public class StructureEditorLockedCellEditTest extends AbstractStructureEditorTe
|
||||
enter();
|
||||
|
||||
assertIsEditingField(2, column);
|
||||
assertTrue(model.getStatus().startsWith("Unrecognized data type"));
|
||||
|
||||
escape();
|
||||
|
||||
assertNotEditingField();
|
||||
|
||||
assertEquals(1, model.getNumSelectedRows());
|
||||
assertEquals(2, model.getMinIndexSelected());
|
||||
assertCellString("word", 2, column);
|
||||
assertEquals(29, model.getLength());
|
||||
assertEquals(dt, getDataType(2));
|
||||
|
||||
escape();
|
||||
assertNotEditingField();
|
||||
assertEquals(dt, getDataType(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -237,6 +238,7 @@ public class StructureEditorLockedCellEditTest extends AbstractStructureEditorTe
|
||||
|
||||
assertEquals(29, model.getLength());
|
||||
assertEquals(2, dt.getLength());
|
||||
|
||||
clickTableCell(getTable(), 2, column, 2);
|
||||
assertIsEditingField(2, column);
|
||||
|
||||
@ -244,9 +246,12 @@ public class StructureEditorLockedCellEditTest extends AbstractStructureEditorTe
|
||||
enter();
|
||||
|
||||
assertIsEditingField(2, column);
|
||||
escape();
|
||||
|
||||
assertTrue(model.getStatus().startsWith(str + " doesn't fit"));
|
||||
|
||||
escape();
|
||||
assertNotEditingField();
|
||||
|
||||
assertEquals(1, model.getNumSelectedRows());
|
||||
assertEquals(2, model.getMinIndexSelected());
|
||||
assertCellString(dt.getDisplayName(), 2, column);
|
||||
@ -386,8 +391,8 @@ public class StructureEditorLockedCellEditTest extends AbstractStructureEditorTe
|
||||
init(simpleStructure, pgmBbCat);
|
||||
|
||||
startTransaction("addExternal");
|
||||
ExternalLocation extLoc = program.getExternalManager().addExtFunction(Library.UNKNOWN,
|
||||
"extLabel", null, SourceType.USER_DEFINED);
|
||||
ExternalLocation extLoc = program.getExternalManager()
|
||||
.addExtFunction(Library.UNKNOWN, "extLabel", null, SourceType.USER_DEFINED);
|
||||
Function function = extLoc.createFunction();
|
||||
endTransaction(true);
|
||||
|
||||
|
@ -21,6 +21,7 @@ import java.awt.Window;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.DialogComponentProvider;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
@ -91,6 +92,9 @@ public class StructureEditorNotifiedTest extends AbstractStructureEditorTest {
|
||||
programDTM.getCategory(pgmRootCat.getCategoryPath())
|
||||
.removeCategory("Temp", TaskMonitor.DUMMY);
|
||||
|
||||
DialogComponentProvider dlg = waitForDialogComponent("Close Structure Editor?");
|
||||
pressButton(dlg.getComponent(), "No");
|
||||
|
||||
waitForSwing();
|
||||
|
||||
// complexStructure* gets removed and becomes 4 undefined bytes in this editor.
|
||||
|
Loading…
Reference in New Issue
Block a user