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
bd9fe8ae
Commit
bd9fe8ae
authored
Apr 28, 2020
by
Michael Davis
Committed by
Cedric Caffy
Sep 25, 2020
Browse files
[lto_rao] Fixes several typos
parent
40daee4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/tape/tapeserver/SCSI/Structures.hpp
View file @
bd9fe8ae
...
...
@@ -1190,9 +1190,9 @@ namespace SCSI {
/**
* REOWP Short form parameter data, as described in LTO-8 SCSI Reference, p.120
*/
class
readEndOfWrapPositionShortForm_t
()
{
class
readEndOfWrapPosition
Data
ShortForm_t
{
public:
readEndOfWrapPositionShortForm_t
()
{
zeroStruct
(
this
);
}
readEndOfWrapPosition
Data
ShortForm_t
()
{
zeroStruct
(
this
);
}
// bytes 0-1
unsigned
char
responseDataLength
[
2
];
// 08h, the number of bytes to follow
...
...
@@ -1208,9 +1208,9 @@ namespace SCSI {
/**
* REOWP Long form parameter data, as described in LTO-8 SCSI Reference, p.120-121
*/
class
readEndOfWrapPositionLongForm_t
()
{
class
readEndOfWrapPosition
Data
LongForm_t
{
public:
readEndOfWrapPositionLongForm_t
()
{
zeroStruct
(
this
);
}
readEndOfWrapPosition
Data
LongForm_t
()
{
zeroStruct
(
this
);
}
// bytes 0-1
unsigned
char
responseDataLength
[
2
];
// n-1, the number of bytes to follow
...
...
tapeserver/castor/tape/tapeserver/SCSI/StructuresTest.cpp
View file @
bd9fe8ae
...
...
@@ -949,7 +949,7 @@ namespace unitTests {
ASSERT_EQ
(
0xAB0
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataShortForm
.
responseDataLength
));
// Reserved
buff
[
2
]
=
0xFF
;
buf
[
3
]
=
0xFF
;
buff
[
2
]
=
0xFF
;
buf
f
[
3
]
=
0xFF
;
// In this record, the logical object identifier is 6 bytes (48 bits).
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU48
(
readEndOfWrapPositionDataShortForm
.
logicalObjectIdentifier
));
...
...
@@ -962,34 +962,34 @@ namespace unitTests {
unsigned
char
*
buff
=
reinterpret_cast
<
unsigned
char
*>
(
&
readEndOfWrapPositionDataLongForm
);
// Make sure this struct is a POD (plain old data without virtual table) and has the right size
ASSERT_EQ
(
4
+
(
12
*
maxLTOTapeWraps
),
sizeof
(
readEndOfWrapPositionDataLongForm
));
ASSERT_EQ
(
4
+
(
12
*
castor
::
tape
::
SCSI
::
maxLTOTapeWraps
),
sizeof
(
readEndOfWrapPositionDataLongForm
));
// Check proper initialization and location of struct members match the bit/byte locations defined in LTO-8 reference
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
responseDataLength
));
buff
[
0
]
=
0x0A
;
buff
[
1
]
=
0xB0
;
ASSERT_EQ
(
0xAB0
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
responseDataLength
));
for
(
int
wrap
=
0
;
wrap
<
maxLTOTapeWraps
;
++
wrap
)
{
for
(
unsigned
int
wrap
=
0
;
wrap
<
castor
::
tape
::
SCSI
::
maxLTOTapeWraps
;
++
wrap
)
{
int
offset
=
4
+
(
wrap
*
12
);
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescript
i
or
[
wrap
].
wrapNumber
));
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescriptor
[
wrap
].
wrapNumber
));
buff
[
offset
+
0
]
=
0xAB
;
buff
[
offset
+
1
]
=
0xCD
;
ASSERT_EQ
(
0xABCD
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescript
i
or
[
wrap
].
wrapNumber
));
ASSERT_EQ
(
0xABCD
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescriptor
[
wrap
].
wrapNumber
));
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescript
i
or
[
wrap
].
partition
));
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescriptor
[
wrap
].
partition
));
buff
[
offset
+
2
]
=
0xEF
;
buff
[
offset
+
3
]
=
0x01
;
ASSERT_EQ
(
0xEF01
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescript
i
or
[
wrap
].
partition
));
ASSERT_EQ
(
0xEF01
,
castor
::
tape
::
SCSI
::
Structures
::
toU16
(
readEndOfWrapPositionDataLongForm
.
wrapDescriptor
[
wrap
].
partition
));
// Reserved
buff
[
offset
+
4
]
=
0xFF
;
buff
[
offset
+
5
]
=
0xFF
;
// In this record, the logical object identifier is 6 bytes (48 bits).
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU48
(
readEndOfWrapPositionDataLongForm
.
wrapDescript
i
or
[
wrap
].
logicalObjectIdentifier
));
ASSERT_EQ
(
0U
,
castor
::
tape
::
SCSI
::
Structures
::
toU48
(
readEndOfWrapPositionDataLongForm
.
wrapDescriptor
[
wrap
].
logicalObjectIdentifier
));
buff
[
offset
+
6
]
=
0xAB
;
buff
[
offset
+
7
]
=
0xCD
;
buff
[
offset
+
8
]
=
0xEF
;
buff
[
offset
+
9
]
=
0x12
;
buff
[
offset
+
10
]
=
0x34
;
buff
[
offset
+
11
]
=
0x56
;
ASSERT_EQ
(
0xABCDEF123456
,
castor
::
tape
::
SCSI
::
Structures
::
toU48
(
readEndOfWrapPositionDataLongForm
.
wrapDescript
i
or
[
wrap
].
logicalObjectIdentifier
));
ASSERT_EQ
(
0xABCDEF123456
,
castor
::
tape
::
SCSI
::
Structures
::
toU48
(
readEndOfWrapPositionDataLongForm
.
wrapDescriptor
[
wrap
].
logicalObjectIdentifier
));
}
}
...
...
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