Commit 23ae3c2b authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2053] Add checks with long label sequences

parent 3a1e804a
......@@ -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
......
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