]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5110] Minor changes after review:
authorTomek Mrugalski <tomasz@isc.org>
Fri, 17 Feb 2017 12:11:32 +0000 (13:11 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 17 Feb 2017 12:11:32 +0000 (13:11 +0100)
 - port check fixed
 - removed 2 unused parameter warnings
 - one typo corrected

src/bin/d2/d2_parser.yy
src/bin/d2/tests/d2_cfg_mgr_unittests.cc
src/bin/d2/tests/d2_simple_parser_unittest.cc
src/bin/d2/tests/testdata/d2_cfg_tests.json
src/lib/process/d_controller.h
src/lib/process/testutils/d_test_stubs.cc

index bd28a36867828b88e13a7dc90a2c56febeabec31..36df4a48ed886e8699761470363f1af049e319bf 100644 (file)
@@ -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);
index 3d3895c97cdd2d56a7c8396551383c9117012cb8..36e035e1be1b49ec511df33831b928e881857e9e 100644 (file)
@@ -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, "<string>:1.40: port must be greater than zero but less than 65792");
+    SYNTAX_ERROR(config, "<string>: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");
index 13ae2b2df52a8ae7d46ebe146c4721eec2acda7b..1c496d0a3555042564d654dbcee354e8ac633440 100644 (file)
@@ -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, "<string>:1.60-63: port must be greater than zero but less than 65792");
+    PARSE_FAIL(config, "<string>:1.60-63: port must be greater than zero but less than 65536");
 }
 
 
index f86cf7b6224d7f6062bc094d2f8281d7c8373e78..4144e381c31d0fac8bf1139fca8a0f1bb0c083e9 100644 (file)
 #-----
 ,{
 "description" : "D2Params.port can't be 0",
-"syntax-error" : "<string>:1.33: port must be greater than zero but less than 65792",
+"syntax-error" : "<string>:1.33: port must be greater than zero but less than 65536",
 "data" :
     {
     "port" : 0,
index 3ee8c7e5dd009e54d9aede7c0f6b5a6f76b30155..6ba258a25a19661f2f61b1fb34302cfe2dbfba05 100644 (file)
@@ -429,6 +429,7 @@ protected:
     /// @return pointer to the elements created
     ///
     virtual isc::data::ConstElementPtr parseText(const std::string& input) {
+        static_cast<void>(input); // just tu shut up the unused parameter warning
         isc::data::ConstElementPtr elements;
         return (elements);
     }
index 28f738db3abb164efe8509e2dd2f1a1e82dbe4a4..3e9104a034413c12689e162c33f3c7ffa7f3e74d 100644 (file)
@@ -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;