diff options
author | Thomas Markwalder <tmark@isc.org> | 2014-05-20 13:16:05 +0200 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2014-05-20 13:16:05 +0200 |
commit | ff3fc5e41f5e45bbc0709e0ad28dd64579d81850 (patch) | |
tree | a34b6a15b4a70443bd55b6654797553fb391c279 /src/bin/d2/tests/d2_cfg_mgr_unittests.cc | |
parent | [3268] Fixed a couple of typos during a review. (diff) | |
download | kea-ff3fc5e41f5e45bbc0709e0ad28dd64579d81850.tar.xz kea-ff3fc5e41f5e45bbc0709e0ad28dd64579d81850.zip |
[3432] Addressed review comments
Added missing commentary, corrected typos.
Diffstat (limited to 'src/bin/d2/tests/d2_cfg_mgr_unittests.cc')
-rw-r--r-- | src/bin/d2/tests/d2_cfg_mgr_unittests.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/bin/d2/tests/d2_cfg_mgr_unittests.cc b/src/bin/d2/tests/d2_cfg_mgr_unittests.cc index be9caa7fdd..79d162ba7b 100644 --- a/src/bin/d2/tests/d2_cfg_mgr_unittests.cc +++ b/src/bin/d2/tests/d2_cfg_mgr_unittests.cc @@ -82,6 +82,18 @@ public: return (config.str()); } + /// @brief Parses a configuration string and tests against a given outcome + /// + /// Convenience method which accepts JSON text and an expected pass or fail + /// outcome. It converts the text into an ElementPtr and passes that to + /// configuration manager's parseConfig method. It then tests the + /// parse result against the expected outcome If they do not match it + /// the method asserts a failure. If they do match, it refreshes the + /// the D2Params pointer with the newly parsed instance. + /// + /// @param config_str the JSON configuration text to parse + /// @param should_fail boolean indicator if the parsing should fail or not. + /// It defaults to false. void runConfig(std::string config_str, bool should_fail=false) { // We assume the config string is valid JSON. ASSERT_TRUE(fromJSON(config_str)); @@ -99,6 +111,7 @@ public: ASSERT_TRUE(d2_params_); } + /// @brief Pointer the D2Params most recently parsed. D2ParamsPtr d2_params_; }; @@ -1060,9 +1073,6 @@ TEST(D2CfgMgr, construction) { EXPECT_NO_THROW(delete cfg_mgr); } -TEST_F(D2CfgMgrTest, paramsConfig) { -} - /// @brief Tests the parsing of a complete, valid DHCP-DDNS configuration. /// This tests passes the configuration into an instance of D2CfgMgr just /// as it would be done by d2_process in response to a configuration update |