mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Merge remote-tracking branch 'origin/GT-3205-dragonmacher-test-method-fix' into Ghidra_9.1
This commit is contained in:
commit
30166ef574
2 changed files with 7 additions and 27 deletions
|
@ -773,27 +773,6 @@ public class GTreeTest extends AbstractDockingTest {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void testFailed(Throwable e) {
|
|
||||||
StringBuilder buffy = new StringBuilder();
|
|
||||||
printTree(gTree.getRootNode(), 0, buffy);
|
|
||||||
System.err.println("GTree state: ");
|
|
||||||
System.err.println(buffy.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void printTree(GTreeNode node, int indentLevel, StringBuilder buffy) {
|
|
||||||
buffy.append('\n');
|
|
||||||
for (int i = 0; i < indentLevel; i++) {
|
|
||||||
buffy.append('\t');
|
|
||||||
}
|
|
||||||
buffy.append("node: " + node.getName());
|
|
||||||
int nextIndentLevel = indentLevel + 1;
|
|
||||||
List<GTreeNode> children = node.getChildren();
|
|
||||||
for (GTreeNode child : children) {
|
|
||||||
printTree(child, nextIndentLevel, buffy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertProgressPanel(boolean isShowing) {
|
private void assertProgressPanel(boolean isShowing) {
|
||||||
JComponent panel = (JComponent) getInstanceField("progressPanel", gTree);
|
JComponent panel = (JComponent) getInstanceField("progressPanel", gTree);
|
||||||
if (!isShowing) {
|
if (!isShowing) {
|
||||||
|
|
|
@ -216,7 +216,8 @@ public abstract class AbstractGenericTest extends AbstractGTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A callback for subclasses when a test has failed. This will be called
|
* A callback for subclasses when a test has failed. This will be called
|
||||||
* before <code>tearDown()</code>
|
* <b>after</b> <code>tearDown()</code>. This means that any diagnostics will have to
|
||||||
|
* take into account items that have already been disposed.
|
||||||
*
|
*
|
||||||
* @param e the exception that happened when the test failed
|
* @param e the exception that happened when the test failed
|
||||||
*/
|
*/
|
||||||
|
@ -292,7 +293,7 @@ public abstract class AbstractGenericTest extends AbstractGTest {
|
||||||
* @param cls class where resource exists
|
* @param cls class where resource exists
|
||||||
* @param name resource filename
|
* @param name resource filename
|
||||||
* @return list of lines contained in file
|
* @return list of lines contained in file
|
||||||
* @throws IOException
|
* @throws IOException if an exception occurs reading the given resource
|
||||||
*/
|
*/
|
||||||
public static List<String> loadTextResource(Class<?> cls, String name) throws IOException {
|
public static List<String> loadTextResource(Class<?> cls, String name) throws IOException {
|
||||||
|
|
||||||
|
@ -348,7 +349,7 @@ public abstract class AbstractGenericTest extends AbstractGTest {
|
||||||
* Returns a file that points to the location on disk of the given relative
|
* Returns a file that points to the location on disk of the given relative
|
||||||
* path name. The path is relative to the test resources directory.
|
* path name. The path is relative to the test resources directory.
|
||||||
*
|
*
|
||||||
* @param relativePath
|
* @param relativePath the path of the file
|
||||||
* @return a file that points to the location on disk of the relative path.
|
* @return a file that points to the location on disk of the relative path.
|
||||||
* @throws FileNotFoundException If the directory does not exist
|
* @throws FileNotFoundException If the directory does not exist
|
||||||
* @throws IOException if the given path does not represent a directory
|
* @throws IOException if the given path does not represent a directory
|
||||||
|
@ -486,9 +487,9 @@ public abstract class AbstractGenericTest extends AbstractGTest {
|
||||||
* has the type classType. This method is only really useful if it is known
|
* has the type classType. This method is only really useful if it is known
|
||||||
* that only a single field of classType exists within the ownerInstance.
|
* that only a single field of classType exists within the ownerInstance.
|
||||||
*
|
*
|
||||||
* @param <T>
|
* @param <T> the type
|
||||||
* @param classType
|
* @param classType the class type of the desired field
|
||||||
* @param ownerInstance
|
* @param ownerInstance the object instance that owns the field
|
||||||
* @return field object of type classType or null
|
* @return field object of type classType or null
|
||||||
*/
|
*/
|
||||||
public static <T> T getInstanceFieldByClassType(Class<T> classType, Object ownerInstance) {
|
public static <T> T getInstanceFieldByClassType(Class<T> classType, Object ownerInstance) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue