From 32d9949e4dca32e50a127c5e4683c495536cf0b0 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 6 Sep 2021 17:00:13 -0700 Subject: [PATCH] [wpimath] Move controller tests to wpimath (#3541) --- .../native/cpp/controller/HolonomicDriveControllerTest.cpp | 4 ++-- .../src/test/native/cpp/controller/PIDInputOutputTest.cpp | 0 .../src/test/native/cpp/controller/PIDToleranceTest.cpp | 0 .../native/cpp/controller/ProfiledPIDInputOutputTest.cpp | 6 +++--- .../test/native/cpp/controller/RamseteControllerTest.cpp | 3 +-- 5 files changed, 6 insertions(+), 7 deletions(-) rename {wpilibc => wpimath}/src/test/native/cpp/controller/HolonomicDriveControllerTest.cpp (98%) rename {wpilibc => wpimath}/src/test/native/cpp/controller/PIDInputOutputTest.cpp (100%) rename {wpilibc => wpimath}/src/test/native/cpp/controller/PIDToleranceTest.cpp (100%) rename {wpilibc => wpimath}/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp (97%) rename {wpilibc => wpimath}/src/test/native/cpp/controller/RamseteControllerTest.cpp (98%) diff --git a/wpilibc/src/test/native/cpp/controller/HolonomicDriveControllerTest.cpp b/wpimath/src/test/native/cpp/controller/HolonomicDriveControllerTest.cpp similarity index 98% rename from wpilibc/src/test/native/cpp/controller/HolonomicDriveControllerTest.cpp rename to wpimath/src/test/native/cpp/controller/HolonomicDriveControllerTest.cpp index 0c3a0b6a24..dbec19f169 100644 --- a/wpilibc/src/test/native/cpp/controller/HolonomicDriveControllerTest.cpp +++ b/wpimath/src/test/native/cpp/controller/HolonomicDriveControllerTest.cpp @@ -2,14 +2,14 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include #include #include "frc/MathUtil.h" #include "frc/controller/HolonomicDriveController.h" #include "frc/trajectory/TrajectoryGenerator.h" #include "gtest/gtest.h" +#include "units/math.h" +#include "units/time.h" #define EXPECT_NEAR_UNITS(val1, val2, eps) \ EXPECT_LE(units::math::abs(val1 - val2), eps) diff --git a/wpilibc/src/test/native/cpp/controller/PIDInputOutputTest.cpp b/wpimath/src/test/native/cpp/controller/PIDInputOutputTest.cpp similarity index 100% rename from wpilibc/src/test/native/cpp/controller/PIDInputOutputTest.cpp rename to wpimath/src/test/native/cpp/controller/PIDInputOutputTest.cpp diff --git a/wpilibc/src/test/native/cpp/controller/PIDToleranceTest.cpp b/wpimath/src/test/native/cpp/controller/PIDToleranceTest.cpp similarity index 100% rename from wpilibc/src/test/native/cpp/controller/PIDToleranceTest.cpp rename to wpimath/src/test/native/cpp/controller/PIDToleranceTest.cpp diff --git a/wpilibc/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp b/wpimath/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp similarity index 97% rename from wpilibc/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp rename to wpimath/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp index 24e3daf61f..71bb5a83cb 100644 --- a/wpilibc/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp +++ b/wpimath/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp @@ -2,13 +2,13 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include #include #include "frc/controller/ProfiledPIDController.h" #include "gtest/gtest.h" +#include "units/angle.h" +#include "units/angular_acceleration.h" +#include "units/angular_velocity.h" class ProfiledPIDInputOutputTest : public testing::Test { protected: diff --git a/wpilibc/src/test/native/cpp/controller/RamseteControllerTest.cpp b/wpimath/src/test/native/cpp/controller/RamseteControllerTest.cpp similarity index 98% rename from wpilibc/src/test/native/cpp/controller/RamseteControllerTest.cpp rename to wpimath/src/test/native/cpp/controller/RamseteControllerTest.cpp index 101dea2b87..244e4d43c8 100644 --- a/wpilibc/src/test/native/cpp/controller/RamseteControllerTest.cpp +++ b/wpimath/src/test/native/cpp/controller/RamseteControllerTest.cpp @@ -2,12 +2,11 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include - #include "frc/MathUtil.h" #include "frc/controller/RamseteController.h" #include "frc/trajectory/TrajectoryGenerator.h" #include "gtest/gtest.h" +#include "units/math.h" #define EXPECT_NEAR_UNITS(val1, val2, eps) \ EXPECT_LE(units::math::abs(val1 - val2), eps)