mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Enable checkstyle on cscore, ntcore, wpiutil (#1032)
Also update to version 8.10.
This commit is contained in:
committed by
Peter Johnson
parent
ecfe95383c
commit
40cc743cc7
@@ -7,13 +7,13 @@
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import edu.wpi.first.wpilibj.hal.HAL;
|
||||
import edu.wpi.first.wpilibj.util.BaseSystemNotInitializedException;
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.command;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Ported from the old CrioTest Classes.
|
||||
*/
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.command;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Ported from the old CrioTest Classes.
|
||||
*/
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.command;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Before;
|
||||
//import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ConditionalCommandTest extends AbstractCommandTest {
|
||||
MockConditionalCommand m_command;
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.hal;
|
||||
|
||||
import edu.wpi.first.networktables.NetworkTablesJNI;
|
||||
import org.junit.Test;
|
||||
|
||||
import edu.wpi.first.networktables.NetworkTablesJNI;
|
||||
|
||||
public class JNITest {
|
||||
@Test
|
||||
public void jniNtcoreLinkTest() {
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.sim;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import edu.wpi.first.wpilibj.AnalogInput;
|
||||
import edu.wpi.first.wpilibj.hal.HAL;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class AnalogInputSimTest {
|
||||
static class DoubleStore {
|
||||
public boolean wasTriggered = false;
|
||||
public boolean wasCorrectType = false;
|
||||
public double setValue = 0;
|
||||
public boolean m_wasTriggered = false;
|
||||
public boolean m_wasCorrectType = false;
|
||||
public double m_setValue = 0;
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -30,7 +30,7 @@ public class AnalogInputSimTest {
|
||||
|
||||
AnalogInSim inputSim = input.getSimObject();
|
||||
|
||||
for (double i = 0; i < 5.0; i+=0.1) {
|
||||
for (double i = 0; i < 5.0; i += 0.1) {
|
||||
inputSim.setVoltage(0);
|
||||
|
||||
assertEquals(input.getVoltage(), 0, 0.001);
|
||||
|
||||
@@ -7,25 +7,25 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.sim;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import edu.wpi.first.wpilibj.AnalogOutput;
|
||||
import edu.wpi.first.wpilibj.hal.HAL;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class AnalogOutputSimTest {
|
||||
static class DoubleStore {
|
||||
public boolean wasTriggered = false;
|
||||
public boolean wasCorrectType = false;
|
||||
public double setValue = -1;
|
||||
public boolean m_wasTriggered = false;
|
||||
public boolean m_wasCorrectType = false;
|
||||
public double m_setValue = -1;
|
||||
|
||||
public void reset() {
|
||||
wasCorrectType = false;
|
||||
wasTriggered = false;
|
||||
setValue = -1;
|
||||
m_wasCorrectType = false;
|
||||
m_wasTriggered = false;
|
||||
m_setValue = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,27 +41,27 @@ public class AnalogOutputSimTest {
|
||||
|
||||
DoubleStore store = new DoubleStore();
|
||||
|
||||
try (CallbackStore cb = outputSim.registerVoltageCallback((s, v) -> {
|
||||
store.wasTriggered = true;
|
||||
store.wasCorrectType = true;
|
||||
store.setValue = v.getDouble();
|
||||
try (CallbackStore cb = outputSim.registerVoltageCallback((name, value) -> {
|
||||
store.m_wasTriggered = true;
|
||||
store.m_wasCorrectType = true;
|
||||
store.m_setValue = value.getDouble();
|
||||
}, false)) {
|
||||
assertFalse(store.wasTriggered);
|
||||
assertFalse(store.m_wasTriggered);
|
||||
|
||||
for (double i = 0.1; i < 5.0; i+=0.1) {
|
||||
for (double i = 0.1; i < 5.0; i += 0.1) {
|
||||
store.reset();
|
||||
|
||||
output.setVoltage(0);
|
||||
|
||||
assertTrue(store.wasTriggered);
|
||||
assertEquals(store.setValue, 0, 0.001);
|
||||
assertTrue(store.m_wasTriggered);
|
||||
assertEquals(store.m_setValue, 0, 0.001);
|
||||
|
||||
store.reset();
|
||||
|
||||
output.setVoltage(i);
|
||||
|
||||
assertTrue(store.wasTriggered);
|
||||
assertEquals(store.setValue, i, 0.001);
|
||||
assertTrue(store.m_wasTriggered);
|
||||
assertEquals(store.m_setValue, i, 0.001);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user