diff options
Diffstat (limited to 'test/tools_ipmi_error_unittest.cpp')
-rw-r--r-- | test/tools_ipmi_error_unittest.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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 |