]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[65-libyang-option-data] Improved set* unit tests
authorFrancis Dupont <fdupont@isc.org>
Mon, 24 Sep 2018 11:13:23 +0000 (13:13 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 24 Sep 2018 11:13:23 +0000 (13:13 +0200)
src/lib/yang/tests/translator_option_data_unittests.cc

index cef0f0d838e1ce251750cf1232a02122df479363..38f312d327ae303fdd3cafa4fa3abc03945e1b5d 100644 (file)
@@ -97,6 +97,11 @@ TEST_F(TranslatorOptionDataListTest, setEmpty) {
     EXPECT_NO_THROW(options = t_obj_->getOptionDataList(xpath));
     ASSERT_TRUE(options);
     EXPECT_EQ(0, options->size());
+
+    // Check that the tree representation is empty.
+    S_Tree tree;
+    EXPECT_NO_THROW(tree = sess_->get_subtree("/kea-dhcp6-server:config"));
+    EXPECT_FALSE(tree);
 }
 
 // This test verifies that one option data can be properly translated
@@ -144,6 +149,9 @@ TEST_F(TranslatorOptionDataListTest, set) {
         "         |\n"
         "         -- always-send = false\n";
     EXPECT_EQ(expected, tree->to_string(100));
+
+    // Check it validates.
+    EXPECT_NO_THROW(sess_->validate());
 }
 
 }; // end of anonymous namespace