summaryrefslogtreecommitdiffstats
path: root/test/tools_ipmi_error_unittest.cpp
blob: cd5a24979671c25999b7ed6a1f4884afe070f9a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <ipmiblob/ipmi_errors.hpp>

#include <gtest/gtest.h>

namespace ipmiblob
{

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 ipmiblob
OpenPOWER on IntegriCloud