From: Marcin Siodelski Date: Tue, 6 Oct 2015 14:52:25 +0000 (+0200) Subject: [3974] Small updates to the expiration parser tests. X-Git-Tag: trac3874_base~37^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbead46461687e1ff462842cd0daa34e94ef6d40;p=thirdparty%2Fkea.git [3974] Small updates to the expiration parser tests. As a result of the review. --- diff --git a/src/lib/dhcpsrv/tests/cfg_expiration_unittest.cc b/src/lib/dhcpsrv/tests/cfg_expiration_unittest.cc index 86a1fc750a..5bb65afa06 100644 --- a/src/lib/dhcpsrv/tests/cfg_expiration_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_expiration_unittest.cc @@ -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 diff --git a/src/lib/dhcpsrv/tests/expiration_config_parser_unittest.cc b/src/lib/dhcpsrv/tests/expiration_config_parser_unittest.cc index f9da76ad3c..82f870aa36 100644 --- a/src/lib/dhcpsrv/tests/expiration_config_parser_unittest.cc +++ b/src/lib/dhcpsrv/tests/expiration_config_parser_unittest.cc @@ -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"; }