Commit 0807c718 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3624] Address review comments.

Removed the leftover debugging statement. Also, added some more commentary
to the test checking behavior for too long FQDNs.
parent 4850c004
...@@ -191,17 +191,16 @@ TEST(Option6ClientFqdnTest, constructFromWireTooLongLabel) { ...@@ -191,17 +191,16 @@ TEST(Option6ClientFqdnTest, constructFromWireTooLongLabel) {
// is over 255. // is over 255.
TEST(Option6ClientFqdnTest, constructFromWireTooLongDomainName) { TEST(Option6ClientFqdnTest, constructFromWireTooLongDomainName) {
OptionBuffer in_buf(Option6ClientFqdn::FLAG_S); OptionBuffer in_buf(Option6ClientFqdn::FLAG_S);
// Construct the FQDN from 26 labels, each having a size of 10.
for (int i = 0; i < 26; ++i) { for (int i = 0; i < 26; ++i) {
// Append the length of each label.
in_buf.push_back(10); in_buf.push_back(10);
// Append the actual label.
in_buf.insert(in_buf.end(), 10, 109); in_buf.insert(in_buf.end(), 10, 109);
} }
// Terminate FQDN with a dot.
in_buf.push_back(0); in_buf.push_back(0);
try {
Option6ClientFqdn(in_buf.begin(), in_buf.end());
} catch (const Exception& ex) {
std::cout << ex.what() << std::endl;
}
EXPECT_THROW(Option6ClientFqdn(in_buf.begin(), in_buf.end()), EXPECT_THROW(Option6ClientFqdn(in_buf.begin(), in_buf.end()),
InvalidOption6FqdnDomainName); InvalidOption6FqdnDomainName);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment