mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-22 23:49:03 +08:00
Merge remote-tracking branch 'origin/GP-1196_ghizard_AbstractGTest_Rule_fix'
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
*/
|
||||
package generic.test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
@@ -26,6 +27,7 @@ import java.util.function.BooleanSupplier;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
import ghidra.framework.Application;
|
||||
@@ -37,10 +39,10 @@ import junit.framework.AssertionFailedError;
|
||||
|
||||
/**
|
||||
* A root for system tests that provides known system information.
|
||||
*
|
||||
*
|
||||
* <P>This class exists so that fast unit tests have a place to share data without having the
|
||||
* slowness of more heavy weight concepts like {@link Application}, logging, etc.
|
||||
*
|
||||
*
|
||||
* <P> !! WARNING !!
|
||||
* This test is meant to initialize quickly. All file I/O should be avoided.
|
||||
*/
|
||||
@@ -68,6 +70,7 @@ public abstract class AbstractGTest {
|
||||
|
||||
private static String testDirectoryPath = createTestDirectoryPath();
|
||||
|
||||
@Rule
|
||||
public TestName testName = new TestName();
|
||||
|
||||
/**
|
||||
@@ -318,7 +321,7 @@ public abstract class AbstractGTest {
|
||||
|
||||
/**
|
||||
* Returns the current test method name
|
||||
*
|
||||
*
|
||||
* @return the current test method name
|
||||
*/
|
||||
public String getName() {
|
||||
@@ -327,7 +330,7 @@ public abstract class AbstractGTest {
|
||||
|
||||
/**
|
||||
* Friendly way to create an array of bytes with static values.
|
||||
*
|
||||
*
|
||||
* @param unsignedBytes var-args list of unsigned byte values (ie. 0..255)
|
||||
* @return array of bytes
|
||||
*/
|
||||
@@ -339,7 +342,6 @@ public abstract class AbstractGTest {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// Wait Methods
|
||||
//==================================================================================================
|
||||
@@ -360,7 +362,7 @@ public abstract class AbstractGTest {
|
||||
|
||||
/**
|
||||
* Waits for the given latch to be counted-down
|
||||
*
|
||||
*
|
||||
* @param latch the latch to await
|
||||
* @throws AssertionFailedError if the condition is not met within the timeout period
|
||||
*/
|
||||
@@ -376,7 +378,7 @@ public abstract class AbstractGTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for the given AtomicBoolean to return true. This is a convenience method for
|
||||
* Waits for the given AtomicBoolean to return true. This is a convenience method for
|
||||
* {@link #waitFor(BooleanSupplier)}.
|
||||
*
|
||||
* @param ab the atomic boolean
|
||||
@@ -564,5 +566,5 @@ public abstract class AbstractGTest {
|
||||
|
||||
//==================================================================================================
|
||||
// End Wait Methods
|
||||
//==================================================================================================
|
||||
//==================================================================================================
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user