Commit 4850c004 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3624] Extend test for DHCPv6 client FQDN to cover multi-label domain name.

parent 0a32f6d8
...@@ -791,6 +791,14 @@ TEST(Option6ClientFqdnTest, len) { ...@@ -791,6 +791,14 @@ TEST(Option6ClientFqdnTest, len) {
// length of the string representation of the domain name + 1). // length of the string representation of the domain name + 1).
EXPECT_EQ(25, option->len()); EXPECT_EQ(25, option->len());
// Use different domain name to check if the length also changes
// as expected.
ASSERT_NO_THROW(
option.reset(new Option6ClientFqdn(0, "example.com"))
);
ASSERT_TRUE(option);
EXPECT_EQ(18, option->len());
// Let's check that the size will change when domain name of a different // Let's check that the size will change when domain name of a different
// size is used. // size is used.
ASSERT_NO_THROW( ASSERT_NO_THROW(
...@@ -805,6 +813,16 @@ TEST(Option6ClientFqdnTest, len) { ...@@ -805,6 +813,16 @@ TEST(Option6ClientFqdnTest, len) {
); );
ASSERT_TRUE(option); ASSERT_TRUE(option);
EXPECT_EQ(12, option->len()); EXPECT_EQ(12, option->len());
// Another test for partial domain name but this time using
// two labels.
ASSERT_NO_THROW(
option.reset(new Option6ClientFqdn(0, "myhost.example",
Option6ClientFqdn::PARTIAL))
);
ASSERT_TRUE(option);
EXPECT_EQ(20, option->len());
} }
} // anonymous namespace } // anonymous namespace
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