From: Tomek Mrugalski Date: Fri, 17 Feb 2017 12:11:32 +0000 (+0100) Subject: [5110] Minor changes after review: X-Git-Tag: trac1205_base^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d39e95282fd241b6f3f274d60330fec50d61f65;p=thirdparty%2Fkea.git [5110] Minor changes after review: - port check fixed - removed 2 unused parameter warnings - one typo corrected --- diff --git a/src/bin/d2/d2_parser.yy b/src/bin/d2/d2_parser.yy index bd28a36867..36df4a48ed 100644 --- a/src/bin/d2/d2_parser.yy +++ b/src/bin/d2/d2_parser.yy @@ -272,8 +272,8 @@ ip_address: IP_ADDRESS { }; port: PORT COLON INTEGER { - if ($3 <= 0 || $3 >= 65792 ) { - error(@3, "port must be greater than zero but less than 65792"); + if ($3 <= 0 || $3 >= 65535 ) { + error(@3, "port must be greater than zero but less than 65535"); } ElementPtr i(new IntElement($3, ctx.loc2pos(@3))); ctx.stack_.back()->set("port", i); @@ -484,8 +484,8 @@ dns_server_ip_address: IP_ADDRESS { }; dns_server_port: PORT COLON INTEGER { - if ($3 <= 0 || $3 >= 65792 ) { - error(@3, "port must be greater than zero but less than 65792"); + if ($3 <= 0 || $3 >= 65535 ) { + error(@3, "port must be greater than zero but less than 65536"); } ElementPtr i(new IntElement($3, ctx.loc2pos(@3))); ctx.stack_.back()->set("port", i); diff --git a/src/bin/d2/tests/d2_cfg_mgr_unittests.cc b/src/bin/d2/tests/d2_cfg_mgr_unittests.cc index 3d3895c97c..36e035e1be 100644 --- a/src/bin/d2/tests/d2_cfg_mgr_unittests.cc +++ b/src/bin/d2/tests/d2_cfg_mgr_unittests.cc @@ -421,7 +421,7 @@ TEST_F(D2CfgMgrTest, invalidEntry) { // Cannot use port 0 config = makeParamsConfigString ("127.0.0.1", 0, 333, "UDP", "JSON"); - SYNTAX_ERROR(config, ":1.40: port must be greater than zero but less than 65792"); + SYNTAX_ERROR(config, ":1.40: port must be greater than zero but less than 65535"); // Cannot use dns server timeout of 0 config = makeParamsConfigString ("127.0.0.1", 777, 0, "UDP", "JSON"); diff --git a/src/bin/d2/tests/d2_simple_parser_unittest.cc b/src/bin/d2/tests/d2_simple_parser_unittest.cc index 13ae2b2df5..1c496d0a35 100644 --- a/src/bin/d2/tests/d2_simple_parser_unittest.cc +++ b/src/bin/d2/tests/d2_simple_parser_unittest.cc @@ -150,7 +150,7 @@ class D2SimpleParserTest : public ::testing::Test { public: /// @brief Constructor /// - /// @param parser_type specificies the parsing starting point at which + /// @param parser_type specifies the parsing starting point at which /// the JSON parser should begin. It defaults to PARSER_JSON. See @c /// D2ParserContext::ParserType for all possible values. D2SimpleParserTest(const D2ParserContext::ParserType& @@ -835,7 +835,7 @@ TEST_F(DnsServerInfoParserTest, invalidEntry) { config = "{ \"hostname\": \"\", " " \"ip-address\": \"192.168.5.6\" ," " \"port\": -100 }"; - PARSE_FAIL(config, ":1.60-63: port must be greater than zero but less than 65792"); + PARSE_FAIL(config, ":1.60-63: port must be greater than zero but less than 65536"); } diff --git a/src/bin/d2/tests/testdata/d2_cfg_tests.json b/src/bin/d2/tests/testdata/d2_cfg_tests.json index f86cf7b622..4144e381c3 100644 --- a/src/bin/d2/tests/testdata/d2_cfg_tests.json +++ b/src/bin/d2/tests/testdata/d2_cfg_tests.json @@ -163,7 +163,7 @@ #----- ,{ "description" : "D2Params.port can't be 0", -"syntax-error" : ":1.33: port must be greater than zero but less than 65792", +"syntax-error" : ":1.33: port must be greater than zero but less than 65536", "data" : { "port" : 0, diff --git a/src/lib/process/d_controller.h b/src/lib/process/d_controller.h index 3ee8c7e5dd..6ba258a25a 100644 --- a/src/lib/process/d_controller.h +++ b/src/lib/process/d_controller.h @@ -429,6 +429,7 @@ protected: /// @return pointer to the elements created /// virtual isc::data::ConstElementPtr parseText(const std::string& input) { + static_cast(input); // just tu shut up the unused parameter warning isc::data::ConstElementPtr elements; return (elements); } diff --git a/src/lib/process/testutils/d_test_stubs.cc b/src/lib/process/testutils/d_test_stubs.cc index 28f738db3a..3e9104a034 100644 --- a/src/lib/process/testutils/d_test_stubs.cc +++ b/src/lib/process/testutils/d_test_stubs.cc @@ -195,7 +195,7 @@ DStubController::processSignal(int signum){ } isc::data::ConstElementPtr -DStubController::parseFile(const std::string& file_name) { +DStubController::parseFile(const std::string& /*file_name*/) { isc::data::ConstElementPtr elements; if (use_alternate_parser_) { std::ostringstream os;