Commit 8d39e952 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[5110] Minor changes after review:

 - port check fixed
 - removed 2 unused parameter warnings
 - one typo corrected
parent 9108d8f9
......@@ -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);
......
......@@ -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");
......
......@@ -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");
}
......
......@@ -163,7 +163,7 @@
#-----
,{
"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,
......
......@@ -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);
}
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment