From aa10ecc86fd16e4c7788dc655a6b1a975643c350 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Wed, 20 May 2015 16:14:41 +0200 Subject: [PATCH] [3796] ccsession.cc|h renamed to command_interpreter.cc|h --- src/bin/d2/bundy_d2_controller.h | 2 +- src/bin/d2/d2_process.cc | 2 +- src/bin/d2/d_cfg_mgr.cc | 2 +- src/bin/d2/d_controller.cc | 2 +- .../d2/tests/bundy_d2_controller_unittests.cc | 2 +- src/bin/d2/tests/d2_controller_unittests.cc | 2 +- src/bin/d2/tests/d2_process_unittests.cc | 2 +- src/bin/d2/tests/d_cfg_mgr_unittests.cc | 2 +- src/bin/d2/tests/d_controller_unittests.cc | 2 +- src/bin/d2/tests/d_test_stubs.h | 2 +- src/bin/dhcp4/bundy_controller.cc | 2 +- src/bin/dhcp4/ctrl_dhcp4_srv.h | 2 +- src/bin/dhcp4/json_config_parser.cc | 2 +- src/bin/dhcp4/tests/config_parser_unittest.cc | 2 +- .../dhcp4/tests/ctrl_dhcp4_srv_unittest.cc | 2 +- src/bin/dhcp4/tests/d2_unittest.h | 2 +- src/bin/dhcp4/tests/dhcp4_srv_unittest.cc | 3 +-- src/bin/dhcp4/tests/dhcp4_test_utils.cc | 2 +- src/bin/dhcp4/tests/dhcp4_test_utils.h | 2 +- .../dhcp4/tests/kea_controller_unittest.cc | 2 +- src/bin/dhcp6/bundy_controller.cc | 2 +- src/bin/dhcp6/ctrl_dhcp6_srv.h | 2 +- src/bin/dhcp6/json_config_parser.cc | 2 +- src/bin/dhcp6/tests/config_parser_unittest.cc | 2 +- .../dhcp6/tests/ctrl_dhcp6_srv_unittest.cc | 2 +- src/bin/dhcp6/tests/d2_unittest.h | 2 +- src/bin/dhcp6/tests/dhcp6_srv_unittest.cc | 2 +- src/bin/dhcp6/tests/dhcp6_test_utils.cc | 2 +- src/bin/dhcp6/tests/hooks_unittest.cc | 2 +- .../dhcp6/tests/kea_controller_unittest.cc | 2 +- src/lib/config/Makefile.am | 2 +- .../{ccsession.cc => command_interpreter.cc} | 5 ++++- .../{ccsession.h => command_interpreter.h} | 0 src/lib/config/tests/Makefile.am | 3 ++- ...ts.cc => command_interpreter_unittests.cc} | 19 +++++-------------- .../dhcpsrv/tests/dbaccess_parser_unittest.cc | 2 +- .../dhcpsrv/tests/dhcp_parsers_unittest.cc | 2 +- .../dhcpsrv/testutils/config_result_check.cc | 2 +- 38 files changed, 45 insertions(+), 51 deletions(-) rename src/lib/config/{ccsession.cc => command_interpreter.cc} (98%) rename src/lib/config/{ccsession.h => command_interpreter.h} (100%) rename src/lib/config/tests/{ccsession_unittests.cc => command_interpreter_unittests.cc} (96%) diff --git a/src/bin/d2/bundy_d2_controller.h b/src/bin/d2/bundy_d2_controller.h index 8ea0337f57..91c2439a1e 100644 --- a/src/bin/d2/bundy_d2_controller.h +++ b/src/bin/d2/bundy_d2_controller.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/bin/d2/d2_process.cc b/src/bin/d2/d2_process.cc index 702602ada4..daed1b4fc8 100644 --- a/src/bin/d2/d2_process.cc +++ b/src/bin/d2/d2_process.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/d2/d_cfg_mgr.cc b/src/bin/d2/d_cfg_mgr.cc index 974a25bfd1..06c857a7a6 100644 --- a/src/bin/d2/d_cfg_mgr.cc +++ b/src/bin/d2/d_cfg_mgr.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/d2/d_controller.cc b/src/bin/d2/d_controller.cc index 9c20ce18d9..9686f93669 100644 --- a/src/bin/d2/d_controller.cc +++ b/src/bin/d2/d_controller.cc @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bin/d2/tests/bundy_d2_controller_unittests.cc b/src/bin/d2/tests/bundy_d2_controller_unittests.cc index 05747261f2..acc4c5ee17 100644 --- a/src/bin/d2/tests/bundy_d2_controller_unittests.cc +++ b/src/bin/d2/tests/bundy_d2_controller_unittests.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/d2/tests/d2_controller_unittests.cc b/src/bin/d2/tests/d2_controller_unittests.cc index 2421537943..95695ac9ec 100644 --- a/src/bin/d2/tests/d2_controller_unittests.cc +++ b/src/bin/d2/tests/d2_controller_unittests.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/d2/tests/d2_process_unittests.cc b/src/bin/d2/tests/d2_process_unittests.cc index b31f0b1d49..9cfbdbfac6 100644 --- a/src/bin/d2/tests/d2_process_unittests.cc +++ b/src/bin/d2/tests/d2_process_unittests.cc @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bin/d2/tests/d_cfg_mgr_unittests.cc b/src/bin/d2/tests/d_cfg_mgr_unittests.cc index 1c1e23b516..37e3dad988 100644 --- a/src/bin/d2/tests/d_cfg_mgr_unittests.cc +++ b/src/bin/d2/tests/d_cfg_mgr_unittests.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/d2/tests/d_controller_unittests.cc b/src/bin/d2/tests/d_controller_unittests.cc index b676019059..ef48b5bbf1 100644 --- a/src/bin/d2/tests/d_controller_unittests.cc +++ b/src/bin/d2/tests/d_controller_unittests.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include diff --git a/src/bin/d2/tests/d_test_stubs.h b/src/bin/d2/tests/d_test_stubs.h index ab50ae709c..232b933923 100644 --- a/src/bin/d2/tests/d_test_stubs.h +++ b/src/bin/d2/tests/d_test_stubs.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/src/bin/dhcp4/bundy_controller.cc b/src/bin/dhcp4/bundy_controller.cc index c5757485f0..465ad663db 100644 --- a/src/bin/dhcp4/bundy_controller.cc +++ b/src/bin/dhcp4/bundy_controller.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.h b/src/bin/dhcp4/ctrl_dhcp4_srv.h index ba8fc95b4d..686098bcff 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.h +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace isc { diff --git a/src/bin/dhcp4/json_config_parser.cc b/src/bin/dhcp4/json_config_parser.cc index 418b978b0e..5b22a6a9be 100644 --- a/src/bin/dhcp4/json_config_parser.cc +++ b/src/bin/dhcp4/json_config_parser.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc index 7cb289ca06..67a1e30432 100644 --- a/src/bin/dhcp4/tests/config_parser_unittest.cc +++ b/src/bin/dhcp4/tests/config_parser_unittest.cc @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc index 5f111b4fb9..d1b72ff41b 100644 --- a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/dhcp4/tests/d2_unittest.h b/src/bin/dhcp4/tests/d2_unittest.h index 673b8662db..a86086bb1e 100644 --- a/src/bin/dhcp4/tests/d2_unittest.h +++ b/src/bin/dhcp4/tests/d2_unittest.h @@ -18,7 +18,7 @@ #define D2_UNITTEST_H #include -#include +#include #include diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index f44e7627ee..47ebb263a6 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -42,7 +42,6 @@ #include #include #include -#include #include diff --git a/src/bin/dhcp4/tests/dhcp4_test_utils.cc b/src/bin/dhcp4/tests/dhcp4_test_utils.cc index 32e834aedf..ee3684bfde 100644 --- a/src/bin/dhcp4/tests/dhcp4_test_utils.cc +++ b/src/bin/dhcp4/tests/dhcp4_test_utils.cc @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bin/dhcp4/tests/dhcp4_test_utils.h b/src/bin/dhcp4/tests/dhcp4_test_utils.h index f3ba99cedd..512e70aace 100644 --- a/src/bin/dhcp4/tests/dhcp4_test_utils.h +++ b/src/bin/dhcp4/tests/dhcp4_test_utils.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/bin/dhcp4/tests/kea_controller_unittest.cc b/src/bin/dhcp4/tests/kea_controller_unittest.cc index d98621ed0e..2235bdbbad 100644 --- a/src/bin/dhcp4/tests/kea_controller_unittest.cc +++ b/src/bin/dhcp4/tests/kea_controller_unittest.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/dhcp6/bundy_controller.cc b/src/bin/dhcp6/bundy_controller.cc index c4e12062c1..02f31ab57c 100644 --- a/src/bin/dhcp6/bundy_controller.cc +++ b/src/bin/dhcp6/bundy_controller.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.h b/src/bin/dhcp6/ctrl_dhcp6_srv.h index 780a9a2154..cf5fa18bd9 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.h +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace isc { diff --git a/src/bin/dhcp6/json_config_parser.cc b/src/bin/dhcp6/json_config_parser.cc index 1ca364129d..0d960b8eb7 100644 --- a/src/bin/dhcp6/json_config_parser.cc +++ b/src/bin/dhcp6/json_config_parser.cc @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index f843b160ea..a0c624c761 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc index 110adc8fbb..f0b53c81ed 100644 --- a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/bin/dhcp6/tests/d2_unittest.h b/src/bin/dhcp6/tests/d2_unittest.h index 8a77c9bc70..4a2a029e79 100644 --- a/src/bin/dhcp6/tests/d2_unittest.h +++ b/src/bin/dhcp6/tests/d2_unittest.h @@ -18,7 +18,7 @@ #define D2_UNITTEST_H #include -#include +#include #include diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 8548d9947d..4e3d13afe4 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/bin/dhcp6/tests/dhcp6_test_utils.cc b/src/bin/dhcp6/tests/dhcp6_test_utils.cc index 83a466a105..9fe610e572 100644 --- a/src/bin/dhcp6/tests/dhcp6_test_utils.cc +++ b/src/bin/dhcp6/tests/dhcp6_test_utils.cc @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include using namespace isc::data; diff --git a/src/bin/dhcp6/tests/hooks_unittest.cc b/src/bin/dhcp6/tests/hooks_unittest.cc index 40c3de83cf..a83ce22d1f 100644 --- a/src/bin/dhcp6/tests/hooks_unittest.cc +++ b/src/bin/dhcp6/tests/hooks_unittest.cc @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bin/dhcp6/tests/kea_controller_unittest.cc b/src/bin/dhcp6/tests/kea_controller_unittest.cc index dfed9fc4d1..00b6182b2d 100644 --- a/src/bin/dhcp6/tests/kea_controller_unittest.cc +++ b/src/bin/dhcp6/tests/kea_controller_unittest.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/lib/config/Makefile.am b/src/lib/config/Makefile.am index 32e56831f6..c295caa045 100644 --- a/src/lib/config/Makefile.am +++ b/src/lib/config/Makefile.am @@ -17,7 +17,7 @@ BUILT_SOURCES = config_messages.h config_messages.cc lib_LTLIBRARIES = libkea-cfgclient.la libkea_cfgclient_la_SOURCES = config_data.h config_data.cc libkea_cfgclient_la_SOURCES += module_spec.h module_spec.cc -libkea_cfgclient_la_SOURCES += ccsession.cc ccsession.h +libkea_cfgclient_la_SOURCES += command_interpreter.cc command_interpreter.h libkea_cfgclient_la_SOURCES += config_log.h config_log.cc libkea_cfgclient_la_LIBADD = $(top_builddir)/src/lib/cc/libkea-cc.la diff --git a/src/lib/config/ccsession.cc b/src/lib/config/command_interpreter.cc similarity index 98% rename from src/lib/config/ccsession.cc rename to src/lib/config/command_interpreter.cc index 6b8bf30b0a..7a87ad0927 100644 --- a/src/lib/config/ccsession.cc +++ b/src/lib/config/command_interpreter.cc @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -167,6 +167,9 @@ parseCommand(ConstElementPtr& arg, ConstElementPtr command) { return (cmd->stringValue()); } +/// @todo: The code below should be reviewed whether it's still in use. If it is, +/// it should be moved to a separate file. + namespace { // Temporary workaround functions for missing functionality in // getValue() (main problem described in ticket #993) diff --git a/src/lib/config/ccsession.h b/src/lib/config/command_interpreter.h similarity index 100% rename from src/lib/config/ccsession.h rename to src/lib/config/command_interpreter.h diff --git a/src/lib/config/tests/Makefile.am b/src/lib/config/tests/Makefile.am index 6a7abe1343..6fb947c911 100644 --- a/src/lib/config/tests/Makefile.am +++ b/src/lib/config/tests/Makefile.am @@ -17,7 +17,8 @@ TESTS_ENVIRONMENT = \ TESTS = if HAVE_GTEST TESTS += run_unittests -run_unittests_SOURCES = ccsession_unittests.cc module_spec_unittests.cc config_data_unittests.cc run_unittests.cc +run_unittests_SOURCES = command_interpreter_unittests.cc module_spec_unittests.cc +run_unittests_SOURCES += config_data_unittests.cc run_unittests.cc run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) diff --git a/src/lib/config/tests/ccsession_unittests.cc b/src/lib/config/tests/command_interpreter_unittests.cc similarity index 96% rename from src/lib/config/tests/ccsession_unittests.cc rename to src/lib/config/tests/command_interpreter_unittests.cc index c6fe8c7eb9..34ab774e48 100644 --- a/src/lib/config/tests/ccsession_unittests.cc +++ b/src/lib/config/tests/command_interpreter_unittests.cc @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -37,16 +37,7 @@ el(const std::string& str) { return (Element::fromJSON(str)); } -class CCSessionTest : public ::testing::Test { -protected: - CCSessionTest() - { - } - ~CCSessionTest() { - } -}; - -TEST_F(CCSessionTest, createAnswer) { +TEST(CommandInterpreterTest, createAnswer) { ConstElementPtr answer; answer = createAnswer(); EXPECT_EQ("{ \"result\": 0 }", answer->str()); @@ -62,7 +53,7 @@ TEST_F(CCSessionTest, createAnswer) { answer->str()); } -TEST_F(CCSessionTest, parseAnswer) { +TEST(CommandInterpreterTest, parseAnswer) { ConstElementPtr answer; ConstElementPtr arg; int rcode; @@ -92,7 +83,7 @@ TEST_F(CCSessionTest, parseAnswer) { EXPECT_EQ("[ \"just\", \"some\", \"data\" ]", arg->str()); } -TEST_F(CCSessionTest, createCommand) { +TEST(CommandInterpreterTest, createCommand) { ConstElementPtr command; ConstElementPtr arg; @@ -115,7 +106,7 @@ TEST_F(CCSessionTest, createCommand) { command->str()); } -TEST_F(CCSessionTest, parseCommand) { +TEST(CommandInterpreterTest, parseCommand) { ConstElementPtr arg; std::string cmd; diff --git a/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc b/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc index 24448271e9..db8e5bb6fe 100644 --- a/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc +++ b/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc @@ -14,7 +14,7 @@ #include -#include +#include #include #include #include diff --git a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc index 51e12f1cae..c5e62b136e 100644 --- a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc +++ b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc @@ -13,7 +13,7 @@ // PERFORMANCE OF THIS SOFTWARE. #include -#include +#include #include #include #include diff --git a/src/lib/dhcpsrv/testutils/config_result_check.cc b/src/lib/dhcpsrv/testutils/config_result_check.cc index b56bc9e537..0fc67d32a1 100644 --- a/src/lib/dhcpsrv/testutils/config_result_check.cc +++ b/src/lib/dhcpsrv/testutils/config_result_check.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include +#include #include #include #include