Skip to content

Commit

Permalink
replace method in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
narmstro2020 committed Sep 21, 2024
1 parent 9803e93 commit 7f9be50
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions wpimath/src/test/native/cpp/kinematics/SwerveModuleStateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ TEST(SwerveModuleStateTest, Optimize) {
TEST(SwerveModuleStateTest, NoOptimize) {
frc::Rotation2d angleA{0_deg};
frc::SwerveModuleState refA{2_mps, 89_deg};
auto optimizedA = frc::SwerveModuleState::Optimize(refA, angleA);
refA.Optimize(angleA);

EXPECT_NEAR(optimizedA.speed.value(), 2.0, kEpsilon);
EXPECT_NEAR(optimizedA.angle.Degrees().value(), 89.0, kEpsilon);
EXPECT_NEAR(refA.speed.value(), 2.0, kEpsilon);
EXPECT_NEAR(refA.angle.Degrees().value(), 89.0, kEpsilon);

frc::Rotation2d angleB{0_deg};
frc::SwerveModuleState refB{-2_mps, -2_deg};
auto optimizedB = frc::SwerveModuleState::Optimize(refB, angleB);
refB.Optimize(angleB);

EXPECT_NEAR(optimizedB.speed.value(), -2.0, kEpsilon);
EXPECT_NEAR(optimizedB.angle.Degrees().value(), -2.0, kEpsilon);
EXPECT_NEAR(refB.speed.value(), -2.0, kEpsilon);
EXPECT_NEAR(refB.angle.Degrees().value(), -2.0, kEpsilon);
}

TEST(SwerveModuleStateTest, Equality) {
Expand Down

0 comments on commit 7f9be50

Please sign in to comment.