From: Marcin Siodelski Date: Mon, 8 Dec 2014 18:35:38 +0000 (+0100) Subject: [3624] Address review comments. X-Git-Tag: kea-eng-20141219~14^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0807c71805ef558d7e77393059a1133859dff930;p=thirdparty%2Fkea.git [3624] Address review comments. Removed the leftover debugging statement. Also, added some more commentary to the test checking behavior for too long FQDNs. --- diff --git a/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc b/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc index 4bbc1bd8de..b353156ab3 100644 --- a/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc +++ b/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc @@ -191,17 +191,16 @@ TEST(Option6ClientFqdnTest, constructFromWireTooLongLabel) { // is over 255. TEST(Option6ClientFqdnTest, constructFromWireTooLongDomainName) { 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) { + // Append the length of each label. in_buf.push_back(10); + // Append the actual label. in_buf.insert(in_buf.end(), 10, 109); } + // Terminate FQDN with a dot. 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()), InvalidOption6FqdnDomainName); }