Merge remote-tracking branch 'origin/GT-0-dragonmacher-test-fixes'

This commit is contained in:
ghidravore 2020-03-02 18:00:46 -05:00
commit 7a85fdac25
3 changed files with 16 additions and 7 deletions

View File

@ -734,7 +734,7 @@ class CompositeViewerModel extends AbstractTableModel implements DataTypeManager
* For example, the name, or description change.
*/
protected void compositeInfoChanged() {
notify(modelListeners, CompositeViewerModelListener::componentDataChanged);
notify(modelListeners, CompositeViewerModelListener::compositeInfoChanged);
}
/**

View File

@ -147,12 +147,17 @@ public class GhidraScriptUtil {
/**
* Determine if the specified file is contained within the Ghidra installation.
* @param file - file or directory to check
* @param file file or directory to check
* @return true if file is contained within Ghidra application root.
*/
public static boolean isSystemFile(ResourceFile file) {
private static boolean isSystemFile(ResourceFile file) {
try {
String filePath = file.getCanonicalPath().replace('\\', '/');
if (filePath.startsWith(USER_SCRIPTS_DIR)) {
// a script inside of the user scripts dir is not a 'system' script
return false;
}
Collection<ResourceFile> roots = Application.getApplicationRootDirectories();
for (ResourceFile resourceFile : roots) {
String installPath = resourceFile.getCanonicalPath().replace('\\', '/');
@ -330,8 +335,10 @@ public class GhidraScriptUtil {
//
ResourceFile preferredFile = null;
for (ResourceFile file : matchingClassFiles) {
if (file.getParentFile().getAbsolutePath().equals(
GhidraScriptUtil.USER_SCRIPTS_BIN_DIR)) {
if (file.getParentFile()
.getAbsolutePath()
.equals(
GhidraScriptUtil.USER_SCRIPTS_BIN_DIR)) {
preferredFile = file;
break;
}

View File

@ -101,10 +101,12 @@ public class KeyBindingsTest extends AbstractGhidraHeadedIntegrationTest {
selectRowForAction(action1);
String actualText = getText(statusPane);
String description = action1.getDescription();
String escaped = description.replaceAll("&", "&amp;");
assertTrue(
"Description is not updated for action '" + action1.getName() + "'; instead the " +
"description is '" + actualText + "'",
actualText.indexOf(action1.getDescription()) != -1);
"description is '" + actualText + "'\n\tDescrption: " + escaped,
actualText.indexOf(escaped) != -1);
}
@Test