114107a10SKamalkumar Patel #include "../dbus/custom_dbus.hpp"
2682ee18cSGeorge Liu 
3682ee18cSGeorge Liu #include <gtest/gtest.h>
4682ee18cSGeorge Liu 
5682ee18cSGeorge Liu using namespace pldm::dbus;
TEST(CustomDBus,LocationCode)6682ee18cSGeorge Liu TEST(CustomDBus, LocationCode)
7682ee18cSGeorge Liu {
8682ee18cSGeorge Liu     std::string tmpPath = "/abc/def";
9682ee18cSGeorge Liu     std::string locationCode = "testLocationCode";
10682ee18cSGeorge Liu 
11682ee18cSGeorge Liu     CustomDBus::getCustomDBus().setLocationCode(tmpPath, locationCode);
12682ee18cSGeorge Liu     auto retLocationCode = CustomDBus::getCustomDBus().getLocationCode(tmpPath);
13682ee18cSGeorge Liu 
14682ee18cSGeorge Liu     EXPECT_NE(retLocationCode, std::nullopt);
15682ee18cSGeorge Liu     EXPECT_EQ(locationCode, retLocationCode);
16682ee18cSGeorge Liu }
17*56da5740SKamalkumar Patel 
TEST(CustomDBus,MicroCode)18*56da5740SKamalkumar Patel TEST(CustomDBus, MicroCode)
19*56da5740SKamalkumar Patel {
20*56da5740SKamalkumar Patel     std::string tmpPath = "/abc/def";
21*56da5740SKamalkumar Patel     uint32_t value = 32;
22*56da5740SKamalkumar Patel 
23*56da5740SKamalkumar Patel     CustomDBus::getCustomDBus().setMicroCode(tmpPath, value);
24*56da5740SKamalkumar Patel     auto retMicroCode = CustomDBus::getCustomDBus().getMicroCode(tmpPath);
25*56da5740SKamalkumar Patel 
26*56da5740SKamalkumar Patel     EXPECT_NE(retMicroCode, std::nullopt);
27*56da5740SKamalkumar Patel     EXPECT_EQ(value, retMicroCode);
28*56da5740SKamalkumar Patel }
29