mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Fixes testing framework typos & adds rule to keep unix line endings for .sh
Change-Id: I33826b879ba2dce7da88aa399d37f711a6612d86
This commit is contained in:
@@ -12,7 +12,6 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -20,14 +19,13 @@ import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
import edu.wpi.first.wpilibj.interfaces.Accelerometer;
|
||||
import edu.wpi.first.wpilibj.BuiltInAccelerometer;
|
||||
import edu.wpi.first.wpilibj.test.AbstractComsSetup;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class BuiltInAccelerometerTest extends AbstractComsSetup {
|
||||
private static final Logger logger = Logger.getLogger(PIDTest.class.getName());
|
||||
private static final Logger logger = Logger.getLogger(BuiltInAccelerometerTest.class.getName());
|
||||
private static final double kAccelerationTolerance = 0.1;
|
||||
private BuiltInAccelerometer m_accelerometer;
|
||||
private final BuiltInAccelerometer m_accelerometer;
|
||||
|
||||
public BuiltInAccelerometerTest(Accelerometer.Range range) {
|
||||
m_accelerometer = new BuiltInAccelerometer(range);
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -14,43 +16,28 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.AbstractCommandTest;
|
||||
import edu.wpi.first.wpilibj.networktables.NetworkTable;
|
||||
import edu.wpi.first.wpilibj.test.AbstractComsSetup;
|
||||
|
||||
/**
|
||||
* @author jonathanleitschuh
|
||||
*
|
||||
*/
|
||||
public class PrefrencesTest extends AbstractCommandTest {
|
||||
public class PrefrencesTest extends AbstractComsSetup {
|
||||
private static final Logger logger = Logger.getLogger(PrefrencesTest.class.getName());
|
||||
|
||||
private NetworkTable prefTable;
|
||||
private Preferences pref;
|
||||
private long check;
|
||||
|
||||
@Override
|
||||
protected Logger getClassLogger(){
|
||||
return logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@BeforeClass
|
||||
public static void setUpBeforeClass() throws Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@AfterClass
|
||||
public static void tearDownAfterClass() throws Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
@@ -77,13 +64,7 @@ public class PrefrencesTest extends AbstractCommandTest {
|
||||
check = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
}
|
||||
|
||||
|
||||
public void remove() {
|
||||
pref.remove("checkedValueLong");
|
||||
pref.remove("checkedValueDouble");
|
||||
@@ -101,7 +82,7 @@ public class PrefrencesTest extends AbstractCommandTest {
|
||||
pref.putFloat("checkedValueFloat", 1);
|
||||
pref.putBoolean("checkedValueBoolean", true);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testAddRemoveSave() {
|
||||
assertEquals(pref.getLong("checkedValueLong", 0), 172L);
|
||||
|
||||
@@ -13,26 +13,26 @@ import org.junit.runners.Suite.SuiteClasses;
|
||||
import edu.wpi.first.wpilibj.test.AbstractTestSuite;
|
||||
|
||||
/**
|
||||
* @author jonathanleitschuh
|
||||
* Holds all of the tests in the roor wpilibj directory
|
||||
* @author Jonathan Leitschuh
|
||||
* Holds all of the tests in the root wpilibj directory
|
||||
* Please list alphabetically so that it is easy to determine if a test is missing from the list
|
||||
*/
|
||||
@RunWith(Suite.class)
|
||||
@SuiteClasses({
|
||||
BuiltInAccelerometerTest.class,
|
||||
AnalogCrossConnectTest.class,
|
||||
AnalogPotentiometerTest.class,
|
||||
BuiltInAccelerometerTest.class,
|
||||
CounterTest.class,
|
||||
DIOCrossConnectTest.class,
|
||||
EncoderTest.class,
|
||||
GyroTest.class,
|
||||
MotorEncoderTest.class,
|
||||
PCMTest.class,
|
||||
PIDTest.class,
|
||||
PDPTest.class,
|
||||
PIDTest.class,
|
||||
PrefrencesTest.class,
|
||||
RelayCrossConnectTest.class,
|
||||
SampleTest.class,
|
||||
GyroTest.class,
|
||||
TimerTest.class
|
||||
})
|
||||
public class WpiLibJTestSuite extends AbstractTestSuite {
|
||||
|
||||
Reference in New Issue
Block a user