mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-26 21:18:56 +00:00
This commit is contained in:
@@ -69,7 +69,9 @@ TEST(HostServicesTest, StartStopUnit)
|
||||
|
||||
// START
|
||||
cmd[4] = 0x01;
|
||||
EXPECT_THROW(services->Dispatch(scsi_command::eCmdStartStop), scsi_exception);
|
||||
EXPECT_THAT([&services]() { services->Dispatch(scsi_command::eCmdStartStop); }, Throws<scsi_exception>(AllOf(
|
||||
Property(&scsi_exception::get_sense_key, sense_key::ILLEGAL_REQUEST),
|
||||
Property(&scsi_exception::get_asc, asc::INVALID_FIELD_IN_CDB))));
|
||||
}
|
||||
|
||||
TEST(HostServicesTest, ModeSense6)
|
||||
@@ -79,11 +81,15 @@ TEST(HostServicesTest, ModeSense6)
|
||||
|
||||
vector<int>& cmd = controller.GetCmd();
|
||||
|
||||
EXPECT_THROW(services->Dispatch(scsi_command::eCmdModeSense6), scsi_exception)
|
||||
EXPECT_THAT([&services]() { services->Dispatch(scsi_command::eCmdModeSense6); }, Throws<scsi_exception>(AllOf(
|
||||
Property(&scsi_exception::get_sense_key, sense_key::ILLEGAL_REQUEST),
|
||||
Property(&scsi_exception::get_asc, asc::INVALID_FIELD_IN_CDB))))
|
||||
<< "Unsupported mode page was returned";
|
||||
|
||||
cmd[2] = 0x20;
|
||||
EXPECT_THROW(services->Dispatch(scsi_command::eCmdModeSense6), scsi_exception)
|
||||
EXPECT_THAT([&services]() { services->Dispatch(scsi_command::eCmdModeSense6); }, Throws<scsi_exception>(AllOf(
|
||||
Property(&scsi_exception::get_sense_key, sense_key::ILLEGAL_REQUEST),
|
||||
Property(&scsi_exception::get_asc, asc::INVALID_FIELD_IN_CDB))))
|
||||
<< "Block descriptors are not supported";
|
||||
|
||||
cmd[1] = 0x08;
|
||||
@@ -116,11 +122,15 @@ TEST(HostServicesTest, ModeSense10)
|
||||
|
||||
vector<int>& cmd = controller.GetCmd();
|
||||
|
||||
EXPECT_THROW(services->Dispatch(scsi_command::eCmdModeSense10), scsi_exception)
|
||||
EXPECT_THAT([&services]() { services->Dispatch(scsi_command::eCmdModeSense10); }, Throws<scsi_exception>(AllOf(
|
||||
Property(&scsi_exception::get_sense_key, sense_key::ILLEGAL_REQUEST),
|
||||
Property(&scsi_exception::get_asc, asc::INVALID_FIELD_IN_CDB))))
|
||||
<< "Unsupported mode page was returned";
|
||||
|
||||
cmd[2] = 0x20;
|
||||
EXPECT_THROW(services->Dispatch(scsi_command::eCmdModeSense10), scsi_exception)
|
||||
EXPECT_THAT([&services]() { services->Dispatch(scsi_command::eCmdModeSense10); }, Throws<scsi_exception>(AllOf(
|
||||
Property(&scsi_exception::get_sense_key, sense_key::ILLEGAL_REQUEST),
|
||||
Property(&scsi_exception::get_asc, asc::INVALID_FIELD_IN_CDB))))
|
||||
<< "Block descriptors are not supported";
|
||||
|
||||
cmd[1] = 0x08;
|
||||
|
||||
Reference in New Issue
Block a user