summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-07-16 10:50:37 -0700
committerPatrick Venture <venture@google.com>2019-07-16 21:16:01 +0000
commit9bbf333d0c4b6bb47959ef6d0395949fa0fe386c (patch)
tree8d588feccb919432d51c041d7bc304ba7eb373ca /test
parent924dd965ed01e0c09bef4520f754d0d1a10e7ad3 (diff)
downloadphosphor-pid-control-9bbf333d0c4b6bb47959ef6d0395949fa0fe386c.tar.gz
phosphor-pid-control-9bbf333d0c4b6bb47959ef6d0395949fa0fe386c.zip
rename RPMSetPoint to SetPoint
The PIDs were originally focused on collecting RPM set points from thermal PIDs and then having fan PIDs use the highest value collected, it doesn't need to be strictly an RPM set point. It does however need to be one type of value. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I1d589cf4b2688d7e86030c10496d737dc5bbdadf
Diffstat (limited to 'test')
-rw-r--r--test/pid_stepwisecontroller_unittest.cpp8
-rw-r--r--test/pid_thermalcontroller_unittest.cpp6
-rw-r--r--test/pid_zone_unittest.cpp8
-rw-r--r--test/zone_mock.hpp2
4 files changed, 12 insertions, 12 deletions
diff --git a/test/pid_stepwisecontroller_unittest.cpp b/test/pid_stepwisecontroller_unittest.cpp
index 5cf825d..f5f6f9a 100644
--- a/test/pid_stepwisecontroller_unittest.cpp
+++ b/test/pid_stepwisecontroller_unittest.cpp
@@ -39,8 +39,8 @@ TEST(StepwiseControllerTest, HysteresisTestPositive)
.WillOnce(Return(31.0)) // return 40
.WillOnce(Return(32.0)); // return 60
- EXPECT_CALL(z, addRPMSetPoint(40.0)).Times(2);
- EXPECT_CALL(z, addRPMSetPoint(60.0)).Times(1);
+ EXPECT_CALL(z, addSetPoint(40.0)).Times(2);
+ EXPECT_CALL(z, addSetPoint(60.0)).Times(1);
for (int ii = 0; ii < 3; ii++)
{
@@ -75,8 +75,8 @@ TEST(StepwiseControllerTest, HysteresisTestNegative)
.WillOnce(Return(27.0)) // return 60
.WillOnce(Return(26.0)); // return 40
- EXPECT_CALL(z, addRPMSetPoint(40.0)).Times(1);
- EXPECT_CALL(z, addRPMSetPoint(60.0)).Times(2);
+ EXPECT_CALL(z, addSetPoint(40.0)).Times(1);
+ EXPECT_CALL(z, addSetPoint(60.0)).Times(2);
for (int ii = 0; ii < 3; ii++)
{
diff --git a/test/pid_thermalcontroller_unittest.cpp b/test/pid_thermalcontroller_unittest.cpp
index ae5c769..d95f16e 100644
--- a/test/pid_thermalcontroller_unittest.cpp
+++ b/test/pid_thermalcontroller_unittest.cpp
@@ -99,7 +99,7 @@ TEST(ThermalControllerTest, OutputProc_BehavesAsExpected)
EXPECT_FALSE(p == nullptr);
double value = 90.0;
- EXPECT_CALL(z, addRPMSetPoint(value));
+ EXPECT_CALL(z, addSetPoint(value));
p->outputProc(value);
}
@@ -170,7 +170,7 @@ TEST(ThermalControllerTest, NegHysteresis_BehavesAsExpected)
.WillOnce(Return(9.0))
.WillOnce(Return(7.0));
- EXPECT_CALL(z, addRPMSetPoint(_)).Times(3);
+ EXPECT_CALL(z, addSetPoint(_)).Times(3);
std::vector<double> lastReadings = {12.0, 12.0, 7.0};
for (auto& reading : lastReadings)
@@ -203,7 +203,7 @@ TEST(ThermalControllerTest, PosHysteresis_BehavesAsExpected)
.WillOnce(Return(13.0))
.WillOnce(Return(14.0));
- EXPECT_CALL(z, addRPMSetPoint(_)).Times(3);
+ EXPECT_CALL(z, addSetPoint(_)).Times(3);
std::vector<double> lastReadings = {8.0, 8.0, 14.0};
for (auto& reading : lastReadings)
diff --git a/test/pid_zone_unittest.cpp b/test/pid_zone_unittest.cpp
index 269b3f8..e0ecd76 100644
--- a/test/pid_zone_unittest.cpp
+++ b/test/pid_zone_unittest.cpp
@@ -121,7 +121,7 @@ TEST_F(PidZoneTest, GetAndSetManualModeTest_BehavesAsExpected)
TEST_F(PidZoneTest, RpmSetPoints_AddMaxClear_BehaveAsExpected)
{
- // Tests addRPMSetPoint, clearRPMSetPoints, determineMaxRPMRequest
+ // Tests addSetPoint, clearSetPoints, determineMaxRPMRequest
// and getMinThermalRPMSetpoint.
// At least one value must be above the minimum thermal setpoint used in
@@ -129,7 +129,7 @@ TEST_F(PidZoneTest, RpmSetPoints_AddMaxClear_BehaveAsExpected)
std::vector<double> values = {100, 200, 300, 400, 500, 5000};
for (auto v : values)
{
- zone->addRPMSetPoint(v);
+ zone->addSetPoint(v);
}
// This will pull the maximum RPM setpoint request.
@@ -137,7 +137,7 @@ TEST_F(PidZoneTest, RpmSetPoints_AddMaxClear_BehaveAsExpected)
EXPECT_EQ(5000, zone->getMaxRPMRequest());
// Clear the values, so it'll choose the minimum thermal setpoint.
- zone->clearRPMSetPoints();
+ zone->clearSetPoints();
// This will go through the RPM set point values and grab the maximum.
zone->determineMaxRPMRequest();
@@ -152,7 +152,7 @@ TEST_F(PidZoneTest, RpmSetPoints_AddBelowMinimum_BehavesAsExpected)
std::vector<double> values = {100, 200, 300, 400, 500};
for (auto v : values)
{
- zone->addRPMSetPoint(v);
+ zone->addSetPoint(v);
}
// This will pull the maximum RPM setpoint request.
diff --git a/test/zone_mock.hpp b/test/zone_mock.hpp
index 4a9c3f8..a81ddeb 100644
--- a/test/zone_mock.hpp
+++ b/test/zone_mock.hpp
@@ -12,7 +12,7 @@ class ZoneMock : public ZoneInterface
virtual ~ZoneMock() = default;
MOCK_METHOD1(getCachedValue, double(const std::string&));
- MOCK_METHOD1(addRPMSetPoint, void(double));
+ MOCK_METHOD1(addSetPoint, void(double));
MOCK_METHOD1(addRPMCeiling, void(double));
MOCK_CONST_METHOD0(getMaxRPMRequest, double());
MOCK_CONST_METHOD0(getFailSafeMode, bool());
OpenPOWER on IntegriCloud