[wpimath] Remove unhelpful test fixtures (#7344)

These test fixtures were adding complexity while only saving one line of
object initialization per test. Our other tests like this just make the
object at the top of each test.
This commit is contained in:
Tyler Veness
2024-11-05 08:49:38 -08:00
committed by GitHub
parent ad09d73dd6
commit 9e8d37c03b
8 changed files with 202 additions and 183 deletions

View File

@@ -6,18 +6,17 @@
#include "frc/controller/BangBangController.h"
class BangBangToleranceTest : public testing::Test {
protected:
TEST(BangBangToleranceTest, InTolerance) {
frc::BangBangController controller{0.1};
};
TEST_F(BangBangToleranceTest, InTolerance) {
controller.SetSetpoint(1);
controller.Calculate(1);
EXPECT_TRUE(controller.AtSetpoint());
}
TEST_F(BangBangToleranceTest, OutOfTolerance) {
TEST(BangBangToleranceTest, OutOfTolerance) {
frc::BangBangController controller{0.1};
controller.SetSetpoint(1);
controller.Calculate(0);
EXPECT_FALSE(controller.AtSetpoint());