blob: 71bc6e73311f93c1905520c3615e5c4a69c7c1c3 [file] [log] [blame]
Deepak Kodihallid130e1a2020-06-17 05:55:32 -05001#include "common/utils.hpp"
George Liu1e44c732020-02-28 20:20:06 +08002
3#include <gmock/gmock.h>
4#include <gtest/gtest.h>
5
6namespace pldm
7{
8namespace utils
9{
George Liu1e44c732020-02-28 20:20:06 +080010/** @brief helper function for parameter matching
11 * @param[in] lhs - left-hand side value
12 * @param[in] rhs - right-hand side value
13 * @return true if it matches
14 */
15inline bool operator==(const DBusMapping& lhs, const DBusMapping& rhs)
16{
17 return lhs.objectPath == rhs.objectPath && lhs.interface == rhs.interface &&
18 lhs.propertyName == rhs.propertyName &&
19 lhs.propertyType == rhs.propertyType;
20}
21
22} // namespace utils
23} // namespace pldm
24
Brad Bishop5079ac42021-08-19 18:35:06 -040025class MockdBusHandler : public pldm::utils::DBusHandler
George Liu1e44c732020-02-28 20:20:06 +080026{
27 public:
George Liu36e81352020-07-01 14:40:30 +080028 MOCK_METHOD(std::string, getService, (const char*, const char*),
29 (const override));
30
George Liu1e44c732020-02-28 20:20:06 +080031 MOCK_METHOD(void, setDbusProperty,
Brad Bishop5079ac42021-08-19 18:35:06 -040032 (const pldm::utils::DBusMapping&,
33 const pldm::utils::PropertyValue&),
34 (const override));
John Wang29683b52020-02-27 16:41:44 +080035
Brad Bishop5079ac42021-08-19 18:35:06 -040036 MOCK_METHOD(pldm::utils::PropertyValue, getDbusPropertyVariant,
John Wang29683b52020-02-27 16:41:44 +080037 (const char*, const char*, const char*), (const override));
Sagar Srinivas11ce8d22022-07-28 11:32:34 -050038
39 MOCK_METHOD(pldm::utils::GetSubTreeResponse, getSubtree,
40 (const std::string&, int, const std::vector<std::string>&),
41 (const override));
George Liu1e44c732020-02-28 20:20:06 +080042};