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
23ae3c2b
Commit
23ae3c2b
authored
Jul 04, 2012
by
Mukund Sivaraman
Browse files
[2053] Add checks with long label sequences
parent
3a1e804a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/tests/labelsequence_unittest.cc
View file @
23ae3c2b
...
...
@@ -313,6 +313,61 @@ TEST_F(LabelSequenceTest, toText) {
EXPECT_EQ
(
"."
,
ls7
.
toText
());
EXPECT_THROW
(
ls7
.
stripLeft
(
1
),
isc
::
OutOfRange
);
Name
n_long1
(
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"0123456789012345678901234567890"
);
LabelSequence
ls_long1
(
n_long1
);
EXPECT_EQ
(
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"0123456789012345678901234567890."
,
ls_long1
.
toText
());
ls_long1
.
stripRight
(
1
);
EXPECT_EQ
(
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"012345678901234567890123456789012."
"012345678901234567890123456789"
"0123456789012345678901234567890"
,
ls_long1
.
toText
());
Name
n_long2
(
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6"
);
LabelSequence
ls_long2
(
n_long2
);
EXPECT_EQ
(
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6."
,
ls_long2
.
toText
());
ls_long2
.
stripRight
(
1
);
EXPECT_EQ
(
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9."
"0.1.2.3.4.5.6"
,
ls_long2
.
toText
());
ls_long2
.
stripRight
(
125
);
EXPECT_EQ
(
"0.1"
,
ls_long2
.
toText
());
}
// The following are test data used in the getHash test below. Normally
...
...
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