mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user