Skip to content

Commit

Permalink
fixed disabled tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sigalrmp committed Dec 1, 2024
1 parent 77f2fd3 commit 6524285
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/test/java/org/sciborgs1155/robot/SwerveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.sciborgs1155.robot.drive.Drive;
import org.sciborgs1155.robot.drive.DriveConstants.ControlMode;
import org.sciborgs1155.robot.drive.NoGyro;
Expand Down Expand Up @@ -51,11 +49,10 @@ public void systemCheck() {
runUnitTest(drive.systemsCheck());
}

@Disabled
@Test
@RepeatedTest(5)
public void reachesRobotVelocity() {
double xVelocitySetpoint = -0.5;
double yVelocitySetpoint = 0.25;
double xVelocitySetpoint = Math.random() * (2 * 2.265) - 2.265;;
double yVelocitySetpoint = Math.random() * (2 * 2.265) - 2.265;;
run(
drive.run(
() ->
Expand All @@ -71,10 +68,9 @@ public void reachesRobotVelocity() {
assertEquals(yVelocitySetpoint, chassisSpeed.vyMetersPerSecond, DELTA);
}

@Disabled
@ParameterizedTest
@ValueSource(doubles = {3, 4})
public void reachesAngularVelocity(double omegaRadiansPerSecond) {
@RepeatedTest(5)
public void reachesAngularVelocity() {
double omegaRadiansPerSecond = Math.random() * 2 - 1;
run(
drive.run(
() ->
Expand All @@ -87,11 +83,10 @@ public void reachesAngularVelocity(double omegaRadiansPerSecond) {
assertEquals(omegaRadiansPerSecond, chassisSpeed.omegaRadiansPerSecond, DELTA);
}

@Disabled
@Test
@RepeatedTest(5)
public void testModuleDistance() {
double xVelocitySetpoint = 2.265;
double yVelocitySetpoint = 0;
double xVelocitySetpoint = Math.random() * (2 * 2.265) - 2.265;
double yVelocitySetpoint = Math.random() * (2 * 2.265) - 2.265;

double deltaT = 4;
double deltaX = xVelocitySetpoint * deltaT;
Expand Down

0 comments on commit 6524285

Please sign in to comment.