mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Make C++ test names more consistent (#3586)
Inconsistent names were found using the following regular expressions. * `rg "TEST(_F|_P)?\(\w+,\s+\w+Test\)"` * `rg "TEST(_F|_P)?\(\w+,\s+Test\w+\)"` * `rg "TEST(_F|_P)?\(\w+Tests,\s+\w+\)"` Fixes #3495.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "Eigen/LU"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
TEST(EigenTest, MultiplicationTest) {
|
||||
TEST(EigenTest, Multiplication) {
|
||||
Eigen::Matrix<double, 2, 2> m1{{2, 1}, {0, 1}};
|
||||
Eigen::Matrix<double, 2, 2> m2{{3, 0}, {0, 2.5}};
|
||||
|
||||
@@ -28,7 +28,7 @@ TEST(EigenTest, MultiplicationTest) {
|
||||
EXPECT_TRUE(expectedResult2.isApprox(result2));
|
||||
}
|
||||
|
||||
TEST(EigenTest, TransposeTest) {
|
||||
TEST(EigenTest, Transpose) {
|
||||
Eigen::Vector<double, 3> vec{1, 2, 3};
|
||||
|
||||
const auto transpose = vec.transpose();
|
||||
@@ -38,7 +38,7 @@ TEST(EigenTest, TransposeTest) {
|
||||
EXPECT_TRUE(expectedTranspose.isApprox(transpose));
|
||||
}
|
||||
|
||||
TEST(EigenTest, InverseTest) {
|
||||
TEST(EigenTest, Inverse) {
|
||||
Eigen::Matrix<double, 3, 3> mat{
|
||||
{1.0, 3.0, 2.0}, {5.0, 2.0, 1.5}, {0.0, 1.3, 2.5}};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class PIDInputOutputTest : public testing::Test {
|
||||
void TearDown() override { delete controller; }
|
||||
};
|
||||
|
||||
TEST_F(PIDInputOutputTest, ContinuousInputTest) {
|
||||
TEST_F(PIDInputOutputTest, ContinuousInput) {
|
||||
controller->SetP(1);
|
||||
controller->EnableContinuousInput(-180, 180);
|
||||
EXPECT_DOUBLE_EQ(controller->Calculate(-179, 179), -2);
|
||||
@@ -23,13 +23,13 @@ TEST_F(PIDInputOutputTest, ContinuousInputTest) {
|
||||
EXPECT_DOUBLE_EQ(controller->Calculate(1, 359), -2);
|
||||
}
|
||||
|
||||
TEST_F(PIDInputOutputTest, ProportionalGainOutputTest) {
|
||||
TEST_F(PIDInputOutputTest, ProportionalGainOutput) {
|
||||
controller->SetP(4);
|
||||
|
||||
EXPECT_DOUBLE_EQ(-0.1, controller->Calculate(0.025, 0));
|
||||
}
|
||||
|
||||
TEST_F(PIDInputOutputTest, IntegralGainOutputTest) {
|
||||
TEST_F(PIDInputOutputTest, IntegralGainOutput) {
|
||||
controller->SetI(4);
|
||||
|
||||
double out = 0;
|
||||
@@ -41,7 +41,7 @@ TEST_F(PIDInputOutputTest, IntegralGainOutputTest) {
|
||||
EXPECT_DOUBLE_EQ(-0.5 * controller->GetPeriod().to<double>(), out);
|
||||
}
|
||||
|
||||
TEST_F(PIDInputOutputTest, DerivativeGainOutputTest) {
|
||||
TEST_F(PIDInputOutputTest, DerivativeGainOutput) {
|
||||
controller->SetD(4);
|
||||
|
||||
controller->Calculate(0, 0);
|
||||
|
||||
@@ -22,7 +22,7 @@ class ProfiledPIDInputOutputTest : public testing::Test {
|
||||
void TearDown() override { delete controller; }
|
||||
};
|
||||
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest1) {
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInput1) {
|
||||
controller->SetP(1);
|
||||
controller->EnableContinuousInput(-180_deg, 180_deg);
|
||||
|
||||
@@ -38,7 +38,7 @@ TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest1) {
|
||||
180_deg);
|
||||
}
|
||||
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest2) {
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInput2) {
|
||||
controller->SetP(1);
|
||||
controller->EnableContinuousInput(-units::radian_t{wpi::numbers::pi},
|
||||
units::radian_t{wpi::numbers::pi});
|
||||
@@ -55,7 +55,7 @@ TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest2) {
|
||||
units::radian_t{wpi::numbers::pi});
|
||||
}
|
||||
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest3) {
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInput3) {
|
||||
controller->SetP(1);
|
||||
controller->EnableContinuousInput(-units::radian_t{wpi::numbers::pi},
|
||||
units::radian_t{wpi::numbers::pi});
|
||||
@@ -72,7 +72,7 @@ TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest3) {
|
||||
units::radian_t{wpi::numbers::pi});
|
||||
}
|
||||
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest4) {
|
||||
TEST_F(ProfiledPIDInputOutputTest, ContinuousInput4) {
|
||||
controller->SetP(1);
|
||||
controller->EnableContinuousInput(0_rad,
|
||||
units::radian_t{2.0 * wpi::numbers::pi});
|
||||
@@ -89,13 +89,13 @@ TEST_F(ProfiledPIDInputOutputTest, ContinuousInputTest4) {
|
||||
units::radian_t{wpi::numbers::pi});
|
||||
}
|
||||
|
||||
TEST_F(ProfiledPIDInputOutputTest, ProportionalGainOutputTest) {
|
||||
TEST_F(ProfiledPIDInputOutputTest, ProportionalGainOutput) {
|
||||
controller->SetP(4);
|
||||
|
||||
EXPECT_DOUBLE_EQ(-0.1, controller->Calculate(0.025_deg, 0_deg));
|
||||
}
|
||||
|
||||
TEST_F(ProfiledPIDInputOutputTest, IntegralGainOutputTest) {
|
||||
TEST_F(ProfiledPIDInputOutputTest, IntegralGainOutput) {
|
||||
controller->SetI(4);
|
||||
|
||||
double out = 0;
|
||||
@@ -107,7 +107,7 @@ TEST_F(ProfiledPIDInputOutputTest, IntegralGainOutputTest) {
|
||||
EXPECT_DOUBLE_EQ(-0.5 * controller->GetPeriod().to<double>(), out);
|
||||
}
|
||||
|
||||
TEST_F(ProfiledPIDInputOutputTest, DerivativeGainOutputTest) {
|
||||
TEST_F(ProfiledPIDInputOutputTest, DerivativeGainOutput) {
|
||||
controller->SetD(4);
|
||||
|
||||
controller->Calculate(0_deg, 0_deg);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "Eigen/Core"
|
||||
#include "frc/estimator/AngleStatistics.h"
|
||||
|
||||
TEST(AngleStatisticsTest, TestMean) {
|
||||
TEST(AngleStatisticsTest, Mean) {
|
||||
Eigen::Matrix<double, 3, 3> sigmas{
|
||||
{1, 1.2, 0},
|
||||
{359 * wpi::numbers::pi / 180, 3 * wpi::numbers::pi / 180, 0},
|
||||
@@ -22,7 +22,7 @@ TEST(AngleStatisticsTest, TestMean) {
|
||||
.isApprox(frc::AngleMean<3, 1>(sigmas, weights, 1), 1e-3));
|
||||
}
|
||||
|
||||
TEST(AngleStatisticsTest, TestResidual) {
|
||||
TEST(AngleStatisticsTest, Residual) {
|
||||
Eigen::Vector3d a{1, 1 * wpi::numbers::pi / 180, 2};
|
||||
Eigen::Vector3d b{1, 359 * wpi::numbers::pi / 180, 1};
|
||||
|
||||
@@ -30,7 +30,7 @@ TEST(AngleStatisticsTest, TestResidual) {
|
||||
Eigen::Vector3d{0, 2 * wpi::numbers::pi / 180, 1}));
|
||||
}
|
||||
|
||||
TEST(AngleStatisticsTest, TestAdd) {
|
||||
TEST(AngleStatisticsTest, Add) {
|
||||
Eigen::Vector3d a{1, 1 * wpi::numbers::pi / 180, 2};
|
||||
Eigen::Vector3d b{1, 359 * wpi::numbers::pi / 180, 1};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "units/length.h"
|
||||
#include "units/time.h"
|
||||
|
||||
TEST(DifferentialDrivePoseEstimatorTest, TestAccuracy) {
|
||||
TEST(DifferentialDrivePoseEstimatorTest, Accuracy) {
|
||||
frc::DifferentialDrivePoseEstimator estimator{frc::Rotation2d(),
|
||||
frc::Pose2d(),
|
||||
{0.02, 0.02, 0.01, 0.02, 0.02},
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "frc/trajectory/TrajectoryGenerator.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
TEST(MecanumDrivePoseEstimatorTest, TestAccuracy) {
|
||||
TEST(MecanumDrivePoseEstimatorTest, Accuracy) {
|
||||
frc::MecanumDriveKinematics kinematics{
|
||||
frc::Translation2d{1_m, 1_m}, frc::Translation2d{1_m, -1_m},
|
||||
frc::Translation2d{-1_m, -1_m}, frc::Translation2d{-1_m, 1_m}};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace drake::math {
|
||||
namespace {
|
||||
TEST(MerweScaledSigmaPointsTest, TestZeroMean) {
|
||||
TEST(MerweScaledSigmaPointsTest, ZeroMean) {
|
||||
frc::MerweScaledSigmaPoints<2> sigmaPoints;
|
||||
auto points = sigmaPoints.SigmaPoints(
|
||||
Eigen::Vector<double, 2>{0.0, 0.0},
|
||||
@@ -21,7 +21,7 @@ TEST(MerweScaledSigmaPointsTest, TestZeroMean) {
|
||||
.norm() < 1e-3);
|
||||
}
|
||||
|
||||
TEST(MerweScaledSigmaPointsTest, TestNonzeroMean) {
|
||||
TEST(MerweScaledSigmaPointsTest, NonzeroMean) {
|
||||
frc::MerweScaledSigmaPoints<2> sigmaPoints;
|
||||
auto points = sigmaPoints.SigmaPoints(
|
||||
Eigen::Vector<double, 2>{1.0, 2.0},
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "frc/trajectory/TrajectoryGenerator.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
TEST(SwerveDrivePoseEstimatorTest, TestAccuracy) {
|
||||
TEST(SwerveDrivePoseEstimatorTest, Accuracy) {
|
||||
frc::SwerveDriveKinematics<4> kinematics{
|
||||
frc::Translation2d{1_m, 1_m}, frc::Translation2d{1_m, -1_m},
|
||||
frc::Translation2d{-1_m, -1_m}, frc::Translation2d{-1_m, 1_m}};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
static units::second_t now = 0_s;
|
||||
|
||||
TEST(SlewRateLimiterTest, SlewRateLimitTest) {
|
||||
TEST(SlewRateLimiterTest, SlewRateLimit) {
|
||||
WPI_SetNowImpl([] { return units::microsecond_t{now}.to<uint64_t>(); });
|
||||
|
||||
frc::SlewRateLimiter<units::meters> limiter(1_mps);
|
||||
@@ -22,7 +22,7 @@ TEST(SlewRateLimiterTest, SlewRateLimitTest) {
|
||||
EXPECT_LT(limiter.Calculate(2_m), 2_m);
|
||||
}
|
||||
|
||||
TEST(SlewRateLimiterTest, SlewRateNoLimitTest) {
|
||||
TEST(SlewRateLimiterTest, SlewRateNoLimit) {
|
||||
WPI_SetNowImpl([] { return units::microsecond_t{now}.to<uint64_t>(); });
|
||||
|
||||
frc::SlewRateLimiter<units::meters> limiter(1_mps);
|
||||
|
||||
@@ -143,7 +143,7 @@ TEST_F(MecanumDriveKinematicsTest,
|
||||
EXPECT_NEAR(0.707, chassisSpeeds.omega.to<double>(), 0.1);
|
||||
}
|
||||
|
||||
TEST_F(MecanumDriveKinematicsTest, NormalizeTest) {
|
||||
TEST_F(MecanumDriveKinematicsTest, Normalize) {
|
||||
MecanumDriveWheelSpeeds wheelSpeeds{5_mps, 6_mps, 4_mps, 7_mps};
|
||||
wheelSpeeds.Normalize(5.5_mps);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ TEST_F(MecanumDriveOdometryTest, TwoIterations) {
|
||||
EXPECT_NEAR(pose.Rotation().Radians().to<double>(), 0.0, 0.01);
|
||||
}
|
||||
|
||||
TEST_F(MecanumDriveOdometryTest, Test90DegreeTurn) {
|
||||
TEST_F(MecanumDriveOdometryTest, 90DegreeTurn) {
|
||||
odometry.ResetPosition(Pose2d(), 0_rad);
|
||||
MecanumDriveWheelSpeeds speeds{-13.328_mps, 39.986_mps, -13.329_mps,
|
||||
39.986_mps};
|
||||
|
||||
@@ -162,7 +162,7 @@ TEST_F(SwerveDriveKinematicsTest,
|
||||
EXPECT_NEAR(chassisSpeeds.omega.to<double>(), 1.5, kEpsilon);
|
||||
}
|
||||
|
||||
TEST_F(SwerveDriveKinematicsTest, NormalizeTest) {
|
||||
TEST_F(SwerveDriveKinematicsTest, Normalize) {
|
||||
SwerveModuleState state1{5.0_mps, Rotation2d()};
|
||||
SwerveModuleState state2{6.0_mps, Rotation2d()};
|
||||
SwerveModuleState state3{4.0_mps, Rotation2d()};
|
||||
|
||||
Reference in New Issue
Block a user