Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
6292462f
Commit
6292462f
authored
Feb 14, 2012
by
JINMEI Tatuya
Browse files
[1638] add some more bad from-wire data tests. no need to fix the main code.
parent
cfb3f053
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/tests/rdata_nsec3param_unittest.cc
View file @
6292462f
...
...
@@ -71,6 +71,19 @@ TEST_F(Rdata_NSEC3PARAM_Test, createFromWire) {
EXPECT_EQ
(
0
,
rdata_nsec3param
.
compare
(
*
rdataFactoryFromFile
(
RRType
::
NSEC3PARAM
(),
RRClass
::
IN
(),
"rdata_nsec3param_fromWire1"
)));
// Short buffer cases. The data is valid NSEC3PARAM RDATA, but the buffer
// is trimmed at the end. All cases should result in an exception from
// the buffer class.
vector
<
uint8_t
>
data
;
UnitTestUtil
::
readWireData
(
"rdata_nsec3param_fromWire1"
,
data
);
const
uint16_t
rdlen
=
(
data
.
at
(
0
)
<<
8
)
+
data
.
at
(
1
);
for
(
int
i
=
0
;
i
<
rdlen
;
++
i
)
{
// intentionally construct a short buffer
InputBuffer
b
(
&
data
[
0
]
+
2
,
i
);
EXPECT_THROW
(
createRdata
(
RRType
::
NSEC3PARAM
(),
RRClass
::
IN
(),
b
,
9
),
InvalidBufferPosition
);
}
}
TEST_F
(
Rdata_NSEC3PARAM_Test
,
toWireRenderer
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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