Skip to content
GitLab
Projects
Groups
Snippets
/
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
73080d99
Commit
73080d99
authored
Jul 26, 2012
by
Mukund Sivaraman
Browse files
[2124] Don't add trailing space in toText() if fingerprint is empty
Also add some tests.
parent
595b447c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/rdata/generic/sshfp_44.cc
View file @
73080d99
...
...
@@ -128,7 +128,7 @@ string
SSHFP
::
toText
()
const
{
return
(
lexical_cast
<
string
>
(
static_cast
<
int
>
(
algorithm_
))
+
" "
+
lexical_cast
<
string
>
(
static_cast
<
int
>
(
fingerprint_type_
))
+
" "
+
encodeHex
(
fingerprint_
));
(
fingerprint_
.
size
()
>
0
?
" "
+
encodeHex
(
fingerprint_
)
:
""
)
);
}
int
...
...
src/lib/dns/tests/rdata_sshfp_unittest.cc
View file @
73080d99
...
...
@@ -156,6 +156,13 @@ TEST_F(Rdata_SSHFP_Test, createFromWire) {
TEST_F
(
Rdata_SSHFP_Test
,
toText
)
{
EXPECT_TRUE
(
boost
::
iequals
(
sshfp_txt
,
rdata_sshfp
.
toText
()));
const
string
sshfp_txt2
(
"2 1"
);
const
generic
::
SSHFP
rdata_sshfp2
(
sshfp_txt2
);
EXPECT_TRUE
(
boost
::
iequals
(
sshfp_txt2
,
rdata_sshfp2
.
toText
()));
const
generic
::
SSHFP
rdata_sshfp3
(
"2 1 "
);
EXPECT_TRUE
(
boost
::
iequals
(
sshfp_txt2
,
rdata_sshfp3
.
toText
()));
}
TEST_F
(
Rdata_SSHFP_Test
,
toWire
)
{
...
...
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