blob: 9a1c87ee5ed2358098b49a037724f056d64730bc [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{
10
11/** @brief helper function for parameter matching
12 * @param[in] lhs - left-hand side value
13 * @param[in] rhs - right-hand side value
14 * @return true if it matches
15 */
16inline bool operator==(const DBusMapping& lhs, const DBusMapping& rhs)
17{
18 return lhs.objectPath == rhs.objectPath && lhs.interface == rhs.interface &&
19 lhs.propertyName == rhs.propertyName &&
20 lhs.propertyType == rhs.propertyType;
21}
22
23} // namespace utils
24} // namespace pldm
25
26using namespace pldm::utils;
27
28class MockdBusHandler : public DBusHandler
29{
30 public:
George Liu36e81352020-07-01 14:40:30 +080031 MOCK_METHOD(std::string, getService, (const char*, const char*),
32 (const override));
33
George Liu1e44c732020-02-28 20:20:06 +080034 MOCK_METHOD(void, setDbusProperty,
35 (const DBusMapping&, const PropertyValue&), (const override));
John Wang29683b52020-02-27 16:41:44 +080036
37 MOCK_METHOD(PropertyValue, getDbusPropertyVariant,
38 (const char*, const char*, const char*), (const override));
George Liu1e44c732020-02-28 20:20:06 +080039};