Removes statics from hal sim (#825)

Based off of #824, the equivelent in sim.
This commit is contained in:
Thad House
2017-12-10 19:38:53 -08:00
committed by Peter Johnson
parent 8bd48d6c34
commit d2e7a90f41
78 changed files with 1008 additions and 576 deletions

View File

@@ -11,6 +11,7 @@ import com.google.common.base.Stopwatch;
import java.util.concurrent.TimeUnit;
import edu.wpi.first.wpilibj.hal.HAL;
import edu.wpi.first.wpilibj.util.BaseSystemNotInitializedException;
/**
@@ -25,6 +26,7 @@ public final class UnitTestUtility {
* Sets up the base system WPILib so that it does not rely on hardware.
*/
public static void setupMockBase() {
HAL.initialize(500, 0);
try {
// Check to see if this has been setup
Timer.getFPGATimestamp();

View File

@@ -9,9 +9,12 @@ package edu.wpi.first.wpilibj.can;
import org.junit.Test;
import edu.wpi.first.wpilibj.hal.HAL;
public class CANStatusTest {
@Test
public void canStatusGetDoesntThrow() {
HAL.initialize(500, 0);
CANStatus status = new CANStatus();
CANJNI.GetCANStatus(status);
// Nothing we can assert, so just make sure it didn't throw.

View File

@@ -19,6 +19,7 @@ public class JNITest {
@Test
public void jniHalLinkTest() {
HAL.initialize(500, 0);
// Test to verify that the JNI test link works correctly.
HALUtil.getHALRuntimeType();
}

View File

@@ -12,6 +12,7 @@ import org.junit.Test;
public class MatchInfoDataTest {
@Test
public void matchInfoDataDoesNotThrow() {
HAL.initialize(500, 0);
MatchInfoData data = new MatchInfoData();
HAL.getMatchInfo(data);
// Nothing we can assert, so just make sure it didn't throw.