Deepak Kodihalli | d130e1a | 2020-06-17 05:55:32 -0500 | [diff] [blame] | 1 | #include "common/utils.hpp" |
George Liu | 1e44c73 | 2020-02-28 20:20:06 +0800 | [diff] [blame] | 2 | |
| 3 | #include <gmock/gmock.h> |
| 4 | #include <gtest/gtest.h> |
| 5 | |
| 6 | namespace pldm |
| 7 | { |
| 8 | namespace 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 | */ |
| 16 | inline 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 | |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 26 | class MockdBusHandler : public pldm::utils::DBusHandler |
George Liu | 1e44c73 | 2020-02-28 20:20:06 +0800 | [diff] [blame] | 27 | { |
| 28 | public: |
George Liu | 36e8135 | 2020-07-01 14:40:30 +0800 | [diff] [blame] | 29 | MOCK_METHOD(std::string, getService, (const char*, const char*), |
| 30 | (const override)); |
| 31 | |
George Liu | 1e44c73 | 2020-02-28 20:20:06 +0800 | [diff] [blame] | 32 | MOCK_METHOD(void, setDbusProperty, |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 33 | (const pldm::utils::DBusMapping&, |
| 34 | const pldm::utils::PropertyValue&), |
| 35 | (const override)); |
John Wang | 29683b5 | 2020-02-27 16:41:44 +0800 | [diff] [blame] | 36 | |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 37 | MOCK_METHOD(pldm::utils::PropertyValue, getDbusPropertyVariant, |
John Wang | 29683b5 | 2020-02-27 16:41:44 +0800 | [diff] [blame] | 38 | (const char*, const char*, const char*), (const override)); |
George Liu | 1e44c73 | 2020-02-28 20:20:06 +0800 | [diff] [blame] | 39 | }; |