From: Andrei Pavel Date: Fri, 17 Dec 2021 14:22:33 +0000 (+0200) Subject: [#2084] log checks for trailing commas for NETCONF X-Git-Tag: Kea-2.1.2~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea8f302fe67ff814846b7f990fe8c0d4df232e48;p=thirdparty%2Fkea.git [#2084] log checks for trailing commas for NETCONF --- diff --git a/src/bin/agent/tests/parser_unittests.cc b/src/bin/agent/tests/parser_unittests.cc index a896549f9f..3a0bab632f 100644 --- a/src/bin/agent/tests/parser_unittests.cc +++ b/src/bin/agent/tests/parser_unittests.cc @@ -865,7 +865,7 @@ public: /// /// @param loc Location of the trailing comma. void addLog(const string& loc) { - string log = "CTRL_AGENT_CONFIG_SYNTAX_WARNING Control Agent "; + string log = "CTRL_AGENT_CONFIG_SYNTAX_WARNING Control Agent "; log += "configuration syntax warning: " + loc; log += ": Extraneous comma. "; log += "A piece of configuration may have been omitted."; diff --git a/src/bin/d2/tests/parser_unittest.cc b/src/bin/d2/tests/parser_unittest.cc index 5ad96bc66d..910051172a 100644 --- a/src/bin/d2/tests/parser_unittest.cc +++ b/src/bin/d2/tests/parser_unittest.cc @@ -815,7 +815,7 @@ public: /// /// @param loc Location of the trailing comma. void addLog(const string& loc) { - string log = "DHCP_DDNS_CONFIG_SYNTAX_WARNING DHCP-DDNS server "; + string log = "DHCP_DDNS_CONFIG_SYNTAX_WARNING DHCP-DDNS server "; log += "configuration syntax warning: " + loc; log += ": Extraneous comma. "; log += "A piece of configuration may have been omitted."; diff --git a/src/bin/dhcp4/tests/parser_unittest.cc b/src/bin/dhcp4/tests/parser_unittest.cc index 03fa55d7ec..9252e56160 100644 --- a/src/bin/dhcp4/tests/parser_unittest.cc +++ b/src/bin/dhcp4/tests/parser_unittest.cc @@ -890,7 +890,7 @@ public: log += "A piece of configuration may have been omitted."; addString(log); } -}; +}; // Test that trailing commas are allowed. TEST_F(TrailingCommasTest, tests) { diff --git a/src/bin/netconf/tests/parser_unittests.cc b/src/bin/netconf/tests/parser_unittests.cc index da953a09b7..b496470b00 100644 --- a/src/bin/netconf/tests/parser_unittests.cc +++ b/src/bin/netconf/tests/parser_unittests.cc @@ -925,7 +925,7 @@ public: /// /// @param loc Location of the trailing comma. void addLog(const string& loc) { - string log = "NETCONF_CONFIG_SYNTAX_WARNING Netconf "; + string log = "NETCONF_CONFIG_SYNTAX_WARNING Netconf "; log += "configuration syntax warning: " + loc; log += ": Extraneous comma. "; log += "A piece of configuration may have been omitted."; @@ -967,8 +967,15 @@ TEST_F(TrailingCommasTest, tests) { })"); testParser(txt, ParserContext::PARSER_NETCONF, false); - addLog(":7.16"); - /// @todo + addLog(":8.25"); + addLog(":9.8"); + addLog(":15.32"); + addLog(":17.36"); + addLog(":22.32"); + addLog(":24.36"); + addLog(":25.8"); + addLog(":28.29"); + addLog(":29.4"); EXPECT_TRUE(checkFile()); // Test with many consecutive commas.