blob: 86264a134bf1a9f10d1f67274a99fa869081f0cb [file] [log] [blame]
Patrick Venture9dfcf5d2019-01-16 09:53:10 -08001#include "ipmi_errors.hpp"
2
3#include <gtest/gtest.h>
4
5namespace host_tool
6{
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
28} // namespace host_tool