Skip to content

Validate SCSI error codes (sense key, ASC) in unit tests #895

@uweseimet

Description

@uweseimet

Currently the unit tests only validate whether scsi_exception is raised where expected. It is not yet validated whether the sense key and ASC have the expected values. The missing validation shall be added.

Example:

    EXPECT_THAT([&printer]() { printer->Dispatch(scsi_command::eCmdPrint); }, Throws<scsi_exception>(AllOf(
    		Property(&scsi_exception::get_sense_key, sense_key::ILLEGAL_REQUEST),
		Property(&scsi_exception::get_asc, asc::INVALID_FIELD_IN_CDB))))
    	<< "Buffer overflow was not reported";

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions