From: Razvan Becheriu Date: Wed, 29 Jul 2020 17:29:04 +0000 (+0300) Subject: [#1349] addressed comments X-Git-Tag: Kea-1.8.0~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d76622ef19f98c68e7fa023e2c38c24017d80696;p=thirdparty%2Fkea.git [#1349] addressed comments --- diff --git a/src/hooks/dhcp/lease_cmds/lease_parser.cc b/src/hooks/dhcp/lease_cmds/lease_parser.cc index 40bad71216..c8048c6ea6 100644 --- a/src/hooks/dhcp/lease_cmds/lease_parser.cc +++ b/src/hooks/dhcp/lease_cmds/lease_parser.cc @@ -333,7 +333,7 @@ Lease6Parser::parse(ConstSrvConfigPtr& cfg, if ((state == Lease::STATE_DECLINED) && (type == Lease::TYPE_PD)) { isc_throw(isc::InvalidOperation, - "Invalid PD prefix in declined state."); + "Invalid declined state for PD prefix."); } // Handle user context. @@ -379,5 +379,5 @@ Lease6Parser::parse(ConstSrvConfigPtr& cfg, return (l); } -}; -}; +} // end of namespace lease_cmds +} // end of namespace isc diff --git a/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc b/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc index 0f5f280cc4..e321d8b786 100644 --- a/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc +++ b/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc @@ -1282,7 +1282,7 @@ TEST_F(LeaseCmdsTest, Lease6AddBadParams) { "2001:db8:1::1"; testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp); - // Invalid PD prefix in declined state. + // Invalid declined state for PD prefix. txt = "{\n" " \"command\": \"lease6-add\",\n" @@ -1296,7 +1296,7 @@ TEST_F(LeaseCmdsTest, Lease6AddBadParams) { " \"state\": 1" " }\n" "}"; - exp_rsp = "Invalid PD prefix in declined state."; + exp_rsp = "Invalid declined state for PD prefix."; testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp); } @@ -3676,7 +3676,7 @@ TEST_F(LeaseCmdsTest, Lease6UpdateBadParams) { "'{ \"comment\": \"in user context\" }'"; testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp); - // Invalid PD prefix in declined state. + // Invalid declined state for PD prefix. txt = "{\n" " \"command\": \"lease6-update\",\n" @@ -3690,7 +3690,7 @@ TEST_F(LeaseCmdsTest, Lease6UpdateBadParams) { " \"state\": 1" " }\n" "}"; - exp_rsp = "Invalid PD prefix in declined state."; + exp_rsp = "Invalid declined state for PD prefix."; testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp); } @@ -4713,7 +4713,7 @@ TEST_F(LeaseCmdsTest, Lease6BulkApplyAddsOnlyBadParam) { " ]" " }" "}"; - string exp_rsp = "Invalid PD prefix in declined state."; + string exp_rsp = "Invalid declined state for PD prefix."; testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp); // Check that the lease was not inserted. @@ -4791,7 +4791,7 @@ TEST_F(LeaseCmdsTest, Lease6BulkApplyUpdatesOnlyBadParam) { " ]" " }" "}"; - string exp_rsp = "Invalid PD prefix in declined state."; + string exp_rsp = "Invalid declined state for PD prefix."; testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp); // Check that the lease we inserted is stored.