blob: cd5a24979671c25999b7ed6a1f4884afe070f9a8 [file] [log] [blame]
Patrick Venture123b5c02019-03-05 14:01:00 -08001#include <ipmiblob/ipmi_errors.hpp>
2
3#include <gtest/gtest.h>
4
Patrick Venture1470bec2019-03-06 07:33:12 -08005namespace ipmiblob
Patrick Venture123b5c02019-03-05 14:01:00 -08006{
7
8TEST(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 Venture1470bec2019-03-06 07:33:12 -080028} // namespace ipmiblob