Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
a7bcd591
Commit
a7bcd591
authored
Jul 25, 2013
by
Eric Cano
Browse files
Added validation of the inquiryCDB_t struct.
parent
295771dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
SCSI/Structures.hh
View file @
a7bcd591
...
...
@@ -54,6 +54,7 @@ namespace SCSI {
unsigned
char
control
;
}
inquiryCDB_t
;
/*
* Inquiry data as described in SPC-4.
*/
...
...
SCSI/StructuresTest.cc
View file @
a7bcd591
...
...
@@ -103,4 +103,22 @@ namespace UnitTests {
ASSERT_EQ
(
0x12
,
*
inq
.
vendorSpecific2
);
}
TEST
(
SCSI_Structures
,
inquiryCDB_t
)
{
SCSI
::
Structures
::
inquiryCDB_t
inqCDB
;
unsigned
char
*
buff
=
(
unsigned
char
*
)
&
inqCDB
;
ASSERT_EQ
(
6
,
sizeof
(
inqCDB
));
ASSERT_EQ
(
0
,
inqCDB
.
opCode
);
buff
[
0
]
=
SCSI
::
Commands
::
INQUIRY
;
ASSERT_EQ
(
SCSI
::
Commands
::
INQUIRY
,
inqCDB
.
opCode
);
ASSERT_EQ
(
0
,
inqCDB
.
EVPD
);
buff
[
1
]
=
0x1
;
ASSERT_EQ
(
1
,
inqCDB
.
EVPD
);
ASSERT_EQ
(
0
,
inqCDB
.
control
);
buff
[
5
]
=
0xCA
;
ASSERT_EQ
(
0xCA
,
inqCDB
.
control
);
}
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment