]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3974] Small updates to the expiration parser tests.
authorMarcin Siodelski <marcin@isc.org>
Tue, 6 Oct 2015 14:52:25 +0000 (16:52 +0200)
committerMarcin Siodelski <marcin@isc.org>
Tue, 6 Oct 2015 14:52:25 +0000 (16:52 +0200)
As a result of the review.

src/lib/dhcpsrv/tests/cfg_expiration_unittest.cc
src/lib/dhcpsrv/tests/expiration_config_parser_unittest.cc

index 86a1fc750afb147424d4520180c443775f63beb0..5bb65afa06dcf6dea2f4f6920ac3c75249546b45 100644 (file)
@@ -69,6 +69,10 @@ testAccessModify(const int64_t limit, const ModifierFun& modifier,
     // Setting the value to the maximum allowed - 1 should pass.
     ASSERT_NO_THROW(modifier(&cfg, limit - 1));
     EXPECT_EQ(limit - 1, accessor(&cfg));
+
+    // Setting the value to 0 should pass.
+    ASSERT_NO_THROW(modifier(&cfg, 0));
+    EXPECT_EQ(0, accessor(&cfg));
 }
 
 /// @brief Tests that modifier and the accessor returning uint16_t value
index f9da76ad3cc7db224a31fdc5f6c20ff4f78e843a..82f870aa36ef6ec4de0cc35557ba5173a41ac834 100644 (file)
@@ -140,6 +140,11 @@ ExpirationConfigParserTest::testOutOfRange(const std::string& param,
     addParam(param, max_value);
     EXPECT_NO_THROW(renderConfig())
         << "test for in range value of '" << param << "' failed";
+
+    // Value of 0 should be accepted.
+    addParam(param, 0);
+    EXPECT_NO_THROW(renderConfig())
+        << "test for zero value of '" << param << "' failed";
 }