]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3390] Completed split UT
authorFrancis Dupont <fdupont@isc.org>
Thu, 29 Aug 2024 22:01:37 +0000 (00:01 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 26 Sep 2024 09:41:33 +0000 (11:41 +0200)
src/lib/dhcp/tests/libdhcp++_unittest.cc

index d4c006cfea97fe7cb2cafc41049faa9290dbf5ef..23d030b324f745fd341fae0e562b16c6bcd685af 100644 (file)
@@ -3890,6 +3890,22 @@ TEST_F(LibDhcpTest, splitNtpServerOptions6) {
     ASSERT_EQ(4, col.size());
     ASSERT_NO_THROW(LibDHCP::splitNtpServerOptions6(col));
     EXPECT_EQ(5, col.size());
+
+    // Expected output.
+    string expected = "type=00056, len=00020:,\noptions:\n";
+    expected += "  type=00001, len=00016: 2001:db8::abcd (ipv6-address)\n";
+    expected += "type=00056, len=00020:,\noptions:\n";
+    expected += "  type=00001, len=00016: 2001:db8::bcde (ipv6-address)\n";
+    expected += "type=00056, len=00020:,\noptions:\n";
+    expected += "  type=00001, len=00016: 2001:db8::cdef (ipv6-address)\n";
+    expected += "type=00056, len=00013:,\noptions:\n";
+    expected += "  type=00003, len=00009: \"foo.bar.\" (fqdn)\n";
+    expected += "type=00059, len=00006: \"foobar\" (string)\n";
+    ostringstream output;
+    for (auto opt : col) {
+        output << opt.second->toText() << endl;
+    }
+    EXPECT_EQ(expected, output.str());
 }
 
 }  // namespace