]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1975] Test reconfiguration
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 6 Jun 2012 15:35:18 +0000 (17:35 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 6 Jun 2012 15:35:18 +0000 (17:35 +0200)
We try calling the configure function multiple times on the same object.

src/lib/datasrc/tests/container_unittest.cc

index 8ff13173360541279ed931acdc4781f14d9a6e33..7528efe27801e30442e7b01ed096a21c0e1159e3 100644 (file)
@@ -438,6 +438,17 @@ TEST_F(ContainerTest, defaults) {
     checkDS(0, "type1", "null");
 }
 
+// Check we can call the configure multiple times, to change the configuration
+TEST_F(ContainerTest, reconfigure) {
+    ConstElementPtr empty(new ListElement);
+    container_->configure(config_elem_, true);
+    checkDS(0, "test_type", "{}");
+    container_->configure(empty, true);
+    EXPECT_TRUE(container_->dataSources().empty());
+    container_->configure(config_elem_, true);
+    checkDS(0, "test_type", "{}");
+}
+
 // Make sure the data source error exception from the factory is propagated
 TEST_F(ContainerTest, dataSrcError) {
     ConstElementPtr elem(Element::fromJSON("["