regulators: Add inventory path to Chassis class
A previous commit added the "inventory_path" property to the "chassis"
object in the JSON configuration file.
This commit adds that new property to the C++ implementation:
* Chassis class and associated gtests
* JSON configuration file parser functions and associated gtests
* Other gtests affected by the change to the Chassis constructor
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I7406f874263d01e6faa2b8c333cb1baf915cf2ac
diff --git a/phosphor-regulators/test/device_tests.cpp b/phosphor-regulators/test/device_tests.cpp
index c3ed166..0c386fb 100644
--- a/phosphor-regulators/test/device_tests.cpp
+++ b/phosphor-regulators/test/device_tests.cpp
@@ -50,6 +50,9 @@
using ::testing::Throw;
using ::testing::TypedEq;
+static const std::string chassisInvPath{
+ "/xyz/openbmc_project/inventory/system/chassis"};
+
TEST(DeviceTests, Constructor)
{
// Test where only required parameters are specified
@@ -190,7 +193,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -342,7 +345,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -375,7 +378,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -461,7 +464,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -624,7 +627,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -662,7 +665,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -700,7 +703,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -755,7 +758,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis
@@ -821,7 +824,7 @@
std::vector<std::unique_ptr<Device>> devices{};
devices.emplace_back(std::move(device));
std::unique_ptr<Chassis> chassis =
- std::make_unique<Chassis>(1, std::move(devices));
+ std::make_unique<Chassis>(1, chassisInvPath, std::move(devices));
Chassis* chassisPtr = chassis.get();
// Create System that contains Chassis