regulators: Add info to WriteVerificationError

Add more information to the WriteVerificationError exception:
* Unique ID of the device where the error occurred
* Inventory path of the device where the error occurred

This information is required in order to create an error log entry based
on the exception.

Modify files that currently use WriteVerificationError to adapt to the
new constructor and get methods.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I1e7fb321efe86b54dcd32a9752ec7465be90ad48
diff --git a/phosphor-regulators/test/write_verification_error_tests.cpp b/phosphor-regulators/test/write_verification_error_tests.cpp
index dc794e8..bce7855 100644
--- a/phosphor-regulators/test/write_verification_error_tests.cpp
+++ b/phosphor-regulators/test/write_verification_error_tests.cpp
@@ -21,18 +21,44 @@
 
 TEST(WriteVerificationErrorTests, Constructor)
 {
-    WriteVerificationError error("device: vdd1, register: 0x21, "
-                                 "value_written: 0xAD, value_read: 0x00");
+    WriteVerificationError error(
+        "device: vdd1, register: 0x21, value_written: 0xAD, value_read: 0x00",
+        "vdd1",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+    EXPECT_EQ(error.getDeviceID(), "vdd1");
+    EXPECT_EQ(error.getInventoryPath(),
+              "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
     EXPECT_STREQ(error.what(),
                  "WriteVerificationError: device: vdd1, register: 0x21, "
                  "value_written: 0xAD, value_read: 0x00");
 }
 
+TEST(WriteVerificationErrorTests, GetDeviceID)
+{
+    WriteVerificationError error(
+        "device: vdd1, register: 0x21, value_written: 0xAD, value_read: 0x00",
+        "vdd1",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+    EXPECT_EQ(error.getDeviceID(), "vdd1");
+}
+
+TEST(WriteVerificationErrorTests, GetInventoryPath)
+{
+    WriteVerificationError error(
+        "device: vdd1, register: 0x21, value_written: 0xAD, value_read: 0x00",
+        "vdd1",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+    EXPECT_EQ(error.getInventoryPath(),
+              "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+}
+
 TEST(WriteVerificationErrorTests, What)
 {
-    WriteVerificationError error("device: vdd2, register: 0x21, "
-                                 "value_written: 0x32, value_read: 0x33");
+    WriteVerificationError error(
+        "device: vdd1, register: 0x21, value_written: 0xAD, value_read: 0x00",
+        "vdd1",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
     EXPECT_STREQ(error.what(),
-                 "WriteVerificationError: device: vdd2, register: 0x21, "
-                 "value_written: 0x32, value_read: 0x33");
+                 "WriteVerificationError: device: vdd1, register: 0x21, "
+                 "value_written: 0xAD, value_read: 0x00");
 }