Kamalkumar Patel | 14107a1 | 2024-06-19 08:50:01 -0500 | [diff] [blame] | 1 | #include "../dbus/custom_dbus.hpp" |
George Liu | 682ee18 | 2020-12-25 15:24:33 +0800 | [diff] [blame] | 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
| 5 | using namespace pldm::dbus; |
| 6 | TEST(CustomDBus, LocationCode) |
| 7 | { |
| 8 | std::string tmpPath = "/abc/def"; |
| 9 | std::string locationCode = "testLocationCode"; |
| 10 | |
| 11 | CustomDBus::getCustomDBus().setLocationCode(tmpPath, locationCode); |
| 12 | auto retLocationCode = CustomDBus::getCustomDBus().getLocationCode(tmpPath); |
| 13 | |
| 14 | EXPECT_NE(retLocationCode, std::nullopt); |
| 15 | EXPECT_EQ(locationCode, retLocationCode); |
| 16 | } |
Kamalkumar Patel | 56da574 | 2024-05-23 04:53:07 -0500 | [diff] [blame] | 17 | |
| 18 | TEST(CustomDBus, MicroCode) |
| 19 | { |
| 20 | std::string tmpPath = "/abc/def"; |
| 21 | uint32_t value = 32; |
| 22 | |
| 23 | CustomDBus::getCustomDBus().setMicroCode(tmpPath, value); |
| 24 | auto retMicroCode = CustomDBus::getCustomDBus().getMicroCode(tmpPath); |
| 25 | |
| 26 | EXPECT_NE(retMicroCode, std::nullopt); |
| 27 | EXPECT_EQ(value, retMicroCode); |
| 28 | } |