accel: rename `accelOobGetDbus` to `getBus`
accelOobGetDbus returns a dbus bus which can be leverage by others.
Rename it to a more common name.
Tested: Unittest passed.
Signed-off-by: Michael Shen <gpgpgp@google.com>
Change-Id: I0e48f7f6a49c09b397d52e9343bc3e32ca41d9d8
diff --git a/test/handler_unittest.cpp b/test/handler_unittest.cpp
index 2edb977..5af16ad 100644
--- a/test/handler_unittest.cpp
+++ b/test/handler_unittest.cpp
@@ -146,7 +146,7 @@
}
protected:
- sdbusplus::bus::bus accelOobGetDbus() const override
+ sdbusplus::bus::bus getDbus() const override
{
return sdbusplus::get_mocked_new(
const_cast<sdbusplus::SdBusMock*>(mock_));
@@ -299,14 +299,15 @@
EXPECT_CALL(mock, sd_bus_message_exit_container(msg)).WillOnce(Return(1));
}
-void ExpectSdBusError(StrictMock<sdbusplus::SdBusMock>& mock)
+void ExpectSdBusError(StrictMock<sdbusplus::SdBusMock>& mock,
+ const std::string& service, const std::string& objPath,
+ const std::string& interface, const std::string& function)
{
- EXPECT_CALL(mock, sd_bus_message_new_method_call(
- _, // sd_bus *bus,
- NotNull(), // sd_bus_message **m
- StrEq("com.google.custom_accel"), StrEq("/"),
- StrEq("org.freedesktop.DBus.ObjectManager"),
- StrEq("GetManagedObjects")))
+ EXPECT_CALL(
+ mock, sd_bus_message_new_method_call(_, // sd_bus *bus,
+ NotNull(), // sd_bus_message **m
+ StrEq(service), StrEq(objPath),
+ StrEq(interface), StrEq(function)))
.WillOnce(Return(-ENOTCONN));
}
@@ -322,7 +323,8 @@
{
StrictMock<sdbusplus::SdBusMock> mock;
MockDbusHandler h(mock);
- ExpectSdBusError(mock);
+ ExpectSdBusError(mock, "com.google.custom_accel", "/",
+ "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
EXPECT_THROW(h.accelOobDeviceCount(), IpmiException);
}
@@ -338,7 +340,8 @@
{
StrictMock<sdbusplus::SdBusMock> mock;
MockDbusHandler h(mock);
- ExpectSdBusError(mock);
+ ExpectSdBusError(mock, "com.google.custom_accel", "/",
+ "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
EXPECT_THROW(h.accelOobDeviceName(0), IpmiException);
}