summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2017-10-13 13:21:37 +0800
committerLei YU <mine260309@gmail.com>2017-10-16 20:41:02 +0800
commitdebe1d8f47bab3d61b3340c84f802f1dc6388ca0 (patch)
treed591f7fd56911eee9579918303f141f20d84392f /test
parent88ad42bd84d05825255c035963afc29eeefcc79d (diff)
downloadphosphor-time-manager-debe1d8f47bab3d61b3340c84f802f1dc6388ca0.tar.gz
phosphor-time-manager-debe1d8f47bab3d61b3340c84f802f1dc6388ca0.zip
Use host state object to check if host is on
The code was using pgood to determine if host is on or off. Now we have host state object, which is a more appropriate way to check host on/off. So change pgood related code to use host state object. Change-Id: I553c1a40922ca2e8bc6904688c55e85971bd4720 Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/TestManager.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/TestManager.cpp b/test/TestManager.cpp
index d8c51ca..decc21d 100644
--- a/test/TestManager.cpp
+++ b/test/TestManager.cpp
@@ -56,9 +56,9 @@ class TestManager : public testing::Test
{
manager.onPropertyChanged(key, value);
}
- void notifyPgoodChanged(bool pgood)
+ void notifyOnHostState(bool hostOn)
{
- manager.onPgoodChanged(pgood);
+ manager.onHostState(hostOn);
}
};
@@ -74,11 +74,11 @@ TEST_F(TestManager, DISABLED_empty)
}
-TEST_F(TestManager, DISABLED_pgoodChange)
+TEST_F(TestManager, DISABLED_hostStateChange)
{
- notifyPgoodChanged(true);
+ notifyOnHostState(true);
EXPECT_TRUE(hostOn());
- notifyPgoodChanged(false);
+ notifyOnHostState(false);
EXPECT_FALSE(hostOn());
}
@@ -104,7 +104,7 @@ TEST_F(TestManager, DISABLED_propertyChanged)
EXPECT_EQ("", getRequestedOwner());
// When host is on, property changes are saved as requested ones
- notifyPgoodChanged(true);
+ notifyOnHostState(true);
// Check mocked listeners shall not receive notifications
EXPECT_CALL(listener1, onModeChanged(Mode::Manual)).Times(0);
@@ -132,14 +132,14 @@ TEST_F(TestManager, DISABLED_propertyChanged)
EXPECT_CALL(listener2, onModeChanged(Mode::NTP)).Times(1);
EXPECT_CALL(listener2, onOwnerChanged(Owner::Split)).Times(1);
- notifyPgoodChanged(false);
+ notifyOnHostState(false);
EXPECT_EQ("", getRequestedMode());
EXPECT_EQ("", getRequestedOwner());
// When host is on, and invalid property is changed,
// verify the code asserts because it shall never occur
- notifyPgoodChanged(true);
+ notifyOnHostState(true);
ASSERT_DEATH(notifyPropertyChanged("invalid property", "whatever"), "");
}
@@ -154,7 +154,7 @@ TEST_F(TestManager, DISABLED_propertyChangedAndChangedbackWhenHostOn)
"xyz.openbmc_project.Time.Owner.Owners.Host");
// Set host on
- notifyPgoodChanged(true);
+ notifyOnHostState(true);
// Check mocked listeners shall not receive notifications
EXPECT_CALL(listener1, onModeChanged(_)).Times(0);
@@ -197,7 +197,7 @@ TEST_F(TestManager, DISABLED_propertyChangedAndChangedbackWhenHostOn)
EXPECT_CALL(listener2, onModeChanged(_)).Times(0);
EXPECT_CALL(listener2, onOwnerChanged(_)).Times(0);
- notifyPgoodChanged(false);
+ notifyOnHostState(false);
EXPECT_EQ("", getRequestedMode());
EXPECT_EQ("", getRequestedOwner());
OpenPOWER on IntegriCloud