blob: 7a5f6dd56d52e7cd5a328e8e44ebd5fec278ef16 [file] [log] [blame]
Patrick Venture123b5c02019-03-05 14:01:00 -08001#include "internal_sys_mock.hpp"
2
3#include <ipmiblob/ipmi_errors.hpp>
4#include <ipmiblob/ipmi_handler.hpp>
5
Patrick Venture1470bec2019-03-06 07:33:12 -08006namespace ipmiblob
Patrick Venture123b5c02019-03-05 14:01:00 -08007{
8
9using ::testing::_;
10using ::testing::Return;
11
12TEST(IpmiHandlerTest, OpenAllFails)
13{
14 /* Open against all device files fail. */
15 internal::InternalSysMock sysMock;
16 IpmiHandler ipmi(&sysMock);
17
18 EXPECT_CALL(sysMock, open(_, _)).WillRepeatedly(Return(-1));
19 EXPECT_THROW(ipmi.open(), IpmiException);
20}
21
Patrick Venture1470bec2019-03-06 07:33:12 -080022} // namespace ipmiblob