Parcourir la source

[3974] Small updates to the expiration parser tests.

As a result of the review.
Marcin Siodelski il y a 9 ans
Parent
commit
bbead46461

+ 4 - 0
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

+ 5 - 0
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";
 }