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/configuration_tests.cpp b/phosphor-regulators/test/configuration_tests.cpp
index 47279be..2f4ded6 100644
--- a/phosphor-regulators/test/configuration_tests.cpp
+++ b/phosphor-regulators/test/configuration_tests.cpp
@@ -49,6 +49,9 @@
using ::testing::Throw;
using ::testing::TypedEq;
+static const std::string chassisInvPath{
+ "/xyz/openbmc_project/inventory/system/chassis"};
+
TEST(ConfigurationTests, Constructor)
{
// Test where volts value specified
@@ -122,7 +125,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
@@ -182,7 +185,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
@@ -249,7 +252,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
@@ -315,7 +318,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
@@ -384,7 +387,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
@@ -460,7 +463,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