initial commit

Add initial code from phosphor-ipmi-flash/tools that was not specific to
firmware update over ipmi-blobs.

Change-Id: I360537a7392347fe989397a699f6a712bc36e62c
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/tools_ipmi_error_unittest.cpp b/test/tools_ipmi_error_unittest.cpp
new file mode 100644
index 0000000..05048e2
--- /dev/null
+++ b/test/tools_ipmi_error_unittest.cpp
@@ -0,0 +1,28 @@
+#include <ipmiblob/ipmi_errors.hpp>
+
+#include <gtest/gtest.h>
+
+namespace host_tool
+{
+
+TEST(IpmiExceptionTest, VerifyTimedOutIsString)
+{
+    /* Verify that throwing the exception with the cc code for timed out gets
+     * converted to the human readable string.
+     */
+    bool verified = false;
+
+    try
+    {
+        throw IpmiException(0xc3);
+    }
+    catch (const IpmiException& i)
+    {
+        EXPECT_STREQ("Received IPMI_CC: timeout", i.what());
+        verified = true;
+    }
+
+    EXPECT_TRUE(verified);
+}
+
+} // namespace host_tool