diff --git a/cpp/test/mocks.h b/cpp/test/mocks.h index 1fcc7f58..e481d6c0 100644 --- a/cpp/test/mocks.h +++ b/cpp/test/mocks.h @@ -216,7 +216,6 @@ class MockScsiController : public ScsiController { } ~MockScsiController() override = default; - }; class MockDevice : public Device diff --git a/cpp/test/scsi_controller_test.cpp b/cpp/test/scsi_controller_test.cpp index 56007369..a5004c80 100644 --- a/cpp/test/scsi_controller_test.cpp +++ b/cpp/test/scsi_controller_test.cpp @@ -17,6 +17,9 @@ TEST(ScsiControllerTest, GetInitiatorId) auto bus = make_shared>(); MockScsiController controller(bus, 0); + auto device = make_shared(0); + + controller.AddDevice(device); controller.Process(ID); EXPECT_EQ(ID, controller.GetInitiatorId()); @@ -28,7 +31,10 @@ TEST(ScsiControllerTest, Process) { auto bus = make_shared>(); MockScsiController controller(bus, 0); + auto device = make_shared(0); + controller.Init(); + controller.AddDevice(device); controller.SetPhase(phase_t::reserved); ON_CALL(*bus, GetRST).WillByDefault(Return(true)); @@ -84,6 +90,9 @@ TEST(ScsiControllerTest, Selection) { auto bus = make_shared>(); auto controller = make_shared(bus, 0); + auto device = make_shared(0); + + controller->AddDevice(device); controller->SetPhase(phase_t::selection); ON_CALL(*bus, GetSEL).WillByDefault(Return(true)); @@ -130,6 +139,9 @@ TEST(ScsiControllerTest, Command) { auto bus = make_shared>(); MockScsiController controller(bus, 0); + auto device = make_shared(0); + + controller.AddDevice(device); controller.SetPhase(phase_t::command); EXPECT_CALL(controller, Status).Times(2); @@ -226,6 +238,9 @@ TEST(ScsiControllerTest, Error) { auto bus = make_shared>(); MockScsiController controller(bus, 0); + auto device = make_shared(0); + + controller.AddDevice(device); ON_CALL(*bus, GetRST).WillByDefault(Return(true)); controller.SetPhase(phase_t::reserved);