mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-08-25 03:56:41 +00:00
GP-0 fixing test failures related to GP-4275
This commit is contained in:
parent
362f571b19
commit
2b7821d956
|
@ -214,7 +214,7 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
|||
}
|
||||
});
|
||||
|
||||
scriptTable.setAccessibleNamePrefix("Script");
|
||||
scriptTable.setAccessibleNamePrefix("Scripts");
|
||||
|
||||
TableColumnModel columnModel = scriptTable.getColumnModel();
|
||||
// Set default column sizes
|
||||
|
@ -464,6 +464,10 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
|||
return scriptTable;
|
||||
}
|
||||
|
||||
GTree getTree() {
|
||||
return scriptCategoryTree;
|
||||
}
|
||||
|
||||
int getScriptIndex(ResourceFile scriptFile) {
|
||||
return tableFilterPanel.getViewRow(tableModel.getScriptIndex(scriptFile));
|
||||
}
|
||||
|
|
|
@ -28,9 +28,12 @@ public class ListingFieldDescriptionProvider implements FieldDescriptionProvider
|
|||
if (field instanceof ListingField listingField) {
|
||||
FieldFactory fieldFactory = listingField.getFieldFactory();
|
||||
ProgramLocation location = fieldFactory.getProgramLocation(0, 0, listingField);
|
||||
Address address = location.getAddress();
|
||||
String addressString = address.toString(address.getAddressSpace().showSpaceName(), 1);
|
||||
return fieldFactory.getFieldName() + " Field at Address " + addressString;
|
||||
if (location != null) {
|
||||
Address address = location.getAddress();
|
||||
String addressString =
|
||||
address.toString(address.getAddressSpace().showSpaceName(), 1);
|
||||
return fieldFactory.getFieldName() + " Field at Address " + addressString;
|
||||
}
|
||||
}
|
||||
return "No program open";
|
||||
}
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.commentwindow;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
|
@ -99,7 +98,7 @@ public class CommentWindowPluginTest extends AbstractGhidraHeadedIntegrationTest
|
|||
Container container = commentWindowProvider.getComponent().getParent();
|
||||
assertNotNull(container);
|
||||
|
||||
commentTable = (GTable) findComponentByName(container, "CommentTable");
|
||||
commentTable = (GTable) findComponentByName(container, "Comments Table");
|
||||
assertNotNull(commentTable);
|
||||
|
||||
ThreadedTableModel<?, ?> tableModel = (ThreadedTableModel<?, ?>) commentTable.getModel();
|
||||
|
|
|
@ -58,7 +58,7 @@ public class FunctionWindowPluginTest extends AbstractGhidraHeadedIntegrationTes
|
|||
plugin.showFunctions();
|
||||
waitForSwing();
|
||||
provider = tool.getComponentProvider("Functions Window");
|
||||
functionTable = (GTable) findComponentByName(provider.getComponent(), "FunctionTable");
|
||||
functionTable = (GTable) findComponentByName(provider.getComponent(), "Functions Table");
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -122,11 +122,11 @@ public abstract class AbstractGhidraScriptMgrPluginTest
|
|||
ConsoleComponentProvider consoleProvider =
|
||||
waitForComponentProvider(ConsoleComponentProvider.class);
|
||||
consoleTextPane =
|
||||
(JTextPane) findComponentByName(consoleProvider.getComponent(), "CONSOLE");
|
||||
(JTextPane) findComponentByName(consoleProvider.getComponent(), "Console Text Pane");
|
||||
assertNotNull(consoleTextPane);
|
||||
|
||||
scriptTable =
|
||||
(DraggableScriptTable) findComponentByName(provider.getComponent(), "SCRIPT_TABLE");
|
||||
(DraggableScriptTable) findComponentByName(provider.getComponent(), "Scripts Table");
|
||||
assertNotNull(scriptTable);
|
||||
|
||||
clearConsole();
|
||||
|
@ -211,11 +211,8 @@ public abstract class AbstractGhidraScriptMgrPluginTest
|
|||
}
|
||||
|
||||
protected void selectCategory(String category) {
|
||||
|
||||
GTree categoryTree = (GTree) findComponentByName(provider.getComponent(), "CATEGORY_TREE");
|
||||
GTree categoryTree = provider.getTree();
|
||||
waitForTree(categoryTree);
|
||||
JTree jTree = (JTree) invokeInstanceMethod("getJTree", categoryTree);
|
||||
assertNotNull(jTree);
|
||||
GTreeNode child = categoryTree.getModelRoot().getChild(category);
|
||||
categoryTree.setSelectedNode(child);
|
||||
waitForTree(categoryTree);
|
||||
|
|
|
@ -1631,7 +1631,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
SymbolProvider symbolTableProvider = waitForComponentProvider(SymbolProvider.class);
|
||||
|
||||
symbolTable =
|
||||
(GTable) findComponentByName(symbolTableProvider.getComponent(), "SymbolTable");
|
||||
(GTable) findComponentByName(symbolTableProvider.getComponent(), "Symbol Table");
|
||||
assertNotNull(symbolTable);
|
||||
|
||||
symbolModel = (SymbolTableModel) symbolTable.getModel();
|
||||
|
@ -1656,7 +1656,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
performAction(viewRefAction, true);
|
||||
ReferenceProvider referencesProvider = waitForComponentProvider(ReferenceProvider.class);
|
||||
referenceTable =
|
||||
(GTable) findComponentByName(referencesProvider.getComponent(), "ReferenceTable");
|
||||
(GTable) findComponentByName(referencesProvider.getComponent(), "Reference Table");
|
||||
assertNotNull(referenceTable);
|
||||
}
|
||||
|
||||
|
|
|
@ -88,8 +88,8 @@ public class ByteViewerComponent extends FieldPanel implements FieldMouseListene
|
|||
this.fm = fm;
|
||||
this.layoutModel = layoutModel;
|
||||
|
||||
setName("Byte Viewer");
|
||||
getAccessibleContext().setAccessibleName("ByteViewer");
|
||||
setName(model.getName());
|
||||
getAccessibleContext().setAccessibleName("Byte Viewer " + model.getName());
|
||||
initialize();
|
||||
|
||||
// specialized line coloring
|
||||
|
|
|
@ -260,6 +260,7 @@ public class GTree extends JPanel implements BusyListener {
|
|||
* example if the tree contains fruits, then "Fruits" would be an appropriate prefix name.
|
||||
*/
|
||||
public void setAccessibleNamePrefix(String namePrefix) {
|
||||
setName(namePrefix + "GTree");
|
||||
tree.setName(namePrefix + " Tree");
|
||||
tree.getAccessibleContext().setAccessibleName(namePrefix);
|
||||
tree.getAccessibleContext().setAccessibleDescription("");
|
||||
|
|
Loading…
Reference in a new issue