psu-ng: Updates for clearFaults

It was discovered that the power supplies may not always have the
in1_crit "file" available in the HWMON directory. This file may be
missing if certain commands are not supported. It was also discovered
that it can be missing if the power supply falsely indicates it supports
PEC, but actually does not. Changing the readString call to read from
the in1_input file, which typically should be present (READ_VIN).

Move the clearFaults function from the hpp file to the cpp file, as:
1. It is getting a bit lengthy.
2. Adding a try/catch for ReadFailure to avoid crashing the application
   if there is a ReadFailure, which is in the phosphor::logging
   namespace already used in the cpp file.

Update the test case to expect a read from in1_input, and return a value
that more closely resembles an actual READ_VIN value.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I9747317c68040cdce6bb80922e3928be55376c44
diff --git a/phosphor-power-supply/test/power_supply_tests.cpp b/phosphor-power-supply/test/power_supply_tests.cpp
index dda38f5..c6d4814 100644
--- a/phosphor-power-supply/test/power_supply_tests.cpp
+++ b/phosphor-power-supply/test/power_supply_tests.cpp
@@ -168,7 +168,9 @@
     EXPECT_EQ(psu.hasInputFault(), true);
     EXPECT_EQ(psu.hasMFRFault(), true);
     EXPECT_EQ(psu.hasVINUVFault(), true);
-    EXPECT_CALL(mockPMBus, read("in1_crit", _)).Times(1).WillOnce(Return(0x01));
+    EXPECT_CALL(mockPMBus, read("in1_input", _))
+        .Times(1)
+        .WillOnce(Return(209000));
     psu.clearFaults();
     EXPECT_EQ(psu.isPresent(), true);
     EXPECT_EQ(psu.isFaulted(), false);