diff options
author | Andrei Pavel <andrei.pavel@qualitance.com> | 2017-08-18 09:27:29 +0200 |
---|---|---|
committer | Andrei Pavel <andrei.pavel@qualitance.com> | 2017-08-18 09:34:26 +0200 |
commit | 6e5ddf2725b14d37f3ee1755352f1bb206f04687 (patch) | |
tree | 8ef3dfa91337bb2ebcf82536f802b21b1f2eb3d6 /src/bin | |
parent | reverted some changes which are too pedantic (diff) | |
download | kea-6e5ddf2725b14d37f3ee1755352f1bb206f04687.tar.xz kea-6e5ddf2725b14d37f3ee1755352f1bb206f04687.zip |
minor changes:
* dynamic exception specifications are deprecated in C++11 (throw on
function definition)
* INSTANTIATE_TEST_CASE_P gives a warning about variadic arguments
having at least one argument. The IntToString functor is what it
requires for test cases to be displayed correctly.
* Options should be merged with formatted option included in the
identifier. This was unit-tested, but masked by an incorrect csv-format
value in test data. Merge not used in actual code, but used in
Cassandra PR.
* ifdefs in MACROS are not portable
* added missing doxygen comments
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/dhcp4/tests/get_config_unittest.cc | 24 | ||||
-rw-r--r-- | src/bin/dhcp4/tests/get_config_unittest.cc.skel | 16 | ||||
-rw-r--r-- | src/bin/dhcp6/tests/get_config_unittest.cc | 26 | ||||
-rw-r--r-- | src/bin/dhcp6/tests/get_config_unittest.cc.skel | 16 |
4 files changed, 57 insertions, 25 deletions
diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc b/src/bin/dhcp4/tests/get_config_unittest.cc index 0aff18e76e..92f618985d 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc +++ b/src/bin/dhcp4/tests/get_config_unittest.cc @@ -5982,7 +5982,7 @@ outputFormatted(const std::string& config) { } } -}; +} // namespace namespace isc { namespace dhcp { @@ -6013,9 +6013,9 @@ extractConfig(const std::string& config) { ++extract_count; } -}; -}; -}; +} // namespace test +} // namespace dhcp +} // namespace isc namespace { @@ -6199,8 +6199,16 @@ TEST_P(Dhcp4GetConfigTest, run) { EXPECT_TRUE(isEquivalent(unparsed, unparsed2)); } -/// Define the parameterized test loop -INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest, - ::testing::Range(static_cast<size_t>(0), max_config_counter)); - +class IntToString { +public: + std::string operator()(const testing::TestParamInfo<size_t>& n) { + return to_string(n.param); + } }; + +/// Define the parameterized test loop. +INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest, + ::testing::Range(static_cast<size_t>(0), + max_config_counter), + IntToString()); +} // namespace diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc.skel b/src/bin/dhcp4/tests/get_config_unittest.cc.skel index 825a6d62ab..0c23840871 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc.skel +++ b/src/bin/dhcp4/tests/get_config_unittest.cc.skel @@ -338,8 +338,16 @@ TEST_P(Dhcp4GetConfigTest, run) { EXPECT_TRUE(isEquivalent(unparsed, unparsed2)); } -/// Define the parameterized test loop -INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest, - ::testing::Range(static_cast<size_t>(0), max_config_counter)); - +class IntToString { +public: + std::string operator()(const testing::TestParamInfo<size_t>& n) { + return to_string(n.param); + } }; + +/// Define the parameterized test loop. +INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest, + ::testing::Range(static_cast<size_t>(0), + max_config_counter), + IntToString()); +} // namespace diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc b/src/bin/dhcp6/tests/get_config_unittest.cc index 901e954336..223d29b6c6 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc +++ b/src/bin/dhcp6/tests/get_config_unittest.cc @@ -3204,7 +3204,7 @@ const char* UNPARSED_CONFIGS[] = { " {\n" " \"always-send\": false,\n" " \"code\": 7,\n" -" \"csv-format\": false,\n" +" \"csv-format\": true,\n" " \"data\": \"01\",\n" " \"name\": \"preference\",\n" " \"space\": \"dhcp6\"\n" @@ -5831,7 +5831,7 @@ outputFormatted(const std::string& config) { } } -}; +} namespace isc { namespace dhcp { @@ -5862,9 +5862,9 @@ extractConfig(const std::string& config) { ++extract_count; } -}; -}; -}; +} // namespace test +} // namespace dhcp +} // namespace isc namespace { @@ -6051,8 +6051,16 @@ TEST_P(Dhcp6GetConfigTest, run) { EXPECT_TRUE(isEquivalent(unparsed, unparsed2)); } -/// Define the parameterized test loop -INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest, - ::testing::Range(static_cast<size_t>(0), max_config_counter)); - +class IntToString { +public: + std::string operator()(const testing::TestParamInfo<size_t>& n) { + return to_string(n.param); + } }; + +/// Define the parameterized test loop. +INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest, + ::testing::Range(static_cast<size_t>(0), + max_config_counter), + IntToString()); +} // namespace diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc.skel b/src/bin/dhcp6/tests/get_config_unittest.cc.skel index 93604ed6c9..59d9d722a6 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc.skel +++ b/src/bin/dhcp6/tests/get_config_unittest.cc.skel @@ -341,8 +341,16 @@ TEST_P(Dhcp6GetConfigTest, run) { EXPECT_TRUE(isEquivalent(unparsed, unparsed2)); } -/// Define the parameterized test loop -INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest, - ::testing::Range(static_cast<size_t>(0), max_config_counter)); - +class IntToString { +public: + std::string operator()(const testing::TestParamInfo<size_t>& n) { + return to_string(n.param); + } }; + +/// Define the parameterized test loop. +INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest, + ::testing::Range(static_cast<size_t>(0), + max_config_counter), + IntToString()); +} // namespace |