Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame^] | 1 | #include "internal_sys_mock.hpp" |
| 2 | |
| 3 | #include <ipmiblob/ipmi_errors.hpp> |
| 4 | #include <ipmiblob/ipmi_handler.hpp> |
| 5 | |
| 6 | namespace host_tool |
| 7 | { |
| 8 | |
| 9 | using ::testing::_; |
| 10 | using ::testing::Return; |
| 11 | |
| 12 | TEST(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 | |
| 22 | } // namespace host_tool |