Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 1 | #include <ipmiblob/ipmi_errors.hpp> |
| 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
Patrick Venture | 1470bec | 2019-03-06 07:33:12 -0800 | [diff] [blame] | 5 | namespace ipmiblob |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 6 | { |
| 7 | |
| 8 | TEST(IpmiExceptionTest, VerifyTimedOutIsString) |
| 9 | { |
| 10 | /* Verify that throwing the exception with the cc code for timed out gets |
| 11 | * converted to the human readable string. |
| 12 | */ |
| 13 | bool verified = false; |
| 14 | |
| 15 | try |
| 16 | { |
| 17 | throw IpmiException(0xc3); |
| 18 | } |
| 19 | catch (const IpmiException& i) |
| 20 | { |
| 21 | EXPECT_STREQ("Received IPMI_CC: timeout", i.what()); |
| 22 | verified = true; |
| 23 | } |
| 24 | |
| 25 | EXPECT_TRUE(verified); |
| 26 | } |
| 27 | |
Patrick Venture | 1470bec | 2019-03-06 07:33:12 -0800 | [diff] [blame] | 28 | } // namespace ipmiblob |